Trait capsules::ieee802154::device::RxClient [] [src]

pub trait RxClient {
    fn receive<'a>(
        &self,
        buf: &'a [u8],
        header: Header<'a>,
        data_offset: usize,
        data_len: usize
    ); }

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

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.
  • 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