#![allow(unused_imports)]
use crate::dm::conformance::{Clause, Condition, Conform, Conformance};
use crate::dm::meta::{EventPriority, Reporting};
use crate::dm::spec::{Attribute, Cluster, Command, Event, Feature};
use crate::dm::{Access, AccessQualities, AttributeQualities, Privilege};
use crate::error::Result;
use crate::im::{AttributeId, ClusterId, CommandId, EventId};
use crate::tlv::{
ContainerKind, Element, FromTlv, Nullable, Tag, TlvList, TlvReader, TlvWriter, ToTlv, Value,
};
pub const ID: ClusterId = 0x0552;
pub const REVISION: u16 = 1;
pub const PICS: &str = "AVSUM";
pub mod feature {
pub const DIGITAL_PTZ: u32 = 1 << 0;
pub const MECHANICAL_PAN: u32 = 1 << 1;
pub const MECHANICAL_TILT: u32 = 1 << 2;
pub const MECHANICAL_ZOOM: u32 = 1 << 3;
pub const MECHANICAL_PRESETS: u32 = 1 << 4;
}
pub const FEATURES: &[Feature] = &[
Feature {
bit: 0,
code: "DPTZ",
name: "DigitalPTZ",
conform: Conform::OPTIONAL,
},
Feature {
bit: 1,
code: "MPAN",
name: "MechanicalPan",
conform: Conform::OPTIONAL,
},
Feature {
bit: 2,
code: "MTILT",
name: "MechanicalTilt",
conform: Conform::OPTIONAL,
},
Feature {
bit: 3,
code: "MZOOM",
name: "MechanicalZoom",
conform: Conform::OPTIONAL,
},
Feature {
bit: 4,
code: "MPRESETS",
name: "MechanicalPresets",
conform: Conform {
clauses: &[Clause {
verdict: Conformance::Optional,
when: Condition::Any(&[
Condition::Feature(1),
Condition::Feature(2),
Condition::Feature(3),
]),
}],
},
},
];
pub mod attribute {
use crate::im::AttributeId;
pub const MPTZ_POSITION: AttributeId = 0x00;
pub const MAX_PRESETS: AttributeId = 0x01;
pub const MPTZ_PRESETS: AttributeId = 0x02;
pub const DPTZ_STREAMS: AttributeId = 0x03;
pub const ZOOM_MAX: AttributeId = 0x04;
pub const TILT_MIN: AttributeId = 0x05;
pub const TILT_MAX: AttributeId = 0x06;
pub const PAN_MIN: AttributeId = 0x07;
pub const PAN_MAX: AttributeId = 0x08;
pub const MOVEMENT_STATE: AttributeId = 0x09;
}
pub mod command {
use crate::im::CommandId;
pub const MPTZ_SET_POSITION: CommandId = 0x00;
pub const MPTZ_RELATIVE_MOVE: CommandId = 0x01;
pub const MPTZ_MOVE_TO_PRESET: CommandId = 0x02;
pub const MPTZ_SAVE_PRESET: CommandId = 0x03;
pub const MPTZ_REMOVE_PRESET: CommandId = 0x04;
pub const DPTZ_SET_VIEWPORT: CommandId = 0x05;
pub const DPTZ_RELATIVE_MOVE: CommandId = 0x06;
}
#[derive(Debug, Clone, Copy, PartialEq, Eq, PartialOrd, Ord, Hash)]
#[repr(u8)]
pub enum PhysicalMovementEnum {
Idle = 0,
Moving = 1,
}
impl PhysicalMovementEnum {
#[must_use]
pub const fn from_value(value: u8) -> Option<Self> {
match value {
0 => Some(Self::Idle),
1 => Some(Self::Moving),
_ => None,
}
}
#[must_use]
pub const fn value(self) -> u8 {
self as u8
}
}
impl ToTlv for PhysicalMovementEnum {
fn to_tlv(&self, w: &mut TlvWriter<'_>, tag: Tag) -> Result<()> {
self.value().to_tlv(w, tag)
}
}
impl<'a> FromTlv<'a> for PhysicalMovementEnum {
fn from_tlv(reader: &mut TlvReader<'a>, element: &Element<'a>) -> Result<Self> {
let value = <u8 as FromTlv<'a>>::from_tlv(reader, element)?;
Self::from_value(value).ok_or(crate::Error::new(crate::ErrorCode::TlvOutOfRange))
}
}
#[derive(Debug, Clone, Copy, PartialEq)]
pub struct DPTZStruct {
pub video_stream_id: u16,
pub viewport: crate::clusters::generated::globals::ViewportStruct,
}
impl ToTlv for DPTZStruct {
fn to_tlv(&self, w: &mut TlvWriter<'_>, tag: Tag) -> Result<()> {
w.start_structure(tag)?;
self.video_stream_id.to_tlv(w, Tag::Context(0))?;
self.viewport.to_tlv(w, Tag::Context(1))?;
w.end_container()
}
}
impl<'a> FromTlv<'a> for DPTZStruct {
fn from_tlv(reader: &mut TlvReader<'a>, element: &Element<'a>) -> Result<Self> {
if element.value.container() != Some(ContainerKind::Structure) {
return Err(crate::Error::new(crate::ErrorCode::TlvWrongType));
}
let mut video_stream_id = None;
let mut viewport = None;
loop {
let Some(field) = reader.next_element()? else {
return Err(crate::Error::new(crate::ErrorCode::TlvTruncated));
};
if field.value == Value::EndOfContainer {
break;
}
match field.tag.context() {
Some(0) => video_stream_id = Some(<u16>::from_tlv(reader, &field)?),
Some(1) => {
viewport = Some(
<crate::clusters::generated::globals::ViewportStruct>::from_tlv(
reader, &field,
)?,
)
}
_ => reader.skip_value(&field)?,
}
}
Ok(Self {
video_stream_id: video_stream_id
.ok_or(crate::Error::new(crate::ErrorCode::TlvNotFound))?,
viewport: viewport.ok_or(crate::Error::new(crate::ErrorCode::TlvNotFound))?,
})
}
}
#[derive(Debug, Clone, Copy, PartialEq)]
pub struct MPTZPresetStruct<'a> {
pub preset_id: u8,
pub name: &'a str,
pub settings: MPTZStruct,
}
impl<'a> ToTlv for MPTZPresetStruct<'a> {
fn to_tlv(&self, w: &mut TlvWriter<'_>, tag: Tag) -> Result<()> {
w.start_structure(tag)?;
self.preset_id.to_tlv(w, Tag::Context(0))?;
self.name.to_tlv(w, Tag::Context(1))?;
self.settings.to_tlv(w, Tag::Context(2))?;
w.end_container()
}
}
impl<'a> FromTlv<'a> for MPTZPresetStruct<'a> {
fn from_tlv(reader: &mut TlvReader<'a>, element: &Element<'a>) -> Result<Self> {
if element.value.container() != Some(ContainerKind::Structure) {
return Err(crate::Error::new(crate::ErrorCode::TlvWrongType));
}
let mut preset_id = None;
let mut name = None;
let mut settings = None;
loop {
let Some(field) = reader.next_element()? else {
return Err(crate::Error::new(crate::ErrorCode::TlvTruncated));
};
if field.value == Value::EndOfContainer {
break;
}
match field.tag.context() {
Some(0) => preset_id = Some(<u8>::from_tlv(reader, &field)?),
Some(1) => name = Some(<&'a str>::from_tlv(reader, &field)?),
Some(2) => settings = Some(<MPTZStruct>::from_tlv(reader, &field)?),
_ => reader.skip_value(&field)?,
}
}
Ok(Self {
preset_id: preset_id.ok_or(crate::Error::new(crate::ErrorCode::TlvNotFound))?,
name: name.ok_or(crate::Error::new(crate::ErrorCode::TlvNotFound))?,
settings: settings.ok_or(crate::Error::new(crate::ErrorCode::TlvNotFound))?,
})
}
}
#[derive(Debug, Clone, Copy, PartialEq)]
pub struct MPTZStruct {
pub pan: Option<i16>,
pub tilt: Option<i16>,
pub zoom: Option<u8>,
}
impl ToTlv for MPTZStruct {
fn to_tlv(&self, w: &mut TlvWriter<'_>, tag: Tag) -> Result<()> {
w.start_structure(tag)?;
if let Some(value) = &self.pan {
value.to_tlv(w, Tag::Context(0))?;
}
if let Some(value) = &self.tilt {
value.to_tlv(w, Tag::Context(1))?;
}
if let Some(value) = &self.zoom {
value.to_tlv(w, Tag::Context(2))?;
}
w.end_container()
}
}
impl<'a> FromTlv<'a> for MPTZStruct {
fn from_tlv(reader: &mut TlvReader<'a>, element: &Element<'a>) -> Result<Self> {
if element.value.container() != Some(ContainerKind::Structure) {
return Err(crate::Error::new(crate::ErrorCode::TlvWrongType));
}
let mut pan = None;
let mut tilt = None;
let mut zoom = None;
loop {
let Some(field) = reader.next_element()? else {
return Err(crate::Error::new(crate::ErrorCode::TlvTruncated));
};
if field.value == Value::EndOfContainer {
break;
}
match field.tag.context() {
Some(0) => pan = Some(<i16>::from_tlv(reader, &field)?),
Some(1) => tilt = Some(<i16>::from_tlv(reader, &field)?),
Some(2) => zoom = Some(<u8>::from_tlv(reader, &field)?),
_ => reader.skip_value(&field)?,
}
}
Ok(Self { pan, tilt, zoom })
}
}
#[derive(Debug, Clone, Copy, PartialEq)]
pub struct MPTZSetPositionFields {
pub pan: Option<i16>,
pub tilt: Option<i16>,
pub zoom: Option<u8>,
}
impl ToTlv for MPTZSetPositionFields {
fn to_tlv(&self, w: &mut TlvWriter<'_>, tag: Tag) -> Result<()> {
w.start_structure(tag)?;
if let Some(value) = &self.pan {
value.to_tlv(w, Tag::Context(0))?;
}
if let Some(value) = &self.tilt {
value.to_tlv(w, Tag::Context(1))?;
}
if let Some(value) = &self.zoom {
value.to_tlv(w, Tag::Context(2))?;
}
w.end_container()
}
}
impl<'a> FromTlv<'a> for MPTZSetPositionFields {
fn from_tlv(reader: &mut TlvReader<'a>, element: &Element<'a>) -> Result<Self> {
if element.value.container() != Some(ContainerKind::Structure) {
return Err(crate::Error::new(crate::ErrorCode::TlvWrongType));
}
let mut pan = None;
let mut tilt = None;
let mut zoom = None;
loop {
let Some(field) = reader.next_element()? else {
return Err(crate::Error::new(crate::ErrorCode::TlvTruncated));
};
if field.value == Value::EndOfContainer {
break;
}
match field.tag.context() {
Some(0) => pan = Some(<i16>::from_tlv(reader, &field)?),
Some(1) => tilt = Some(<i16>::from_tlv(reader, &field)?),
Some(2) => zoom = Some(<u8>::from_tlv(reader, &field)?),
_ => reader.skip_value(&field)?,
}
}
Ok(Self { pan, tilt, zoom })
}
}
#[derive(Debug, Clone, Copy, PartialEq)]
pub struct MPTZRelativeMoveFields {
pub pan_delta: Option<i16>,
pub tilt_delta: Option<i16>,
pub zoom_delta: Option<i8>,
}
impl ToTlv for MPTZRelativeMoveFields {
fn to_tlv(&self, w: &mut TlvWriter<'_>, tag: Tag) -> Result<()> {
w.start_structure(tag)?;
if let Some(value) = &self.pan_delta {
value.to_tlv(w, Tag::Context(0))?;
}
if let Some(value) = &self.tilt_delta {
value.to_tlv(w, Tag::Context(1))?;
}
if let Some(value) = &self.zoom_delta {
value.to_tlv(w, Tag::Context(2))?;
}
w.end_container()
}
}
impl<'a> FromTlv<'a> for MPTZRelativeMoveFields {
fn from_tlv(reader: &mut TlvReader<'a>, element: &Element<'a>) -> Result<Self> {
if element.value.container() != Some(ContainerKind::Structure) {
return Err(crate::Error::new(crate::ErrorCode::TlvWrongType));
}
let mut pan_delta = None;
let mut tilt_delta = None;
let mut zoom_delta = None;
loop {
let Some(field) = reader.next_element()? else {
return Err(crate::Error::new(crate::ErrorCode::TlvTruncated));
};
if field.value == Value::EndOfContainer {
break;
}
match field.tag.context() {
Some(0) => pan_delta = Some(<i16>::from_tlv(reader, &field)?),
Some(1) => tilt_delta = Some(<i16>::from_tlv(reader, &field)?),
Some(2) => zoom_delta = Some(<i8>::from_tlv(reader, &field)?),
_ => reader.skip_value(&field)?,
}
}
Ok(Self {
pan_delta,
tilt_delta,
zoom_delta,
})
}
}
#[derive(Debug, Clone, Copy, PartialEq)]
pub struct MPTZMoveToPresetFields {
pub preset_id: u8,
}
impl ToTlv for MPTZMoveToPresetFields {
fn to_tlv(&self, w: &mut TlvWriter<'_>, tag: Tag) -> Result<()> {
w.start_structure(tag)?;
self.preset_id.to_tlv(w, Tag::Context(0))?;
w.end_container()
}
}
impl<'a> FromTlv<'a> for MPTZMoveToPresetFields {
fn from_tlv(reader: &mut TlvReader<'a>, element: &Element<'a>) -> Result<Self> {
if element.value.container() != Some(ContainerKind::Structure) {
return Err(crate::Error::new(crate::ErrorCode::TlvWrongType));
}
let mut preset_id = None;
loop {
let Some(field) = reader.next_element()? else {
return Err(crate::Error::new(crate::ErrorCode::TlvTruncated));
};
if field.value == Value::EndOfContainer {
break;
}
match field.tag.context() {
Some(0) => preset_id = Some(<u8>::from_tlv(reader, &field)?),
_ => reader.skip_value(&field)?,
}
}
Ok(Self {
preset_id: preset_id.ok_or(crate::Error::new(crate::ErrorCode::TlvNotFound))?,
})
}
}
#[derive(Debug, Clone, Copy, PartialEq)]
pub struct MPTZSavePresetFields<'a> {
pub preset_id: Option<u8>,
pub name: &'a str,
}
impl<'a> ToTlv for MPTZSavePresetFields<'a> {
fn to_tlv(&self, w: &mut TlvWriter<'_>, tag: Tag) -> Result<()> {
w.start_structure(tag)?;
if let Some(value) = &self.preset_id {
value.to_tlv(w, Tag::Context(0))?;
}
self.name.to_tlv(w, Tag::Context(1))?;
w.end_container()
}
}
impl<'a> FromTlv<'a> for MPTZSavePresetFields<'a> {
fn from_tlv(reader: &mut TlvReader<'a>, element: &Element<'a>) -> Result<Self> {
if element.value.container() != Some(ContainerKind::Structure) {
return Err(crate::Error::new(crate::ErrorCode::TlvWrongType));
}
let mut preset_id = None;
let mut name = None;
loop {
let Some(field) = reader.next_element()? else {
return Err(crate::Error::new(crate::ErrorCode::TlvTruncated));
};
if field.value == Value::EndOfContainer {
break;
}
match field.tag.context() {
Some(0) => preset_id = Some(<u8>::from_tlv(reader, &field)?),
Some(1) => name = Some(<&'a str>::from_tlv(reader, &field)?),
_ => reader.skip_value(&field)?,
}
}
Ok(Self {
preset_id,
name: name.ok_or(crate::Error::new(crate::ErrorCode::TlvNotFound))?,
})
}
}
#[derive(Debug, Clone, Copy, PartialEq)]
pub struct MPTZRemovePresetFields {
pub preset_id: u8,
}
impl ToTlv for MPTZRemovePresetFields {
fn to_tlv(&self, w: &mut TlvWriter<'_>, tag: Tag) -> Result<()> {
w.start_structure(tag)?;
self.preset_id.to_tlv(w, Tag::Context(0))?;
w.end_container()
}
}
impl<'a> FromTlv<'a> for MPTZRemovePresetFields {
fn from_tlv(reader: &mut TlvReader<'a>, element: &Element<'a>) -> Result<Self> {
if element.value.container() != Some(ContainerKind::Structure) {
return Err(crate::Error::new(crate::ErrorCode::TlvWrongType));
}
let mut preset_id = None;
loop {
let Some(field) = reader.next_element()? else {
return Err(crate::Error::new(crate::ErrorCode::TlvTruncated));
};
if field.value == Value::EndOfContainer {
break;
}
match field.tag.context() {
Some(0) => preset_id = Some(<u8>::from_tlv(reader, &field)?),
_ => reader.skip_value(&field)?,
}
}
Ok(Self {
preset_id: preset_id.ok_or(crate::Error::new(crate::ErrorCode::TlvNotFound))?,
})
}
}
#[derive(Debug, Clone, Copy, PartialEq)]
pub struct DPTZSetViewportFields {
pub video_stream_id: u16,
pub viewport: crate::clusters::generated::globals::ViewportStruct,
}
impl ToTlv for DPTZSetViewportFields {
fn to_tlv(&self, w: &mut TlvWriter<'_>, tag: Tag) -> Result<()> {
w.start_structure(tag)?;
self.video_stream_id.to_tlv(w, Tag::Context(0))?;
self.viewport.to_tlv(w, Tag::Context(1))?;
w.end_container()
}
}
impl<'a> FromTlv<'a> for DPTZSetViewportFields {
fn from_tlv(reader: &mut TlvReader<'a>, element: &Element<'a>) -> Result<Self> {
if element.value.container() != Some(ContainerKind::Structure) {
return Err(crate::Error::new(crate::ErrorCode::TlvWrongType));
}
let mut video_stream_id = None;
let mut viewport = None;
loop {
let Some(field) = reader.next_element()? else {
return Err(crate::Error::new(crate::ErrorCode::TlvTruncated));
};
if field.value == Value::EndOfContainer {
break;
}
match field.tag.context() {
Some(0) => video_stream_id = Some(<u16>::from_tlv(reader, &field)?),
Some(1) => {
viewport = Some(
<crate::clusters::generated::globals::ViewportStruct>::from_tlv(
reader, &field,
)?,
)
}
_ => reader.skip_value(&field)?,
}
}
Ok(Self {
video_stream_id: video_stream_id
.ok_or(crate::Error::new(crate::ErrorCode::TlvNotFound))?,
viewport: viewport.ok_or(crate::Error::new(crate::ErrorCode::TlvNotFound))?,
})
}
}
#[derive(Debug, Clone, Copy, PartialEq)]
pub struct DPTZRelativeMoveFields {
pub video_stream_id: u16,
pub delta_x: Option<i16>,
pub delta_y: Option<i16>,
pub zoom_delta: Option<i8>,
}
impl ToTlv for DPTZRelativeMoveFields {
fn to_tlv(&self, w: &mut TlvWriter<'_>, tag: Tag) -> Result<()> {
w.start_structure(tag)?;
self.video_stream_id.to_tlv(w, Tag::Context(0))?;
if let Some(value) = &self.delta_x {
value.to_tlv(w, Tag::Context(1))?;
}
if let Some(value) = &self.delta_y {
value.to_tlv(w, Tag::Context(2))?;
}
if let Some(value) = &self.zoom_delta {
value.to_tlv(w, Tag::Context(3))?;
}
w.end_container()
}
}
impl<'a> FromTlv<'a> for DPTZRelativeMoveFields {
fn from_tlv(reader: &mut TlvReader<'a>, element: &Element<'a>) -> Result<Self> {
if element.value.container() != Some(ContainerKind::Structure) {
return Err(crate::Error::new(crate::ErrorCode::TlvWrongType));
}
let mut video_stream_id = None;
let mut delta_x = None;
let mut delta_y = None;
let mut zoom_delta = None;
loop {
let Some(field) = reader.next_element()? else {
return Err(crate::Error::new(crate::ErrorCode::TlvTruncated));
};
if field.value == Value::EndOfContainer {
break;
}
match field.tag.context() {
Some(0) => video_stream_id = Some(<u16>::from_tlv(reader, &field)?),
Some(1) => delta_x = Some(<i16>::from_tlv(reader, &field)?),
Some(2) => delta_y = Some(<i16>::from_tlv(reader, &field)?),
Some(3) => zoom_delta = Some(<i8>::from_tlv(reader, &field)?),
_ => reader.skip_value(&field)?,
}
}
Ok(Self {
video_stream_id: video_stream_id
.ok_or(crate::Error::new(crate::ErrorCode::TlvNotFound))?,
delta_x,
delta_y,
zoom_delta,
})
}
}
pub const ATTRIBUTES: &[Attribute] = &[
Attribute {
id: 0x0000,
name: "MPTZPosition",
kind: "MPTZStruct",
access: Access::read_only(Privilege::View),
qualities: AttributeQualities::NON_VOLATILE,
reporting: Reporting::OnChange,
conform: Conform {
clauses: &[Clause {
verdict: Conformance::Mandatory,
when: Condition::Any(&[
Condition::Feature(1),
Condition::Feature(2),
Condition::Feature(3),
]),
}],
},
},
Attribute {
id: 0x0001,
name: "MaxPresets",
kind: "uint8",
access: Access::read_only(Privilege::View),
qualities: AttributeQualities::FIXED,
reporting: Reporting::OnChange,
conform: Conform {
clauses: &[Clause {
verdict: Conformance::Mandatory,
when: Condition::Feature(4),
}],
},
},
Attribute {
id: 0x0002,
name: "MPTZPresets",
kind: "list[MPTZPresetStruct]",
access: Access::read_only(Privilege::View),
qualities: AttributeQualities::NON_VOLATILE,
reporting: Reporting::OnChange,
conform: Conform {
clauses: &[Clause {
verdict: Conformance::Mandatory,
when: Condition::Feature(4),
}],
},
},
Attribute {
id: 0x0003,
name: "DPTZStreams",
kind: "list[DPTZStruct]",
access: Access::read_only(Privilege::View),
qualities: AttributeQualities::NON_VOLATILE,
reporting: Reporting::OnChange,
conform: Conform {
clauses: &[Clause {
verdict: Conformance::Mandatory,
when: Condition::Feature(0),
}],
},
},
Attribute {
id: 0x0004,
name: "ZoomMax",
kind: "uint8",
access: Access::read_only(Privilege::View),
qualities: AttributeQualities::empty(),
reporting: Reporting::OnChange,
conform: Conform {
clauses: &[Clause {
verdict: Conformance::Mandatory,
when: Condition::Feature(3),
}],
},
},
Attribute {
id: 0x0005,
name: "TiltMin",
kind: "int16",
access: Access::read_only(Privilege::View),
qualities: AttributeQualities::empty(),
reporting: Reporting::OnChange,
conform: Conform {
clauses: &[Clause {
verdict: Conformance::Mandatory,
when: Condition::Feature(2),
}],
},
},
Attribute {
id: 0x0006,
name: "TiltMax",
kind: "int16",
access: Access::read_only(Privilege::View),
qualities: AttributeQualities::empty(),
reporting: Reporting::OnChange,
conform: Conform {
clauses: &[Clause {
verdict: Conformance::Mandatory,
when: Condition::Feature(2),
}],
},
},
Attribute {
id: 0x0007,
name: "PanMin",
kind: "int16",
access: Access::read_only(Privilege::View),
qualities: AttributeQualities::empty(),
reporting: Reporting::OnChange,
conform: Conform {
clauses: &[Clause {
verdict: Conformance::Mandatory,
when: Condition::Feature(1),
}],
},
},
Attribute {
id: 0x0008,
name: "PanMax",
kind: "int16",
access: Access::read_only(Privilege::View),
qualities: AttributeQualities::empty(),
reporting: Reporting::OnChange,
conform: Conform {
clauses: &[Clause {
verdict: Conformance::Mandatory,
when: Condition::Feature(1),
}],
},
},
Attribute {
id: 0x0009,
name: "MovementState",
kind: "PhysicalMovementEnum",
access: Access::read_only(Privilege::View),
qualities: AttributeQualities::empty(),
reporting: Reporting::OnChange,
conform: Conform {
clauses: &[Clause {
verdict: Conformance::Mandatory,
when: Condition::Any(&[
Condition::Feature(1),
Condition::Feature(2),
Condition::Feature(3),
]),
}],
},
},
];
pub const COMMANDS: &[Command] = &[
Command {
id: 0x00,
name: "MPTZSetPosition",
to_server: true,
response: None,
access: Access::invoke(Privilege::Operate),
conform: Conform {
clauses: &[Clause {
verdict: Conformance::Mandatory,
when: Condition::Any(&[
Condition::Feature(1),
Condition::Feature(2),
Condition::Feature(3),
]),
}],
},
},
Command {
id: 0x01,
name: "MPTZRelativeMove",
to_server: true,
response: None,
access: Access::invoke(Privilege::Operate),
conform: Conform {
clauses: &[Clause {
verdict: Conformance::Mandatory,
when: Condition::Any(&[
Condition::Feature(1),
Condition::Feature(2),
Condition::Feature(3),
]),
}],
},
},
Command {
id: 0x02,
name: "MPTZMoveToPreset",
to_server: true,
response: None,
access: Access::invoke(Privilege::Operate),
conform: Conform {
clauses: &[Clause {
verdict: Conformance::Mandatory,
when: Condition::Feature(4),
}],
},
},
Command {
id: 0x03,
name: "MPTZSavePreset",
to_server: true,
response: None,
access: Access::invoke(Privilege::Operate),
conform: Conform {
clauses: &[Clause {
verdict: Conformance::Mandatory,
when: Condition::Feature(4),
}],
},
},
Command {
id: 0x04,
name: "MPTZRemovePreset",
to_server: true,
response: None,
access: Access::invoke(Privilege::Operate),
conform: Conform {
clauses: &[Clause {
verdict: Conformance::Mandatory,
when: Condition::Feature(4),
}],
},
},
Command {
id: 0x05,
name: "DPTZSetViewport",
to_server: true,
response: None,
access: Access::invoke(Privilege::Operate),
conform: Conform {
clauses: &[Clause {
verdict: Conformance::Mandatory,
when: Condition::Feature(0),
}],
},
},
Command {
id: 0x06,
name: "DPTZRelativeMove",
to_server: true,
response: None,
access: Access::invoke(Privilege::Operate),
conform: Conform {
clauses: &[Clause {
verdict: Conformance::Optional,
when: Condition::Feature(0),
}],
},
},
];
pub const EVENTS: &[Event] = &[];
pub const CLUSTER: Cluster = Cluster {
id: ID,
name: "Camera AV Settings User Level Management",
revision: REVISION,
pics: "AVSUM",
derived_from: None,
features: FEATURES,
attributes: ATTRIBUTES,
commands: COMMANDS,
events: EVENTS,
};