Skip to main content

Module zwave

Module zwave 

Source
Expand description

Z-Wave wireless protocol layer implementation.

Implements the Z-Wave home automation wireless protocol.

§Frame Format

Offset  Size  Field
0       4     Home ID (big-endian)
4       1     Source node ID
5       1     Frame control byte
                bit 7: routed
                bit 6: ack request
                bit 5: low power
                bit 4: speed modified
                bits 3-0: header type
6       1     Beam/Sequence byte
                bit 7: reserved
                bits 6-5: beam control
                bit 4: reserved
                bits 3-0: sequence number
7       1     Length (total frame length)
8       1     Destination node ID
9..N-1  var   Payload (cmd_class + cmd + data) -- only for Req frames
N       1     CRC (XOR checksum)

An ACK frame is exactly 10 bytes (no payload between dst and CRC). A REQ frame is 10 + payload_len bytes.

Re-exports§

pub use builder::ZWaveBuilder;

Modules§

builder
Z-Wave packet builder.
cmd_class
Z-Wave command class constants.

Structs§

ZWaveLayer
Z-Wave layer – a zero-copy view into a packet buffer.

Constants§

ZWAVE_HEADER_LEN
Fixed header size for an ACK frame (no payload).
ZWAVE_MIN_HEADER_LEN
Minimum Z-Wave header length: homeId(4) + src(1) + frameCtrl(1) + beamSeqn(1) + length(1) + dst(1) + crc(1).

Statics§

ZWAVE_FIELD_NAMES
Field names exported for Python/generic access.

Functions§

cmd_class_name
Return a human-readable name for a command class byte value.
is_zwave_frame
Check if a buffer looks like a valid Z-Wave frame.
zwave_crc
Compute the Z-Wave CRC: XOR all bytes starting from an initial value of 0xFF.