Skip to main content

Device

Struct Device 

Source
pub struct Device {
Show 24 fields pub ieee: Ieee, pub nwk: NodeId, pub name: Option<String>, pub node_descriptor: Option<NodeDescriptor>, pub endpoints: Vec<SimpleDescriptor>, pub manufacturer: Option<String>, pub model: Option<String>, pub power_source: Option<u8>, pub sw_build_id: Option<String>, pub date_code: Option<String>, pub zcl_version: Option<u8>, pub stack_version: Option<u8>, pub hw_version: Option<u8>, pub app_version: Option<u8>, pub interview: Interview, pub reporting: Vec<ConfiguredReport>, pub ias_zone_type: Option<u16>, pub ias_zone_id: Option<u8>, pub unique_link_key: bool, pub parent: Option<NodeId>, pub joined_unix: u64, pub last_seen_unix: Option<u64>, pub last_lqi: Option<u8>, pub last_rssi: Option<i8>,
}
Expand description

A device on the network.

Fields§

§ieee: Ieee

IEEE address.

§nwk: NodeId

Current network address.

§name: Option<String>

A name a person gave it.

§node_descriptor: Option<NodeDescriptor>

The node descriptor.

§endpoints: Vec<SimpleDescriptor>

Endpoints, from the simple descriptors.

§manufacturer: Option<String>

Basic cluster: manufacturer name.

§model: Option<String>

Basic cluster: model identifier.

§power_source: Option<u8>

Basic cluster: power source.

§sw_build_id: Option<String>

Basic cluster: software build id.

§date_code: Option<String>

Basic cluster: date code.

§zcl_version: Option<u8>

Basic cluster: ZCL version.

§stack_version: Option<u8>

Basic cluster: stack version.

§hw_version: Option<u8>

Basic cluster: hardware version.

§app_version: Option<u8>

Basic cluster: application version.

§interview: Interview

The interview’s progress.

§reporting: Vec<ConfiguredReport>

Reporting the host configured.

§ias_zone_type: Option<u16>

The IAS zone type (contact, motion, water leak…), read at enrollment.

§ias_zone_id: Option<u8>

The IAS zone id the host enrolled it with.

§unique_link_key: bool

It completed Zigbee 3.0 trust center link key exchange.

§parent: Option<NodeId>

Its parent when it joined.

§joined_unix: u64

When it joined, seconds since the Unix epoch.

§last_seen_unix: Option<u64>

Last time anything arrived from it (not persisted, so receiving a message never writes to flash).

§last_lqi: Option<u8>

Link quality of the last message’s last hop (not persisted).

§last_rssi: Option<i8>

Signal strength of the last message’s last hop (not persisted).

Implementations§

Source§

impl Device

Source

pub fn new(ieee: Ieee, nwk: NodeId, now_unix: u64) -> Device

A device that just joined.

Source

pub fn is_sleepy(&self) -> bool

The device’s receiver is off when idle (a sleepy end device), so requests wait at its parent until it polls.

Source

pub fn endpoint_with(&self, cluster: u16) -> Option<&SimpleDescriptor>

The endpoint that has a cluster as a server, if any.

Source

pub fn profile_of(&self, endpoint: u8) -> u16

The application profile of an endpoint (Home Automation if unknown).

Trait Implementations§

Source§

impl Clone for Device

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 Device

Source§

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

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

impl<'de> Deserialize<'de> for Device

Source§

fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>
where __D: Deserializer<'de>,

Deserialize this value from the given Serde deserializer. Read more
Source§

impl Eq for Device

Source§

impl PartialEq for Device

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 Device

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 Device

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
§

impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
where ST: ?Sized, DT: ?Sized,

§

impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
where ST: ?Sized, DT: ?Sized,

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> DeserializeOwned for T
where T: for<'de> Deserialize<'de>,

Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

§

impl<T> Instrument for T

§

fn instrument(self, span: Span) -> Instrumented<Self> ⓘ

Instruments this type with the provided [Span], returning an Instrumented wrapper. Read more
§

fn in_current_span(self) -> Instrumented<Self> ⓘ

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
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.

§

impl<T> Read<Exclusive, BecauseExclusive> for T
where T: ?Sized,

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.
§

impl<T> WithSubscriber for T

§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self> ⓘ
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a [WithDispatch] wrapper. Read more
§

fn with_current_subscriber(self) -> WithDispatch<Self> ⓘ

Attaches the current default Subscriber to this type, returning a [WithDispatch] wrapper. Read more