matter_kit/clusters/generated/
boolean_state.rs1#![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 = 0x0045;
28
29pub const REVISION: u16 = 3;
32
33pub const PICS: &str = "BOOL";
35
36pub mod feature {
41 pub const CHANGE_EVENT: u32 = 1 << 0;
45}
46
47pub const FEATURES: &[Feature] = &[Feature {
49 bit: 0,
50 code: "CHGEVENT",
51 name: "ChangeEvent",
52 conform: Conform {
53 clauses: &[Clause {
54 verdict: Conformance::Described,
55 when: Condition::Named("comparison"),
56 }],
57 },
58}];
59
60pub mod attribute {
62 use crate::im::AttributeId;
63
64 pub const STATE_VALUE: AttributeId = 0x00;
66}
67
68pub mod event {
70 use crate::im::EventId;
71
72 pub const STATE_CHANGE: EventId = 0x00;
74}
75
76pub const ATTRIBUTES: &[Attribute] = &[Attribute {
78 id: 0x0000,
79 name: "StateValue",
80 kind: "bool",
81 access: Access::read_only(Privilege::View),
82 qualities: AttributeQualities::empty(),
83 reporting: Reporting::OnChange,
84 conform: Conform::MANDATORY,
85}];
86
87pub const COMMANDS: &[Command] = &[];
89
90pub const EVENTS: &[Event] = &[Event {
92 id: 0x00,
93 name: "StateChange",
94 priority: EventPriority::Info,
95 access: Access::read_only(Privilege::View),
96 conform: Conform {
97 clauses: &[
98 Clause {
99 verdict: Conformance::Mandatory,
100 when: Condition::Feature(0),
101 },
102 Clause {
103 verdict: Conformance::Optional,
104 when: Condition::Always,
105 },
106 ],
107 },
108}];
109
110pub const CLUSTER: Cluster = Cluster {
112 id: ID,
113 name: "Boolean State",
114 revision: REVISION,
115 pics: "BOOL",
116 derived_from: None,
117 features: FEATURES,
118 attributes: ATTRIBUTES,
119 commands: COMMANDS,
120 events: EVENTS,
121};