apis-saltans-aps
APS layer frame definitions and utilities for Zigbee.
This crate models the Zigbee APS frame structures (data, command, and acknowledgment paths), including control fields, delivery modes, destinations, and extended header metadata.
Status
This crate is under active development.
What This Crate Provides
- APS frame control primitives:
ControlFrameTypeDeliveryMode
- Addressing and destination modeling:
Destination(unicast, broadcast endpoint, group)Broadcast(well-known Zigbee broadcast addresses)
- Frame structures:
Data<T>(generic APS data frame)Unicast<T>(typed unicast variant)Command<T>(APS command frame)Acknowledgement(APS ACK frame)
- Extended header support:
ExtendedExtendedControlFragmentationAckFmt
Top-level re-exports are available from apis-saltans-aps directly.
Crate Layout
frame::control: APS frame control bitfields and decoding helpersframe::data: APS data frame headers and payload wrappersframe::command: APS command frame/header typesframe::acknowledgement: APS acknowledgment frame and ack formatframe::extended: extended header fields and fragmentationbroadcast: Zigbee network broadcast addresses
Serialization
This crate uses le-stream for little-endian byte encoding/decoding.
Patterns used in the API:
ToLeStreamfor serialization to iteratorsFromLeStreamfor parsing selected frame/header types
Most frame builders produce strongly typed structures first, then serialize via to_le_stream().
Quick Start
Build and Serialize a Unicast APS Data Frame
use Unicast;
use ToLeStream;
let frame = new;
let bytes: = frame.to_le_stream.collect;
assert!;
Parse an APS Data Header
use Header;
use FromLeStream;
let raw = ;
let parsed = from_le_stream;
Notes on Safety APIs
Some constructors are intentionally marked unsafe (for example new_unchecked) when invariants must be enforced by the caller (header/content consistency). Prefer safe constructors unless you are explicitly rebuilding structures from validated external state.
Dependencies
Primary dependencies:
le-streambitflagsnum-traits/num-derive
Related Workspace Crates
apis-saltans-core: core Zigbee protocol typesapis-saltans-zcl: Zigbee Cluster Library framing and commandsapis-saltans-zdp: Zigbee Device Profile services