Skip to main content

Crate zwave_host

Crate zwave_host 

Source
Expand description

§zwave-host

A Z-Wave controller host stack.

The controller chip runs the radio and the mesh; this crate does the application side a host has to do, on top of zwave_serial:

  • inclusion and exclusion, with S2 (key exchange, DSK PIN check), S0 and SmartStart from a provisioning list;
  • the interview: node information, secure command classes, manufacturer, versions, endpoints, and each command class’s capabilities;
  • a node store written to disk on change (batched, atomic);
  • wake-up queues: commands for sleeping nodes wait for their next Wake Up Notification, and the node is sent back to sleep when idle;
  • encapsulation in both directions: Security 0 and 2, Supervision, Multi Channel, Transport Service and CRC-16;
  • values from reports, as Event::Value;
  • the neighbor tables and the routes transmit reports describe, for topology;
  • an NVM backup of the controller.

Start one with Controller::start and read Events from the returned channel.

Part of zwave-bridge, maintained by Pulzar. See the user guide, the library guide and the API documentation.

License: MIT.

Re-exports§

pub use node::NodeRecord;
pub use node::NodeStatus;
pub use values::ValueId;
pub use values::ValueKind;
pub use values::ValueUpdate;

Modules§

device_config
Device configuration files in Z-Wave JS’s published format.
firmware
Firmware updates over the air (Firmware Update Meta Data command class).
node
What the host knows about each node. Persisted in the store.
nvm3
NVM3, the flash file system of 700 and 800 series controllers.
store
The node store: one JSON file, written atomically and only when something changed (batched over a short delay, so a burst of interview results is one write, and reports never cause a write at all).
values
Values: what reports mean, as numbers with units, independent of the command class that carried them.

Structs§

Controller
A handle to a running controller. Clones share it.
ControllerInfo
What the controller says about itself.
Events
The stream of Events from a controller. Read it continuously; events beyond MAX_PENDING_EVENTS unread ones are dropped.
HostConfig
Configuration of the host stack.
InclusionOptions
How to include a node.
InclusionResult
The outcome of an inclusion.
NetworkKeys
The network keys and the controller’s long-term S2 key pair.
Topology
The network’s topology as the host knows it.
TopologyNode
One node in the topology.

Enums§

Error
Errors from the host stack.
Event
Something that happened on the network.
GrantPolicy
Which keys to grant a joining S2 node.
SecurityClass
A Z-Wave security class, the unit in which network keys are granted.

Constants§

MAX_PENDING_EVENTS
Events kept for a consumer that has fallen behind before new ones are dropped.

Functions§

is_long_range
Whether a node id is a Long Range node (256 and up).

Type Aliases§

NodeId
A node id. Classic Z-Wave uses 1 to 232; Long Range uses 256 to 4000.