function fieldDetection
fieldDetection(options?: { channel?: number; }): Resource<FieldDetection>

The field detection (intrusion) document of one channel.

Examples

A device without the feature

import { assertEquals, assertThrows } from "@std/assert";
import { IsapiError } from "../status/isapi-error.ts";
import { fieldDetection } from "./field-detection.ts";

assertEquals(fieldDetection({ channel: 2 }).path, "/ISAPI/Smart/FieldDetection/2");
assertThrows(
  () =>
    fieldDetection().codec.parse(
      "<ResponseStatus><statusCode>4</statusCode>" +
        "<subStatusCode>notSupport</subStatusCode></ResponseStatus>",
    ),
  IsapiError,
);

Parameters

optional
options: { channel?: number; }

Which channel; defaults to 1.

Return Type

The resource: its path and the codec that reads it.

Usage

import { fieldDetection } from ".";