Struct lorawan::PhyPayload
[−]
[src]
pub struct PhyPayload<'a>(_);
Represents the complete structure for handling lorawan mac layer payload.
Methods
impl<'a> PhyPayload<'a>
[src]
fn new(bytes: &[u8]) -> Result<PhyPayload, &str>
[src]
Creates a PhyPayload from bytes.
Argument
- bytes - the data from which the PhyPayload is to be built.
Examples
let data = vec![0x00u8, 0x04u8, 0x03u8, 0x02u8, 0x01u8, 0x04u8, 0x03u8, 0x02u8, 0x01u8, 0x05u8, 0x04u8, 0x03u8, 0x02u8, 0x05u8, 0x04u8, 0x03u8, 0x02u8, 0x2du8, 0x10u8, 0x6au8, 0x99u8, 0x0eu8, 0x12]; let phy = lorawan::PhyPayload::new(&data[..]);
fn mhdr(&self) -> MHDR
[src]
Gives the MHDR of the PhyPayload.
fn mic(&self) -> MIC
[src]
Gives the MIC of the PhyPayload.
fn mac_payload(&self) -> MacPayload
[src]
Gives the MacPayload of the PhyPayload.
fn validate_data_mic(&self, key: &AES128, fcnt: u32) -> Result<bool, &str>
[src]
Verifies that the PhyPayload has correct MIC.
The PhyPayload needs to contain DataPayload.
fn validate_join_request_mic(&self, key: &AES128) -> Result<bool, &str>
[src]
Verifies that the PhyPayload has correct MIC.
The PhyPayload needs to contain JoinRequest.
fn decrypted_payload(&self, key: &AES128, fcnt: u32) -> Result<FRMPayload, &str>
[src]
Decrypts the DataPayload payload.
The PhyPayload needs to contain DataPayload.
Trait Implementations
impl<'a> Debug for PhyPayload<'a>
[src]
impl<'a> PartialEq for PhyPayload<'a>
[src]
fn eq(&self, __arg_0: &PhyPayload<'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: &PhyPayload<'a>) -> bool
[src]
This method tests for !=
.