pub struct Status {
pub system_time_ms: u32,
pub temperature_centi: i16,
}Expand description
How a bridge is doing.
Fields§
§system_time_ms: u32The bridge’s own clock, in milliseconds since it started.
temperature_centi: i16The temperature on the card, in hundredths of a degree Celsius.
Implementations§
Source§impl Status
impl Status
Sourcepub fn parse(payload: &[u8]) -> Result<Status, BridgeError>
pub fn parse(payload: &[u8]) -> Result<Status, BridgeError>
Reads a status answer.
§Arguments
payload- what followed the header.
§Returns
The status.
§Errors
BridgeError::Short when fewer than STATUS_LEN bytes came back.
§Examples
use pamoja_radios::sx1302::bridge::Status;
// 1000 ms up, 24.50 degrees.
let status = Status::parse(&[0, 0, 0x03, 0xe8, 0x09, 0x92]).unwrap();
assert_eq!(status.system_time_ms, 1000);
assert_eq!(status.temperature_centi, 2450);Trait Implementations§
impl Copy for Status
impl Eq for Status
impl StructuralPartialEq for Status
Auto Trait Implementations§
impl Freeze for Status
impl RefUnwindSafe for Status
impl Send for Status
impl Sync for Status
impl Unpin for Status
impl UnsafeUnpin for Status
impl UnwindSafe for Status
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more