1#![allow(unused_imports)]
15
16use crate::dm::conformance::{Clause, Condition, Conform, Conformance};
17use crate::dm::meta::{EventPriority, Reporting};
18use crate::dm::spec::{Attribute, Cluster, Command, Event, Feature};
19use crate::dm::{Access, AccessQualities, AttributeQualities, Privilege};
20use crate::error::Result;
21use crate::im::{AttributeId, ClusterId, CommandId, EventId};
22use crate::tlv::{
23 ContainerKind, Element, FromTlv, Nullable, Tag, TlvList, TlvReader, TlvWriter, ToTlv, Value,
24};
25
26pub const ID: ClusterId = 0x0046;
28
29pub const REVISION: u16 = 3;
32
33pub const PICS: &str = "ICDM";
35
36pub mod feature {
41 pub const CHECK_IN_PROTOCOL_SUPPORT: u32 = 1 << 0;
45 pub const USER_ACTIVE_MODE_TRIGGER: u32 = 1 << 1;
49 pub const LONG_IDLE_TIME_SUPPORT: u32 = 1 << 2;
53 pub const DYNAMIC_SIT_LIT_SUPPORT: u32 = 1 << 3;
57}
58
59pub const FEATURES: &[Feature] = &[
61 Feature {
62 bit: 0,
63 code: "CIP",
64 name: "CheckInProtocolSupport",
65 conform: Conform {
66 clauses: &[
67 Clause {
68 verdict: Conformance::Mandatory,
69 when: Condition::Feature(2),
70 },
71 Clause {
72 verdict: Conformance::Optional,
73 when: Condition::Always,
74 },
75 ],
76 },
77 },
78 Feature {
79 bit: 1,
80 code: "UAT",
81 name: "UserActiveModeTrigger",
82 conform: Conform {
83 clauses: &[
84 Clause {
85 verdict: Conformance::Mandatory,
86 when: Condition::Feature(2),
87 },
88 Clause {
89 verdict: Conformance::Optional,
90 when: Condition::Always,
91 },
92 ],
93 },
94 },
95 Feature {
96 bit: 2,
97 code: "LITS",
98 name: "LongIdleTimeSupport",
99 conform: Conform::OPTIONAL,
100 },
101 Feature {
102 bit: 3,
103 code: "DSLS",
104 name: "DynamicSitLitSupport",
105 conform: Conform {
106 clauses: &[Clause {
107 verdict: Conformance::Optional,
108 when: Condition::Feature(2),
109 }],
110 },
111 },
112];
113
114pub mod attribute {
116 use crate::im::AttributeId;
117
118 pub const IDLE_MODE_DURATION: AttributeId = 0x00;
120 pub const ACTIVE_MODE_DURATION: AttributeId = 0x01;
122 pub const ACTIVE_MODE_THRESHOLD: AttributeId = 0x02;
124 pub const REGISTERED_CLIENTS: AttributeId = 0x03;
126 pub const ICD_COUNTER: AttributeId = 0x04;
128 pub const CLIENTS_SUPPORTED_PER_FABRIC: AttributeId = 0x05;
130 pub const USER_ACTIVE_MODE_TRIGGER_HINT: AttributeId = 0x06;
132 pub const USER_ACTIVE_MODE_TRIGGER_INSTRUCTION: AttributeId = 0x07;
134 pub const OPERATING_MODE: AttributeId = 0x08;
136 pub const MAXIMUM_CHECK_IN_BACKOFF: AttributeId = 0x09;
138}
139
140pub mod command {
142 use crate::im::CommandId;
143
144 pub const REGISTER_CLIENT: CommandId = 0x00;
146 pub const REGISTER_CLIENT_RESPONSE: CommandId = 0x01;
148 pub const UNREGISTER_CLIENT: CommandId = 0x02;
150 pub const STAY_ACTIVE_REQUEST: CommandId = 0x03;
152 pub const STAY_ACTIVE_RESPONSE: CommandId = 0x04;
154}
155
156#[derive(Debug, Clone, Copy, PartialEq, Eq, PartialOrd, Ord, Hash)]
158#[repr(u8)]
159pub enum ClientTypeEnum {
160 Permanent = 0,
162 Ephemeral = 1,
164}
165
166impl ClientTypeEnum {
167 #[must_use]
169 pub const fn from_value(value: u8) -> Option<Self> {
170 match value {
171 0 => Some(Self::Permanent),
172 1 => Some(Self::Ephemeral),
173 _ => None,
174 }
175 }
176
177 #[must_use]
179 pub const fn value(self) -> u8 {
180 self as u8
181 }
182}
183
184impl ToTlv for ClientTypeEnum {
185 fn to_tlv(&self, w: &mut TlvWriter<'_>, tag: Tag) -> Result<()> {
186 self.value().to_tlv(w, tag)
187 }
188}
189
190impl<'a> FromTlv<'a> for ClientTypeEnum {
191 fn from_tlv(reader: &mut TlvReader<'a>, element: &Element<'a>) -> Result<Self> {
192 let value = <u8 as FromTlv<'a>>::from_tlv(reader, element)?;
193 Self::from_value(value).ok_or(crate::Error::new(crate::ErrorCode::TlvOutOfRange))
194 }
195}
196
197#[derive(Debug, Clone, Copy, PartialEq, Eq, PartialOrd, Ord, Hash)]
199#[repr(u8)]
200pub enum OperatingModeEnum {
201 SIT = 0,
203 LIT = 1,
205}
206
207impl OperatingModeEnum {
208 #[must_use]
210 pub const fn from_value(value: u8) -> Option<Self> {
211 match value {
212 0 => Some(Self::SIT),
213 1 => Some(Self::LIT),
214 _ => None,
215 }
216 }
217
218 #[must_use]
220 pub const fn value(self) -> u8 {
221 self as u8
222 }
223}
224
225impl ToTlv for OperatingModeEnum {
226 fn to_tlv(&self, w: &mut TlvWriter<'_>, tag: Tag) -> Result<()> {
227 self.value().to_tlv(w, tag)
228 }
229}
230
231impl<'a> FromTlv<'a> for OperatingModeEnum {
232 fn from_tlv(reader: &mut TlvReader<'a>, element: &Element<'a>) -> Result<Self> {
233 let value = <u8 as FromTlv<'a>>::from_tlv(reader, element)?;
234 Self::from_value(value).ok_or(crate::Error::new(crate::ErrorCode::TlvOutOfRange))
235 }
236}
237
238bitflags::bitflags! {
239 #[derive(Debug, Clone, Copy, PartialEq, Eq, Hash, Default)]
241 pub struct UserActiveModeTriggerBitmap: u32 {
242 const POWER_CYCLE = 1 << 0;
244 const SETTINGS_MENU = 1 << 1;
246 const CUSTOM_INSTRUCTION = 1 << 2;
248 const DEVICE_MANUAL = 1 << 3;
250 const ACTUATE_SENSOR = 1 << 4;
252 const ACTUATE_SENSOR_SECONDS = 1 << 5;
254 const ACTUATE_SENSOR_TIMES = 1 << 6;
256 const ACTUATE_SENSOR_LIGHTS_BLINK = 1 << 7;
258 const RESET_BUTTON = 1 << 8;
260 const RESET_BUTTON_LIGHTS_BLINK = 1 << 9;
262 const RESET_BUTTON_SECONDS = 1 << 10;
264 const RESET_BUTTON_TIMES = 1 << 11;
266 const SETUP_BUTTON = 1 << 12;
268 const SETUP_BUTTON_SECONDS = 1 << 13;
270 const SETUP_BUTTON_LIGHTS_BLINK = 1 << 14;
272 const SETUP_BUTTON_TIMES = 1 << 15;
274 const APP_DEFINED_BUTTON = 1 << 16;
276 }
277}
278
279impl ToTlv for UserActiveModeTriggerBitmap {
280 fn to_tlv(&self, w: &mut TlvWriter<'_>, tag: Tag) -> Result<()> {
281 self.bits().to_tlv(w, tag)
282 }
283}
284
285impl<'a> FromTlv<'a> for UserActiveModeTriggerBitmap {
286 fn from_tlv(reader: &mut TlvReader<'a>, element: &Element<'a>) -> Result<Self> {
287 let bits = <u32 as FromTlv<'a>>::from_tlv(reader, element)?;
288 Self::from_bits(bits).ok_or(crate::Error::new(crate::ErrorCode::TlvOutOfRange))
289 }
290}
291
292#[derive(Debug, Clone, Copy, PartialEq)]
294pub struct MonitoringRegistrationStruct {
295 pub check_in_node_id: crate::msg::NodeId,
297 pub monitored_subject: u64,
299 pub client_type: ClientTypeEnum,
301 pub fabric_index: crate::msg::FabricIndex,
303}
304
305impl ToTlv for MonitoringRegistrationStruct {
306 fn to_tlv(&self, w: &mut TlvWriter<'_>, tag: Tag) -> Result<()> {
307 w.start_structure(tag)?;
308 self.check_in_node_id.to_tlv(w, Tag::Context(1))?;
309 self.monitored_subject.to_tlv(w, Tag::Context(2))?;
310 self.client_type.to_tlv(w, Tag::Context(4))?;
311 self.fabric_index.to_tlv(w, Tag::Context(254))?;
312 w.end_container()
313 }
314}
315
316impl<'a> FromTlv<'a> for MonitoringRegistrationStruct {
317 fn from_tlv(reader: &mut TlvReader<'a>, element: &Element<'a>) -> Result<Self> {
318 if element.value.container() != Some(ContainerKind::Structure) {
319 return Err(crate::Error::new(crate::ErrorCode::TlvWrongType));
320 }
321 let mut check_in_node_id = None;
322 let mut monitored_subject = None;
323 let mut client_type = None;
324 let mut fabric_index = None;
325 loop {
326 let Some(field) = reader.next_element()? else {
327 return Err(crate::Error::new(crate::ErrorCode::TlvTruncated));
328 };
329 if field.value == Value::EndOfContainer {
330 break;
331 }
332 match field.tag.context() {
333 Some(1) => check_in_node_id = Some(<crate::msg::NodeId>::from_tlv(reader, &field)?),
334 Some(2) => monitored_subject = Some(<u64>::from_tlv(reader, &field)?),
335 Some(4) => client_type = Some(<ClientTypeEnum>::from_tlv(reader, &field)?),
336 Some(254) => {
337 fabric_index = Some(<crate::msg::FabricIndex>::from_tlv(reader, &field)?)
338 }
339 _ => reader.skip_value(&field)?,
343 }
344 }
345 Ok(Self {
346 check_in_node_id: check_in_node_id
347 .ok_or(crate::Error::new(crate::ErrorCode::TlvNotFound))?,
348 monitored_subject: monitored_subject
349 .ok_or(crate::Error::new(crate::ErrorCode::TlvNotFound))?,
350 client_type: client_type.ok_or(crate::Error::new(crate::ErrorCode::TlvNotFound))?,
351 fabric_index: fabric_index.ok_or(crate::Error::new(crate::ErrorCode::TlvNotFound))?,
352 })
353 }
354}
355
356#[derive(Debug, Clone, Copy, PartialEq)]
358pub struct RegisterClientFields<'a> {
359 pub check_in_node_id: crate::msg::NodeId,
361 pub monitored_subject: u64,
363 pub key: &'a [u8],
365 pub verification_key: Option<&'a [u8]>,
367 pub client_type: ClientTypeEnum,
369}
370
371impl<'a> ToTlv for RegisterClientFields<'a> {
372 fn to_tlv(&self, w: &mut TlvWriter<'_>, tag: Tag) -> Result<()> {
373 w.start_structure(tag)?;
374 self.check_in_node_id.to_tlv(w, Tag::Context(0))?;
375 self.monitored_subject.to_tlv(w, Tag::Context(1))?;
376 self.key.to_tlv(w, Tag::Context(2))?;
377 if let Some(value) = &self.verification_key {
378 value.to_tlv(w, Tag::Context(3))?;
379 }
380 self.client_type.to_tlv(w, Tag::Context(4))?;
381 w.end_container()
382 }
383}
384
385impl<'a> FromTlv<'a> for RegisterClientFields<'a> {
386 fn from_tlv(reader: &mut TlvReader<'a>, element: &Element<'a>) -> Result<Self> {
387 if element.value.container() != Some(ContainerKind::Structure) {
388 return Err(crate::Error::new(crate::ErrorCode::TlvWrongType));
389 }
390 let mut check_in_node_id = None;
391 let mut monitored_subject = None;
392 let mut key = None;
393 let mut verification_key = None;
394 let mut client_type = None;
395 loop {
396 let Some(field) = reader.next_element()? else {
397 return Err(crate::Error::new(crate::ErrorCode::TlvTruncated));
398 };
399 if field.value == Value::EndOfContainer {
400 break;
401 }
402 match field.tag.context() {
403 Some(0) => check_in_node_id = Some(<crate::msg::NodeId>::from_tlv(reader, &field)?),
404 Some(1) => monitored_subject = Some(<u64>::from_tlv(reader, &field)?),
405 Some(2) => key = Some(<&'a [u8]>::from_tlv(reader, &field)?),
406 Some(3) => verification_key = Some(<&'a [u8]>::from_tlv(reader, &field)?),
407 Some(4) => client_type = Some(<ClientTypeEnum>::from_tlv(reader, &field)?),
408 _ => reader.skip_value(&field)?,
412 }
413 }
414 Ok(Self {
415 check_in_node_id: check_in_node_id
416 .ok_or(crate::Error::new(crate::ErrorCode::TlvNotFound))?,
417 monitored_subject: monitored_subject
418 .ok_or(crate::Error::new(crate::ErrorCode::TlvNotFound))?,
419 key: key.ok_or(crate::Error::new(crate::ErrorCode::TlvNotFound))?,
420 verification_key,
421 client_type: client_type.ok_or(crate::Error::new(crate::ErrorCode::TlvNotFound))?,
422 })
423 }
424}
425
426#[derive(Debug, Clone, Copy, PartialEq)]
428pub struct RegisterClientResponseFields {
429 pub icd_counter: u32,
431}
432
433impl ToTlv for RegisterClientResponseFields {
434 fn to_tlv(&self, w: &mut TlvWriter<'_>, tag: Tag) -> Result<()> {
435 w.start_structure(tag)?;
436 self.icd_counter.to_tlv(w, Tag::Context(0))?;
437 w.end_container()
438 }
439}
440
441impl<'a> FromTlv<'a> for RegisterClientResponseFields {
442 fn from_tlv(reader: &mut TlvReader<'a>, element: &Element<'a>) -> Result<Self> {
443 if element.value.container() != Some(ContainerKind::Structure) {
444 return Err(crate::Error::new(crate::ErrorCode::TlvWrongType));
445 }
446 let mut icd_counter = None;
447 loop {
448 let Some(field) = reader.next_element()? else {
449 return Err(crate::Error::new(crate::ErrorCode::TlvTruncated));
450 };
451 if field.value == Value::EndOfContainer {
452 break;
453 }
454 match field.tag.context() {
455 Some(0) => icd_counter = Some(<u32>::from_tlv(reader, &field)?),
456 _ => reader.skip_value(&field)?,
460 }
461 }
462 Ok(Self {
463 icd_counter: icd_counter.ok_or(crate::Error::new(crate::ErrorCode::TlvNotFound))?,
464 })
465 }
466}
467
468#[derive(Debug, Clone, Copy, PartialEq)]
470pub struct UnregisterClientFields<'a> {
471 pub check_in_node_id: crate::msg::NodeId,
473 pub verification_key: Option<&'a [u8]>,
475}
476
477impl<'a> ToTlv for UnregisterClientFields<'a> {
478 fn to_tlv(&self, w: &mut TlvWriter<'_>, tag: Tag) -> Result<()> {
479 w.start_structure(tag)?;
480 self.check_in_node_id.to_tlv(w, Tag::Context(0))?;
481 if let Some(value) = &self.verification_key {
482 value.to_tlv(w, Tag::Context(1))?;
483 }
484 w.end_container()
485 }
486}
487
488impl<'a> FromTlv<'a> for UnregisterClientFields<'a> {
489 fn from_tlv(reader: &mut TlvReader<'a>, element: &Element<'a>) -> Result<Self> {
490 if element.value.container() != Some(ContainerKind::Structure) {
491 return Err(crate::Error::new(crate::ErrorCode::TlvWrongType));
492 }
493 let mut check_in_node_id = None;
494 let mut verification_key = None;
495 loop {
496 let Some(field) = reader.next_element()? else {
497 return Err(crate::Error::new(crate::ErrorCode::TlvTruncated));
498 };
499 if field.value == Value::EndOfContainer {
500 break;
501 }
502 match field.tag.context() {
503 Some(0) => check_in_node_id = Some(<crate::msg::NodeId>::from_tlv(reader, &field)?),
504 Some(1) => verification_key = Some(<&'a [u8]>::from_tlv(reader, &field)?),
505 _ => reader.skip_value(&field)?,
509 }
510 }
511 Ok(Self {
512 check_in_node_id: check_in_node_id
513 .ok_or(crate::Error::new(crate::ErrorCode::TlvNotFound))?,
514 verification_key,
515 })
516 }
517}
518
519#[derive(Debug, Clone, Copy, PartialEq)]
521pub struct StayActiveRequestFields {
522 pub stay_active_duration: u32,
524}
525
526impl ToTlv for StayActiveRequestFields {
527 fn to_tlv(&self, w: &mut TlvWriter<'_>, tag: Tag) -> Result<()> {
528 w.start_structure(tag)?;
529 self.stay_active_duration.to_tlv(w, Tag::Context(0))?;
530 w.end_container()
531 }
532}
533
534impl<'a> FromTlv<'a> for StayActiveRequestFields {
535 fn from_tlv(reader: &mut TlvReader<'a>, element: &Element<'a>) -> Result<Self> {
536 if element.value.container() != Some(ContainerKind::Structure) {
537 return Err(crate::Error::new(crate::ErrorCode::TlvWrongType));
538 }
539 let mut stay_active_duration = None;
540 loop {
541 let Some(field) = reader.next_element()? else {
542 return Err(crate::Error::new(crate::ErrorCode::TlvTruncated));
543 };
544 if field.value == Value::EndOfContainer {
545 break;
546 }
547 match field.tag.context() {
548 Some(0) => stay_active_duration = Some(<u32>::from_tlv(reader, &field)?),
549 _ => reader.skip_value(&field)?,
553 }
554 }
555 Ok(Self {
556 stay_active_duration: stay_active_duration
557 .ok_or(crate::Error::new(crate::ErrorCode::TlvNotFound))?,
558 })
559 }
560}
561
562#[derive(Debug, Clone, Copy, PartialEq)]
564pub struct StayActiveResponseFields {
565 pub promised_active_duration: u32,
567}
568
569impl ToTlv for StayActiveResponseFields {
570 fn to_tlv(&self, w: &mut TlvWriter<'_>, tag: Tag) -> Result<()> {
571 w.start_structure(tag)?;
572 self.promised_active_duration.to_tlv(w, Tag::Context(0))?;
573 w.end_container()
574 }
575}
576
577impl<'a> FromTlv<'a> for StayActiveResponseFields {
578 fn from_tlv(reader: &mut TlvReader<'a>, element: &Element<'a>) -> Result<Self> {
579 if element.value.container() != Some(ContainerKind::Structure) {
580 return Err(crate::Error::new(crate::ErrorCode::TlvWrongType));
581 }
582 let mut promised_active_duration = None;
583 loop {
584 let Some(field) = reader.next_element()? else {
585 return Err(crate::Error::new(crate::ErrorCode::TlvTruncated));
586 };
587 if field.value == Value::EndOfContainer {
588 break;
589 }
590 match field.tag.context() {
591 Some(0) => promised_active_duration = Some(<u32>::from_tlv(reader, &field)?),
592 _ => reader.skip_value(&field)?,
596 }
597 }
598 Ok(Self {
599 promised_active_duration: promised_active_duration
600 .ok_or(crate::Error::new(crate::ErrorCode::TlvNotFound))?,
601 })
602 }
603}
604
605pub const ATTRIBUTES: &[Attribute] = &[
607 Attribute {
608 id: 0x0000,
609 name: "IdleModeDuration",
610 kind: "uint32",
611 access: Access::read_only(Privilege::View),
612 qualities: AttributeQualities::FIXED,
613 reporting: Reporting::OnChange,
614 conform: Conform::MANDATORY,
615 },
616 Attribute {
617 id: 0x0001,
618 name: "ActiveModeDuration",
619 kind: "uint32",
620 access: Access::read_only(Privilege::View),
621 qualities: AttributeQualities::FIXED,
622 reporting: Reporting::OnChange,
623 conform: Conform::MANDATORY,
624 },
625 Attribute {
626 id: 0x0002,
627 name: "ActiveModeThreshold",
628 kind: "uint16",
629 access: Access::read_only(Privilege::View),
630 qualities: AttributeQualities::FIXED,
631 reporting: Reporting::OnChange,
632 conform: Conform::MANDATORY,
633 },
634 Attribute {
635 id: 0x0003,
636 name: "RegisteredClients",
637 kind: "list[MonitoringRegistrationStruct]",
638 access: Access::read_only(Privilege::Administer)
639 .with_qualities(AccessQualities::FABRIC_SCOPED),
640 qualities: AttributeQualities::NON_VOLATILE,
641 reporting: Reporting::OnChange,
642 conform: Conform {
643 clauses: &[Clause {
644 verdict: Conformance::Mandatory,
645 when: Condition::Feature(0),
646 }],
647 },
648 },
649 Attribute {
650 id: 0x0004,
651 name: "ICDCounter",
652 kind: "uint32",
653 access: Access::read_only(Privilege::Administer),
654 qualities: AttributeQualities::NON_VOLATILE,
655 reporting: Reporting::ChangesOmitted,
656 conform: Conform {
657 clauses: &[Clause {
658 verdict: Conformance::Mandatory,
659 when: Condition::Feature(0),
660 }],
661 },
662 },
663 Attribute {
664 id: 0x0005,
665 name: "ClientsSupportedPerFabric",
666 kind: "uint16",
667 access: Access::read_only(Privilege::View),
668 qualities: AttributeQualities::FIXED,
669 reporting: Reporting::OnChange,
670 conform: Conform {
671 clauses: &[Clause {
672 verdict: Conformance::Mandatory,
673 when: Condition::Feature(0),
674 }],
675 },
676 },
677 Attribute {
678 id: 0x0006,
679 name: "UserActiveModeTriggerHint",
680 kind: "UserActiveModeTriggerBitmap",
681 access: Access::read_only(Privilege::View),
682 qualities: AttributeQualities::FIXED,
683 reporting: Reporting::OnChange,
684 conform: Conform {
685 clauses: &[Clause {
686 verdict: Conformance::Mandatory,
687 when: Condition::Feature(1),
688 }],
689 },
690 },
691 Attribute {
692 id: 0x0007,
693 name: "UserActiveModeTriggerInstruction",
694 kind: "string",
695 access: Access::read_only(Privilege::View),
696 qualities: AttributeQualities::FIXED,
697 reporting: Reporting::OnChange,
698 conform: Conform::DESCRIBED,
699 },
700 Attribute {
701 id: 0x0008,
702 name: "OperatingMode",
703 kind: "OperatingModeEnum",
704 access: Access::read_only(Privilege::View),
705 qualities: AttributeQualities::empty(),
706 reporting: Reporting::OnChange,
707 conform: Conform {
708 clauses: &[Clause {
709 verdict: Conformance::Mandatory,
710 when: Condition::Feature(2),
711 }],
712 },
713 },
714 Attribute {
715 id: 0x0009,
716 name: "MaximumCheckInBackoff",
717 kind: "uint32",
718 access: Access::read_only(Privilege::View),
719 qualities: AttributeQualities::FIXED,
720 reporting: Reporting::OnChange,
721 conform: Conform {
722 clauses: &[Clause {
723 verdict: Conformance::Mandatory,
724 when: Condition::Feature(0),
725 }],
726 },
727 },
728];
729
730pub const COMMANDS: &[Command] = &[
732 Command {
733 id: 0x00,
734 name: "RegisterClient",
735 to_server: true,
736 response: Some(0x01),
737 access: Access::invoke(Privilege::Manage).with_qualities(AccessQualities::FABRIC_SCOPED),
738 conform: Conform {
739 clauses: &[Clause {
740 verdict: Conformance::Mandatory,
741 when: Condition::Feature(0),
742 }],
743 },
744 },
745 Command {
746 id: 0x01,
747 name: "RegisterClientResponse",
748 to_server: false,
749 response: None,
750 access: Access::invoke(Privilege::Operate),
751 conform: Conform {
752 clauses: &[Clause {
753 verdict: Conformance::Mandatory,
754 when: Condition::Feature(0),
755 }],
756 },
757 },
758 Command {
759 id: 0x02,
760 name: "UnregisterClient",
761 to_server: true,
762 response: None,
763 access: Access::invoke(Privilege::Manage).with_qualities(AccessQualities::FABRIC_SCOPED),
764 conform: Conform {
765 clauses: &[Clause {
766 verdict: Conformance::Mandatory,
767 when: Condition::Feature(0),
768 }],
769 },
770 },
771 Command {
772 id: 0x03,
773 name: "StayActiveRequest",
774 to_server: true,
775 response: Some(0x04),
776 access: Access::invoke(Privilege::Operate),
777 conform: Conform {
778 clauses: &[
779 Clause {
780 verdict: Conformance::Mandatory,
781 when: Condition::Feature(2),
782 },
783 Clause {
784 verdict: Conformance::Optional,
785 when: Condition::Always,
786 },
787 ],
788 },
789 },
790 Command {
791 id: 0x04,
792 name: "StayActiveResponse",
793 to_server: false,
794 response: None,
795 access: Access::invoke(Privilege::Operate),
796 conform: Conform {
797 clauses: &[
798 Clause {
799 verdict: Conformance::Mandatory,
800 when: Condition::Feature(2),
801 },
802 Clause {
803 verdict: Conformance::Optional,
804 when: Condition::Always,
805 },
806 ],
807 },
808 },
809];
810
811pub const EVENTS: &[Event] = &[];
813
814pub const CLUSTER: Cluster = Cluster {
816 id: ID,
817 name: "ICD Management",
818 revision: REVISION,
819 pics: "ICDM",
820 derived_from: None,
821 features: FEATURES,
822 attributes: ATTRIBUTES,
823 commands: COMMANDS,
824 events: EVENTS,
825};