Struct lorawan::DataPayload
[−]
[src]
pub struct DataPayload<'a>(_, _);
DataPayload represents a data MacPayload.
Methods
impl<'a> DataPayload<'a>
[src]
fn new(bytes: &'a [u8], uplink: bool) -> Option<DataPayload>
[src]
Creates a DataPayload from data.
Argument
bytes - the data from which DataPayload is to be built.
uplink - whether the packet is uplink or downlink.
Examples
let data = vec![0x04u8, 0x03u8, 0x02u8, 0x01u8, 0x04u8, 0x03u8, 0x02u8, 0x01u8, 0x05u8, 0x04u8, 0x03u8, 0x02u8, 0x05u8, 0x04u8, 0x03u8, 0x02u8, 0x2du8, 0x10u8]; let data_payload = lorawan::DataPayload::new(&data[..], true);
fn fhdr(&self) -> FHDR
[src]
Gives the FHDR of the DataPayload.
fn f_port(&self) -> Option<u8>
[src]
Gives the FPort of the DataPayload if there is one.
fn encrypted_from_payload(&self) -> &'a [u8]
[src]
Gives the payload of the DataPayload if there is one.
Trait Implementations
impl<'a> Debug for DataPayload<'a>
[src]
impl<'a> PartialEq for DataPayload<'a>
[src]
fn eq(&self, __arg_0: &DataPayload<'a>) -> bool
[src]
This method tests for self
and other
values to be equal, and is used by ==
. Read more
fn ne(&self, __arg_0: &DataPayload<'a>) -> bool
[src]
This method tests for !=
.