Expand description
Pure-Rust, no_std-friendly implementation of the SIA OSDP v2.2 protocol.
§Crate features
std(default): enablesalloc, plus desktop convenience.alloc(default viastd): enablesalloc::vec::Vec-based codec paths.secure-channel(default): enables Annex D (AES-128, MAC, encryption).embedded-io/embedded-io-async: transport adapters.defmt: structured logging on embedded targets.
§Layering
packet— wire framing (SOM, header, SCB, MAC, trailer)command/reply— typed messagesmultipart— RFC §5.10 multi-part assembly / disassemblysecure— Annex D secure channeltransport— byte-stream abstractiondriver— ACU and PD state machinescaps— Annex B function codes
§Specification cross-references
All spec citations refer to SIA OSDP v2.2 (©2020 Security Industry
Association). Where an item maps directly onto a spec section it is noted
in the docs as # Spec: §X.Y.
Re-exports§
pub use error::Error;pub use error::Result;pub use packet::Address;pub use packet::ControlByte;pub use packet::ParsedPacket;pub use packet::Sqn;pub use packet::Trailer;pub use packet::Packet;
Modules§
- caps
- PD capability function codes.
- clock
- Time abstraction. Drivers take a
Clockso that timing logic is testable fromno_stdtargets without pulling in a runtime. - command
- Typed OSDP commands (ACU → PD).
- driver
- Higher-level drivers built atop the codec and transport.
- error
- Crate-wide error type.
core::error::Error-compatible. - multipart
- Multi-part message engine.
- packet
- Packet codec — framing, header, security control block, MAC, trailer.
- reply
- Typed OSDP replies (PD → ACU). See sibling
crate::command. - secure
- Secure Channel — Annex D.
- transport
- Transport abstraction. The driver works against any half-duplex byte
stream that exposes
Transport::write_allandTransport::read.
Constants§
- BROADCAST_
ADDR - Broadcast address.
- MAX_
BUS_ PACKET - Maximum packet length that any device must tolerate on the wire (even if addressed elsewhere).
- MAX_
PD_ ADDR - Largest legal PD unicast address.
- MIN_
RX_ SIZE - Minimum receive-buffer size every PD must support.
- OFFLINE_
THRESHOLD_ MS - Off-line declaration threshold.
- REPLY_
DELAY_ MS - Default ACU reply-delay budget.
- REPLY_
FLAG - Reply flag set in
Addresswhen sent from PD to ACU. - SOM
- Start of message marker — begins every OSDP packet header.