Skip to main content

Crate telepath_wire

Crate telepath_wire 

Source
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§

AppErrorPayload
Payload carried inside a Response when status == ResponseStatus::AppError.
DiscoveryEntry
A single entry returned by the Command Discovery Protocol (CmdID 0x0000).
DiscoveryPage
Response payload for a paged Command Discovery Protocol response.
DiscoveryRequest
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§

PacketType
Wire-level packet type discriminant.
ResponseStatus
Status code carried inside a Response packet.
WireError
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 AppErrorPayload from bytes, borrowing the message slice.
encode_app_error
Encode an AppErrorPayload into out, returning the number of bytes written.