Skip to main content

BtHome

Struct BtHome 

Source
pub struct BtHome {
Show 13 fields pub encrypted: bool, pub undecryptable: bool, pub counter: Option<u32>, pub trigger_based: bool, pub packet_id: Option<u8>, pub measurements: Vec<Measurement>, pub events: Vec<Event>, pub text: Vec<String>, pub raw: Vec<String>, pub device_type: Option<u16>, pub firmware: Option<String>, pub unknown_object: Option<u8>, pub truncated: bool,
}
Expand description

A BTHome v2 frame.

Fields§

§encrypted: bool

The frame was encrypted.

§undecryptable: bool

The frame was encrypted and could not be decrypted: no key, a wrong key, or no address to build the nonce from. Nothing else is set.

§counter: Option<u32>

The encryption counter, when encrypted. A receiver should reject a counter that does not increase.

§trigger_based: bool

The device sends at irregular intervals (on a button press, say).

§packet_id: Option<u8>

The packet id (object 0x00): the same id twice is a repeat.

§measurements: Vec<Measurement>

Measurements and states.

§events: Vec<Event>

Button and dimmer events.

§text: Vec<String>

Text objects (0x53).

§raw: Vec<String>

Raw objects (0x54), hex.

§device_type: Option<u16>

Device type id (0xF0).

§firmware: Option<String>

Firmware version (0xF1 or 0xF2), dotted.

§unknown_object: Option<u8>

The first object id this decoder does not know; decoding stopped there.

§truncated: bool

The frame ended inside an object.

Trait Implementations§

Source§

impl Clone for BtHome

Source§

fn clone(&self) -> Self

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for BtHome

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Default for BtHome

Source§

fn default() -> Self

Returns the “default value” for a type. Read more
Source§

impl PartialEq for BtHome

Source§

fn eq(&self, other: &Self) -> bool

Equality operator ==. Read more
1.0.0 (const: unstable) · Source§

fn ne(&self, other: &Rhs) -> bool

Inequality operator !=. Read more
Source§

impl Serialize for BtHome

Source§

fn serialize<__S>(&self, __serializer: __S) -> Result<__S::Ok, __S::Error>
where __S: Serializer,

Serialize this value into the given Serde serializer. Read more
Source§

impl StructuralPartialEq for BtHome

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

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

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.