matter-kit 0.3.0

Matter (CSA smart-home standard) protocol implementation in Rust: no_std, no-alloc, executor-agnostic
Documentation
// Generated by `cargo xtask` from the CSA data model 1.6. Do not edit.
//
// Temperature Measurement โ€” cluster 0x0402.
//
// Regenerate with `cargo xtask clusters --dm <checkout>/data_model/1.6`; `cargo xtask check`
// is the CI gate that keeps this file honest. The XML itself is not vendored here โ€” it
// carries the CSA's own copyright notice and is not redistributable.

//! Temperature Measurement (cluster `0x0402`, revision 6).
//!
//! 4 identifiers, 0 feature bits, and the specification's own conformance for
//! every element. `CLUSTER` is the whole table.

#![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,
};

/// The cluster id.
pub const ID: ClusterId = 0x0402;

/// The highest revision the specification's history defines โ€” what `ClusterRevision`
/// must report (Core ยง7.13.1).
pub const REVISION: u16 = 6;

/// The PICS code, which a certification declaration names the cluster by.
pub const PICS: &str = "TMP";

/// This cluster defines no features, so its `FeatureMap` is always zero.
pub const FEATURES: &[Feature] = &[];

/// The attribute ids.
pub mod attribute {
    use crate::im::AttributeId;

    /// `MeasuredValue`.
    pub const MEASURED_VALUE: AttributeId = 0x00;
    /// `MinMeasuredValue`.
    pub const MIN_MEASURED_VALUE: AttributeId = 0x01;
    /// `MaxMeasuredValue`.
    pub const MAX_MEASURED_VALUE: AttributeId = 0x02;
    /// `Tolerance`.
    pub const TOLERANCE: AttributeId = 0x03;
}

/// Every attribute the specification defines, with its conformance.
pub const ATTRIBUTES: &[Attribute] = &[
    Attribute {
        id: 0x0000,
        name: "MeasuredValue",
        kind: "temperature",
        access: Access::read_only(Privilege::View),
        qualities: AttributeQualities::NULLABLE,
        reporting: Reporting::OnChange,
        conform: Conform::MANDATORY,
    },
    Attribute {
        id: 0x0001,
        name: "MinMeasuredValue",
        kind: "temperature",
        access: Access::read_only(Privilege::View),
        qualities: AttributeQualities::NULLABLE.union(AttributeQualities::FIXED),
        reporting: Reporting::OnChange,
        conform: Conform::MANDATORY,
    },
    Attribute {
        id: 0x0002,
        name: "MaxMeasuredValue",
        kind: "temperature",
        access: Access::read_only(Privilege::View),
        qualities: AttributeQualities::NULLABLE.union(AttributeQualities::FIXED),
        reporting: Reporting::OnChange,
        conform: Conform::MANDATORY,
    },
    Attribute {
        id: 0x0003,
        name: "Tolerance",
        kind: "uint16",
        access: Access::read_only(Privilege::View),
        qualities: AttributeQualities::FIXED,
        reporting: Reporting::OnChange,
        conform: Conform::OPTIONAL,
    },
];

/// Every command, with its conformance.
pub const COMMANDS: &[Command] = &[];

/// Every event, with its conformance.
pub const EVENTS: &[Event] = &[];

/// The whole cluster, as the specification defines it.
pub const CLUSTER: Cluster = Cluster {
    id: ID,
    name: "Temperature Measurement",
    revision: REVISION,
    pics: "TMP",
    derived_from: None,
    features: FEATURES,
    attributes: ATTRIBUTES,
    commands: COMMANDS,
    events: EVENTS,
};