Skip to main content

HostEvent

Enum HostEvent 

Source
pub enum HostEvent {
Show 19 variants Started { outcome: StartOutcome, network: NetworkInfo, adapter: AdapterInfo, }, PermitJoin { seconds: u8, via: Option<Ieee>, }, DeviceJoined { ieee: Ieee, nwk: NodeId, rejoin: bool, }, DeviceAnnounced { ieee: Ieee, nwk: NodeId, }, OtaQuery { ieee: Ieee, current_version: u32, available: Option<u32>, }, OtaProgress { ieee: Ieee, percent: u8, }, OtaFinished { ieee: Ieee, from: u32, to: u32, success: bool, status: u8, }, ChannelChanged { network: NetworkInfo, }, DeviceLeft { ieee: Ieee, }, DeviceRemoved { ieee: Ieee, reason: String, }, InterviewStarted { ieee: Ieee, }, InterviewStep { ieee: Ieee, stage: InterviewStage, }, InterviewDone { device: Box<Device>, }, InterviewFailed { ieee: Ieee, stage: InterviewStage, error: String, }, Attributes { ieee: Ieee, endpoint: u8, cluster: u16, attributes: Vec<(u16, Value)>, lqi: u8, }, Command { ieee: Ieee, endpoint: u8, cluster: u16, command: u8, name: Option<&'static str>, fields: Vec<(&'static str, Value)>, from_server: bool, }, Frame { ieee: Ieee, link: FrameLink, frame: Vec<u8>, }, BackupWritten { path: PathBuf, }, AdapterFailed { reason: String, },
}
Expand description

What happened on the network.

Variants§

§

Started

The network is up.

Fields

§outcome: StartOutcome

Resumed, formed or restored.

§network: NetworkInfo

The network.

§adapter: AdapterInfo

The NCP.

§

PermitJoin

Joining opened (seconds > 0) or closed.

Fields

§seconds: u8

Seconds open, 0 when closed.

§via: Option<Ieee>

The router it was opened on, if not everywhere.

§

DeviceJoined

A device joined or rejoined.

Fields

§ieee: Ieee

The device.

§nwk: NodeId

Its network address.

§rejoin: bool

A rejoin.

§

DeviceAnnounced

A device announced itself (after joining or a power cycle).

Fields

§ieee: Ieee

The device.

§nwk: NodeId

Its network address.

§

OtaQuery

A device asked for an OTA image (on its own, or after Host::ota_check or Host::ota_update).

Fields

§ieee: Ieee

The device.

§current_version: u32

The file version it runs.

§available: Option<u32>

The newest newer version in the image directory.

§

OtaProgress

An OTA download advanced (every 10%).

Fields

§ieee: Ieee

The device.

§percent: u8

Percent downloaded.

§

OtaFinished

An OTA upgrade ended.

Fields

§ieee: Ieee

The device.

§from: u32

The version it ran.

§to: u32

The version it downloaded.

§success: bool

The device applied it.

§status: u8

The device’s upgrade end status.

§

ChannelChanged

The network moved to another channel.

Fields

§network: NetworkInfo

The network now.

§

DeviceLeft

A device left the network.

Fields

§ieee: Ieee

The device.

§

DeviceRemoved

The host removed a device.

Fields

§ieee: Ieee

The device.

§reason: String

Why.

§

InterviewStarted

An interview started or resumed.

Fields

§ieee: Ieee

The device.

§

InterviewStep

An interview step finished.

Fields

§ieee: Ieee

The device.

§stage: InterviewStage

The step that finished.

§

InterviewDone

An interview finished.

Fields

§device: Box<Device>

The device as interviewed.

§

InterviewFailed

An interview stopped on a failure; it resumes when the device next talks.

Fields

§ieee: Ieee

The device.

§stage: InterviewStage

The step that failed.

§error: String

Why.

§

Attributes

Attribute values arrived (a report, or an unsolicited read response).

Fields

§ieee: Ieee

The device.

§endpoint: u8

Its endpoint.

§cluster: u16

The cluster.

§attributes: Vec<(u16, Value)>

Attribute ids and values.

§lqi: u8

Last hop link quality.

§

Command

A device sent a cluster command (a remote’s button, an alarm).

Fields

§ieee: Ieee

The device.

§endpoint: u8

Its endpoint.

§cluster: u16

The cluster.

§command: u8

Command id.

§name: Option<&'static str>

Its name, when the cluster library knows it.

§fields: Vec<(&'static str, Value)>

Decoded fields, when known.

§from_server: bool

Sent by the cluster’s server (true) or a client.

§

Frame

A ZCL frame from a device, exactly as received, with how it arrived. Sent for every frame that is not a reply to the host’s own request, before the decoded HostEvent::Attributes or HostEvent::Command, so a device library can decode what the host does not.

Fields

§ieee: Ieee

The device.

§link: FrameLink

How it arrived.

§frame: Vec<u8>

The ZCL frame: header and payload.

§

BackupWritten

A backup was written.

Fields

§path: PathBuf

The file.

§

AdapterFailed

The NCP failed; the host has stopped. Restart it.

Fields

§reason: String

Why.

Trait Implementations§

Source§

impl Clone for HostEvent

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 HostEvent

Source§

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

Formats the value using the given formatter. Read more

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