pub enum Reading {
Atc(SensorReading),
BtHomeV1(Vec<Element>),
BtHomeV2(BtHomeV2),
}Expand description
A reading from some BLE sensor advertisement.
Variants§
Implementations§
Source§impl Reading
impl Reading
Sourcepub fn decode(service_data: &HashMap<Uuid, Vec<u8>>) -> Option<Self>
pub fn decode(service_data: &HashMap<Uuid, Vec<u8>>) -> Option<Self>
Attempts to decode any relevant entries in the given service data map as either atc1441 format, pvvx custom format, or BTHome (v1 or v2).
If UUIDs are present for more than one of the above formats then only the first valid one is returned.
Returns None if none of the UUIDs for the above formats are present, or there is an error
decoding them.
Trait Implementations§
impl Eq for Reading
impl StructuralPartialEq for Reading
Auto Trait Implementations§
impl Freeze for Reading
impl RefUnwindSafe for Reading
impl Send for Reading
impl Sync for Reading
impl Unpin for Reading
impl UnwindSafe for Reading
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