function ptzPresetXml
ptzPresetXml(request: { channel: number; id: number; }): string

Builds the body of a request that moves to a saved preset (cmd 19).

Examples

Go to preset 3

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

const xml = ptzPresetXml({ channel: 0, id: 3 });

assertStringIncludes(xml, "<id>3</id>");
assertStringIncludes(xml, "<command>toPos</command>");

Parameters

request: { channel: number; id: number; }

The channel and the preset id from parsePtzPresets.

Return Type

string

The request XML, ready to be encrypted.

Usage

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