pub struct SceneTable<const N: usize, const EFS: usize, const F: usize = 5> { /* private fields */ }Expand description
The Scene Table (§1.4.7.5), shared by the Scenes Management and Groups clusters.
N is the number of entries across every fabric — §1.4.8.1 sets the minimum at 16 — EFS
the bytes one scene’s extension field sets may occupy, and F the fabrics whose
SceneInfoStruct is tracked. §1.4.8.2: “The number of list entries for this attribute
SHALL NOT exceed the number of supported fabrics by the device.”
Implementations§
Source§impl<const N: usize, const EFS: usize, const F: usize> SceneTable<N, EFS, F>
impl<const N: usize, const EFS: usize, const F: usize> SceneTable<N, EFS, F>
Sourcepub const fn per_fabric(&self) -> usize
pub const fn per_fabric(&self) -> usize
§1.4.6’s per-fabric ceiling: “less than half (rounded down towards 0) of the Scene Table entries … with a maximum of 253”.
The point of the rule is that no single fabric can take enough of the table to leave another with nothing, so the bound is half rather than some tuned fraction.
Sourcepub fn len_of_fabric(&self, fabric: FabricIndex) -> usize
pub fn len_of_fabric(&self, fabric: FabricIndex) -> usize
How many scenes one fabric holds.
Sourcepub fn capacity(&self, fabric: FabricIndex) -> u8
pub fn capacity(&self, fabric: FabricIndex) -> u8
§1.4.7.2.5’s RemainingCapacity for one fabric.
Sourcepub fn contains(&self, fabric: FabricIndex, group: GroupId, scene: u8) -> bool
pub fn contains(&self, fabric: FabricIndex, group: GroupId, scene: u8) -> bool
Whether a scene exists.
Sourcepub fn invalidate(&self)
pub fn invalidate(&self)
§1.4.7.2.4: an S-quality attribute on this endpoint changed, so no fabric’s
CurrentScene describes the endpoint any more.
The device calls this from the cluster that changed — turning a light on by hand invalidates the scene just as surely as recalling a different one does.
Sourcepub fn remove_fabric(&self, fabric: FabricIndex)
pub fn remove_fabric(&self, fabric: FabricIndex)
Removes every scene a fabric owns — what RemoveFabric must do (§1.4.6).