function ptzControlXml
ptzControlXml(request: PtzControlRequest): string

Builds the body of a PTZ move (cmd 18).

Examples

Tilt up at speed 10

import { assertStringIncludes } from "@std/assert";
import { PTZ_COMMAND, ptzControlXml } from "@hertzg/reolink-api/protocol/ptz";

const xml = ptzControlXml({ channel: 0, command: PTZ_COMMAND.UP, speed: 10 });

assertStringIncludes(xml, "<command>Up</command>");
assertStringIncludes(xml, "<speed>10</speed>");

Parameters

The channel, command and optional speed.

Return Type

string

The request XML, ready to be encrypted.

Usage

import { ptzControlXml } from "protocol/ptz.ts";