Expand description
Telepath wire protocol types.
This crate is no_std and no alloc. It defines the shared types used by
both the firmware-side (telepath-firmware) and host-side (telepath-host)
libraries. All types must remain free of heap allocation.
§Protocol overview
- Framing: COBS downstream (Host→Target), rzCOBS upstream (Target→Host); 0x00 delimiter both directions
- Serialization: postcard (little-endian, varint-compressed)
- Packet type discriminant: 2-valued (Request / Response), per ONC RPC CALL/REPLY model
- Errors: expressed via
ResponseStatus, not as a separate packet type - Discovery: reserved CmdID 0x0000 (CoAP Empty / ONC RPC convention)
Re-exports§
pub use metrics::MetricsSnapshot;
Modules§
- cmd_id
- Command ID derivation for the Telepath Command Discovery Protocol.
- framing
- Framing layer for the Telepath wire protocol.
- metrics
Structs§
- AppError
Payload - Payload carried inside a
Responsewhenstatus == ResponseStatus::AppError. - Discovery
Entry - A single entry returned by the Command Discovery Protocol (CmdID 0x0000).
- Discovery
Page - Response payload for a paged Command Discovery Protocol response.
- Discovery
Request - Request payload for the Command Discovery Protocol when pagination is needed.
- Request
- An RPC call from host to target.
- Response
- An RPC reply from target to host.
Enums§
- Packet
Type - Wire-level packet type discriminant.
- Response
Status - Status code carried inside a
Responsepacket. - Wire
Error - Errors that can arise during wire-level encoding or decoding.
Constants§
- CMD_
ID_ DISCOVERY - Reserved command ID for the Command Discovery Protocol (CDP).
- CMD_
ID_ METRICS - Reserved command ID for the framing/throughput metrics snapshot.
- MAX_
PAYLOAD_ SIZE - Maximum payload size in bytes. Both sides MUST enforce this limit.
Functions§
- decode_
app_ error - Decode an
AppErrorPayloadfrombytes, borrowing the message slice. - encode_
app_ error - Encode an
AppErrorPayloadintoout, returning the number of bytes written.