Skip to main content

protocol/
lib.rs

1//! Wire protocol between the host daemon and device agents (design D4).
2//!
3//! Every message is one CBOR item in a length-prefixed frame. The crate holds
4//! the message schema ([`message`], [`snapshot`], [`event`]), structured errors
5//! ([`error`]) and the capability set ([`capability`]); it holds no device code.
6//! See `README.md` for the byte-level layout rules the Kotlin agent follows.
7
8#[macro_use]
9mod macros;
10
11pub mod capability;
12mod cbor;
13pub mod error;
14pub mod event;
15pub mod frame;
16pub mod liveness;
17pub mod message;
18pub mod sequence;
19pub mod session;
20pub mod snapshot;
21
22pub use capability::Capabilities;
23pub use error::{Error, code};
24pub use message::Message;
25
26/// The protocol version this crate speaks by default.
27pub const PROTOCOL_VERSION: u16 = 1;
28
29/// Every protocol version this crate can speak, lowest first.
30pub const SUPPORTED_VERSIONS: &[u16] = &[PROTOCOL_VERSION];