capsules_extra::ieee802154::device

Trait 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, 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 RadioDriver<'a, M>

Source§

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