pub struct Endpoint<'a> {
pub id: EndpointId,
pub clusters: &'a [ClusterDescriptor<'a>],
pub device_types: &'a [DeviceType],
pub clients: &'a [ClusterId],
}Expand description
One endpoint: a set of cluster instances (§7.2).
Fields§
§id: EndpointIdThe endpoint id. Endpoint 0 is the root node (§9.2).
clusters: &'a [ClusterDescriptor<'a>]The clusters on it, sorted by cluster id.
device_types: &'a [DeviceType]The device types it conforms to (§9.5.6.1).
§9.5 requires “at least one device type entry”, and two layers read it: the Descriptor
cluster publishes it as DeviceTypeList, and §6.6.6.2’s access control matches an ACL
target’s DeviceType against it. Keeping it here is what stops those two from
describing different devices.
clients: &'a [ClusterId]ClientList (§9.5.6.3) — the clusters this endpoint speaks as a client.
Not derivable from clusters: a ClusterDescriptor describes a server instance,
and a client binding has no descriptor to be found in — a switch that controls a light
is a client of On/Off and a server of nothing much.
It lives here rather than on the Descriptor cluster for the same reason
device_types does: two layers read it, the Descriptor cluster publishing
ClientList and §9.2’s device-type check demanding it, and a device type may require a
cluster on the client side — §6.1’s On/Off Light Switch requires On/Off as a client and
as nothing else, which is the only thing that tells it apart from a light.
Implementations§
Source§impl<'a> Endpoint<'a>
impl<'a> Endpoint<'a>
Sourcepub const fn new(id: EndpointId, clusters: &'a [ClusterDescriptor<'a>]) -> Self
pub const fn new(id: EndpointId, clusters: &'a [ClusterDescriptor<'a>]) -> Self
An endpoint with clusters and no device types yet.
Sourcepub const fn with_clients(self, clients: &'a [ClusterId]) -> Self
pub const fn with_clients(self, clients: &'a [ClusterId]) -> Self
The same endpoint, declaring the clusters it speaks as a client (§9.5.6.3).
Sourcepub const fn with_device_types(self, device_types: &'a [DeviceType]) -> Self
pub const fn with_device_types(self, device_types: &'a [DeviceType]) -> Self
The same endpoint, declaring the device types of §9.5.6.1.
Sourcepub fn has_device_type(&self, device_type: u32) -> bool
pub fn has_device_type(&self, device_type: u32) -> bool
Whether this endpoint conforms to device_type.
§6.6.6.2’s endpoint_contains_device_type, which decides whether an ACL target that
names a device type rather than an endpoint applies here.