[][src]Struct lorawan::maccommands::DevStatusAnsPayload

pub struct DevStatusAnsPayload<'a>(_);

DevStatusAnsPayload represents the DevStatusAns LoRaWAN MACCommand.

Implementations

impl<'a> DevStatusAnsPayload<'a>[src]

pub fn new<'b>(data: &'a [u8]) -> Result<DevStatusAnsPayload<'a>, &'b str>[src]

Creates a new instance of the mac command if there is enought data.

pub fn new_as_mac_cmd<'b>(
    data: &'a [u8]
) -> Result<(MacCommand<'a>, usize), &'b str>
[src]

pub const fn cid() -> u8[src]

Command identifier.

Sent by end device or sent by network server.

pub const fn len() -> usize[src]

length of the payload of the mac command.

impl<'a> DevStatusAnsPayload<'a>[src]

pub fn battery(&self) -> u8[src]

The battery level of the device.

Note: 0 means that the device is powered by an external source, 255 means that the device was unable to measure its battery level, any other value represents the actual battery level.

pub fn margin(&self) -> i8[src]

The margin is the demodulation signal-to-noise ratio in dB rounded to the nearest integer value for the last successfully received DevStatusReq command.

Trait Implementations

impl<'a> Debug for DevStatusAnsPayload<'a>[src]

impl<'a> PartialEq<DevStatusAnsPayload<'a>> for DevStatusAnsPayload<'a>[src]

impl<'a> StructuralPartialEq for DevStatusAnsPayload<'a>[src]

Auto Trait Implementations

impl<'a> RefUnwindSafe for DevStatusAnsPayload<'a>

impl<'a> Send for DevStatusAnsPayload<'a>

impl<'a> Sync for DevStatusAnsPayload<'a>

impl<'a> Unpin for DevStatusAnsPayload<'a>

impl<'a> UnwindSafe for DevStatusAnsPayload<'a>

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> Same<T> for T

type Output = T

Should always be Self

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.