Trait capsules_extra::ieee802154::device::RxClient

source ·
pub trait RxClient {
    // Required method
    fn receive<'a>(
        &self,
        buf: &'a [u8],
        header: Header<'a>,
        lqi: u8,
        data_offset: usize,
        data_len: usize
    );
}
Expand description

Trait to be implemented by users of the IEEE 802.15.4 device that wish to receive frames. The callback is triggered whenever a valid frame is received, verified and unsecured (via the IEEE 802.15.4 security procedure) successfully.

Required Methods§

source

fn receive<'a>( &self, buf: &'a [u8], header: Header<'a>, lqi: u8, data_offset: usize, data_len: usize )

When a frame is received, this callback is triggered. The client only receives an immutable borrow of the buffer. Only completely valid, unsecured frames that have passed the incoming security procedure are exposed to the client.

  • buf: The entire buffer containing the frame, potentially also including extra bytes in front used for the physical layer.
  • header: A fully-parsed representation of the MAC header, with the caveat that the auxiliary security header is still included if the frame was previously secured.
  • lqi: The link quality indicator of the received frame.
  • data_offset: Offset of the data payload relative to buf, so that the payload of the frame is contained in buf[data_offset..data_offset + data_len].
  • data_len: Length of the data payload

Implementors§

source§

impl<'a, A: Alarm<'a>, C: ContextStore> RxClient for Sixlowpan<'a, A, C>

source§

impl<'a, M: MacDevice<'a>> RxClient for MuxMac<'a, M>