pub struct Frame { /* private fields */ }Expand description
Zigbee APS frame parameters.
Implementations§
Source§impl Frame
impl Frame
Sourcepub const fn new(
profile_id: u16,
cluster_id: u16,
source_endpoint: u8,
destination_endpoint: u8,
options: Options,
group_id: u16,
sequence: u8,
) -> Self
pub const fn new( profile_id: u16, cluster_id: u16, source_endpoint: u8, destination_endpoint: u8, options: Options, group_id: u16, sequence: u8, ) -> Self
Create a new APS frame.
Sourcepub const fn profile_id(&self) -> u16
pub const fn profile_id(&self) -> u16
Return the application profile ID that describes the format of the message.
Sourcepub const fn cluster_id(&self) -> u16
pub const fn cluster_id(&self) -> u16
Return the cluster ID for this message.
Sourcepub const fn source_endpoint(&self) -> u8
pub const fn source_endpoint(&self) -> u8
Return the source endpoint.
Sourcepub const fn destination_endpoint(&self) -> u8
pub const fn destination_endpoint(&self) -> u8
Return the destination endpoint.
Sourcepub const fn group_id(&self) -> u16
pub const fn group_id(&self) -> u16
Return the group ID for this message if it is a multicast mode.
Sourcepub const fn set_group_id(&mut self, group_id: u16)
pub const fn set_group_id(&mut self, group_id: u16)
Sets the raw APS group ID field.
For multicast frames this identifies the destination group. Fragmented
frames overload the field with the fragment index in the low byte and
block information in the high byte. This method does not modify
Options::FRAGMENT or validate that encoding; use
Frame::set_first_fragment or Frame::set_followup_fragment when
constructing fragmented frames.
Sourcepub const fn set_sequence(&mut self, sequence: u8)
pub const fn set_sequence(&mut self, sequence: u8)
Set the APS sequence number.
Sourcepub fn enable_retry(&mut self)
pub fn enable_retry(&mut self)
Enable APS retry for this frame.
Sourcepub const fn fragmentation(&self) -> Option<(u8, Option<u8>)>
pub const fn fragmentation(&self) -> Option<(u8, Option<u8>)>
Return fragmentation information if the message is fragmented.
§Returns
Some((index, Some(total_fragments)))if this is the first fragment, whereindexis 0.Some((index, None))if this is a subsequent fragment.Noneif the message is not fragmented.
Sourcepub fn set_first_fragment(&mut self, blocks: u8)
pub fn set_first_fragment(&mut self, blocks: u8)
Mark this frame as the first fragment of a fragmented APS message.
Sourcepub fn set_followup_fragment(&mut self, index: NonZero<u8>)
pub fn set_followup_fragment(&mut self, index: NonZero<u8>)
Mark this frame as a follow-up fragment of a fragmented APS message.
Sourcepub fn clear_fragmentation(&mut self)
pub fn clear_fragmentation(&mut self)
Removes APS fragmentation metadata from this frame.
Trait Implementations§
impl Eq for Frame
Source§impl FromLeStream for Frame
impl FromLeStream for Frame
Source§fn from_le_stream<__LeStreamBytesIterator>(
bytes: __LeStreamBytesIterator,
) -> Option<Self>
fn from_le_stream<__LeStreamBytesIterator>( bytes: __LeStreamBytesIterator, ) -> Option<Self>
impl StructuralPartialEq for Frame
Source§impl ToLeStream for Frame
impl ToLeStream for Frame
Source§type Iter = Chain<Chain<Chain<Chain<Chain<Chain<<u16 as ToLeStream>::Iter, <u16 as ToLeStream>::Iter>, <u8 as ToLeStream>::Iter>, <u8 as ToLeStream>::Iter>, <Options as ToLeStream>::Iter>, <u16 as ToLeStream>::Iter>, <u8 as ToLeStream>::Iter>
type Iter = Chain<Chain<Chain<Chain<Chain<Chain<<u16 as ToLeStream>::Iter, <u16 as ToLeStream>::Iter>, <u8 as ToLeStream>::Iter>, <u8 as ToLeStream>::Iter>, <Options as ToLeStream>::Iter>, <u16 as ToLeStream>::Iter>, <u8 as ToLeStream>::Iter>
to_le_stream.