Siren requests (cmd 263).
The siren plays in one of two modes:
times playMode 0 plays the alarm sound N times, about 5 s each manual playMode 2 onOff 1 plays until a request with onOff 0
The camera acknowledges with an empty status-200 reply.
Build a request that plays the siren twice
Build a request that plays the siren twice
import { assertStringIncludes } from "@std/assert"; import { sirenXml } from "@hertzg/reolink-api/protocol/siren"; const xml = sirenXml({ channel: 0, times: 2 }); assertStringIncludes(xml, "<playMode>0</playMode>"); assertStringIncludes(xml, "<playTimes>2</playTimes>");
f
sirenXml(request: SirenRequest): string
Builds the body of a siren request.
T
SirenRequest =
{ channel?: number; }
& (
& (
{ times: number; on?: never; }
| { on: boolean; times?: never; }
)| { on: boolean; times?: never; }
What sirenXml asks the siren to do: play a number of times, or
turn manual play on or off.
Usage
import * as mod from "protocol/siren.ts";