Skip to main content

matter_kit/clusters/generated/
boolean_state.rs

1// Generated by `cargo xtask` from the CSA data model 1.6. Do not edit.
2//
3// Boolean State — cluster 0x0045.
4//
5// Regenerate with `cargo xtask clusters --dm <checkout>/data_model/1.6`; `cargo xtask check`
6// is the CI gate that keeps this file honest. The XML itself is not vendored here — it
7// carries the CSA's own copyright notice and is not redistributable.
8
9//! Boolean State (cluster `0x0045`, revision 3).
10//!
11//! 2 identifiers, 1 feature bits, and the specification's own conformance for
12//! every element. `CLUSTER` is the whole table.
13
14#![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
26/// The cluster id.
27pub const ID: ClusterId = 0x0045;
28
29/// The highest revision the specification's history defines — what `ClusterRevision`
30/// must report (Core §7.13.1).
31pub const REVISION: u16 = 3;
32
33/// The PICS code, which a certification declaration names the cluster by.
34pub const PICS: &str = "BOOL";
35
36/// The `FeatureMap` bits (Core §7.13.2).
37///
38/// A feature has conformance of its own: a device may not claim one the
39/// specification forbids it alongside another.
40pub mod feature {
41    /// Supports reporting change events
42    ///
43    /// Code `CHGEVENT`, bit 0.
44    pub const CHANGE_EVENT: u32 = 1 << 0;
45}
46
47/// Every feature bit, with its conformance.
48pub 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
60/// The attribute ids.
61pub mod attribute {
62    use crate::im::AttributeId;
63
64    /// `StateValue`.
65    pub const STATE_VALUE: AttributeId = 0x00;
66}
67
68/// The event ids.
69pub mod event {
70    use crate::im::EventId;
71
72    /// `StateChange`.
73    pub const STATE_CHANGE: EventId = 0x00;
74}
75
76/// Every attribute the specification defines, with its conformance.
77pub 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
87/// Every command, with its conformance.
88pub const COMMANDS: &[Command] = &[];
89
90/// Every event, with its conformance.
91pub 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
110/// The whole cluster, as the specification defines it.
111pub 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};