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.

Examples

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>");

Functions

f
sirenXml(request: SirenRequest): string

Builds the body of a siren request.

Type Aliases

T
SirenRequest =
{ channel?: number; }
& (
{ times: number; on?: never; }
| { on: boolean; times?: never; }
)

What sirenXml asks the siren to do: play a number of times, or turn manual play on or off.