matter_clusters/gen/
boolean_state.rs1#![allow(
5 clippy::all,
6 clippy::pedantic,
7 dead_code,
8 unreachable_pub,
9 unused_imports
10)]
11
12use crate::datatypes::SemanticTagStruct;
13use crate::error::ClusterError;
14use crate::types::Nullable;
15use matter_codec::{ContainerKind, Element, Tag, TlvReader, TlvWriter, Value};
16
17pub const CLUSTER_ID: u32 = 0x0045;
19pub const CLUSTER_REVISION: u16 = 2;
21
22pub mod command_id {}
24
25pub mod attribute_id {
27 pub const STATE_VALUE: u32 = 0x0000;
29}
30
31pub fn decode_state_value(tlv: &[u8]) -> Result<bool, ClusterError> {
36 let mut r = TlvReader::new(tlv);
37 match r.next()? {
38 Some(Element::Scalar {
39 value: Value::Bool(v),
40 ..
41 }) => Ok(v),
42 _ => Err(ClusterError::UnexpectedType {
43 context: "StateValue",
44 }),
45 }
46}