[−][src]Struct lorawan::maccommandcreator::DevStatusAnsCreator
DevStatusAnsCreator serves for creating DevStatusAns MacCommand.
Examples
let mut creator = lorawan::maccommandcreator::DevStatusAnsCreator::new(); let res = creator.set_battery(0xfe).set_margin(-32).unwrap().build();
Implementations
impl DevStatusAnsCreator
[src]
pub fn new() -> Self
[src]
Creates a new instance of the class.
pub fn build(&self) -> &[u8]
[src]
Returns the serialized version of the class as bytes.
impl DevStatusAnsCreator
[src]
pub fn set_battery(&mut self, battery: u8) -> &mut Self
[src]
Sets the battery of the DevStatusAns to the provided value.
Argument
- battery - the value to be used as the battery level. 0 means external enery source, 1 and 254 are the smallest and biggest values of normal battery reading, while 255 indicates that the device failed to measure its battery level.
pub fn set_margin(&mut self, margin: i8) -> Result<&mut Self, &str>
[src]
Sets the margin of the DevStatusAns to the provided value.
Argument
- margin - the value to be used as margin.
Trait Implementations
impl Default for DevStatusAnsCreator
[src]
impl SerializableMacCommand for DevStatusAnsCreator
[src]
Auto Trait Implementations
impl RefUnwindSafe for DevStatusAnsCreator
[src]
impl Send for DevStatusAnsCreator
[src]
impl Sync for DevStatusAnsCreator
[src]
impl Unpin for DevStatusAnsCreator
[src]
impl UnwindSafe for DevStatusAnsCreator
[src]
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
pub fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
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]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
pub fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,