function snapshotXml
snapshotXml(request: SnapshotRequest): string

Builds the body of a snapshot request.

Examples

Snapshot the sub stream of channel 0

import { assertStringIncludes } from "@std/assert";
import { snapshotXml } from "@hertzg/reolink-api/protocol/snapshot";

const xml = snapshotXml({ channel: 0, stream: "sub" });

assertStringIncludes(xml, "<channelId>0</channelId>");
assertStringIncludes(xml, "<streamType>sub</streamType>");

Parameters

The channel and stream to snapshot.

Return Type

string

The request XML, ready to be encrypted.

Usage

import { snapshotXml } from "protocol/snapshot.ts";