Skip to content

Commit

Permalink
Revert a change which does not belong to this PR
Browse files Browse the repository at this point in the history
  • Loading branch information
ivmarkov committed Sep 17, 2024
1 parent af6cea9 commit 19ddf81
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions rs-matter/src/interaction_model/core.rs
Original file line number Diff line number Diff line change
Expand Up @@ -153,29 +153,27 @@ pub const PROTO_ID_INTERACTION_MODEL: u16 = 0x01;
pub enum ReportDataReq<'a> {
Read(&'a ReadReqRef<'a>),
Subscribe(&'a SubscribeReqRef<'a>),
SubscribeReport(&'a SubscribeReqRef<'a>),
}

impl<'a> ReportDataReq<'a> {
pub fn attr_requests(&self) -> Result<Option<TLVArray<'a, AttrPath>>, Error> {
match self {
Self::Read(req) => req.attr_requests(),
Self::Subscribe(req) | Self::SubscribeReport(req) => req.attr_requests(),
Self::Subscribe(req) => req.attr_requests(),
}
}

pub fn dataver_filters(&self) -> Result<Option<TLVArray<'_, DataVersionFilter>>, Error> {
match self {
Self::Read(req) => req.dataver_filters(),
Self::Subscribe(req) => req.dataver_filters(),
Self::SubscribeReport(_) => Ok(None),
}
}

pub fn fabric_filtered(&self) -> Result<bool, Error> {
match self {
Self::Read(req) => req.fabric_filtered(),
Self::Subscribe(req) | Self::SubscribeReport(req) => req.fabric_filtered(),
Self::Subscribe(req) => req.fabric_filtered(),
}
}
}
Expand Down

0 comments on commit 19ddf81

Please sign in to comment.