pub struct DeviceType {
pub id: u32,
pub name: &'static str,
pub revision: u16,
pub class: &'static str,
pub scope: &'static str,
pub clusters: &'static [RequiredCluster],
}Expand description
One device type.
Fields§
§id: u32The DeviceTypeID that appears in DeviceTypeList.
name: &'static strIts name — “On/Off Light”.
revision: u16The revision that goes alongside the id in DeviceTypeList.
class: &'static strsimple, utility, node or dynamic utility. A utility device type may share an
endpoint with another; a simple one may not (§9.2), which is the rule a bridge gets
wrong when it puts two lights on one endpoint.
scope: &'static strendpoint or node.
clusters: &'static [RequiredCluster]What the endpoint must and may serve.
Implementations§
Source§impl DeviceType
impl DeviceType
Sourcepub fn validate(
&self,
endpoint: &Endpoint<'_>,
spec_of: impl Fn(ClusterId) -> Option<&'static Cluster>,
found: impl FnMut(Defect),
)
pub fn validate( &self, endpoint: &Endpoint<'_>, spec_of: impl Fn(ClusterId) -> Option<&'static Cluster>, found: impl FnMut(Defect), )
Checks an endpoint against this device type, reporting each defect to found.
Only server clusters are checked. A device type’s client-side entries name what the endpoint may bind to — an On/Off Light’s client Occupancy Sensing is a sensor somewhere else on the fabric — and demanding one in the endpoint’s own list would reject every conformant light.
Elements whose conformance is prose are skipped, for the same reason
spec::Cluster::validate skips them.