From e41f6ac99a7b50fb92d7cf7f67adaa33e3544317 Mon Sep 17 00:00:00 2001 From: Kedar Sovani Date: Sun, 19 Feb 2023 12:55:16 +0530 Subject: [PATCH] AttrDetails: Provide constructor --- matter/src/data_model/objects/cluster.rs | 23 ++++++++++++++++++++--- 1 file changed, 20 insertions(+), 3 deletions(-) diff --git a/matter/src/data_model/objects/cluster.rs b/matter/src/data_model/objects/cluster.rs index 68a4860..654a0a5 100644 --- a/matter/src/data_model/objects/cluster.rs +++ b/matter/src/data_model/objects/cluster.rs @@ -46,11 +46,28 @@ pub enum GlobalElements { // TODO: What if we instead of creating this, we just pass the AttrData/AttrPath to the read/write // methods? +/// The Attribute Details structure records the details about the attribute under consideration. +/// Typically this structure is progressively built as we proceed through the request processing. pub struct AttrDetails { - pub attr_id: u16, - pub list_index: Option>, - pub fab_idx: u8, + /// Fabric Filtering Activated pub fab_filter: bool, + /// The current Fabric Index + pub fab_idx: u8, + /// List Index, if any + pub list_index: Option>, + /// The actual attribute ID + pub attr_id: u16, +} + +impl AttrDetails { + pub fn new(fab_idx: u8, fab_filter: bool) -> Self { + Self { + fab_filter, + fab_idx, + list_index: None, + attr_id: 0, + } + } } pub trait ClusterType {