Decodes frames received from the device into Meshcore.Events.
The reader is a pure state machine (no processes): handle_rx/2 takes a
frame and returns the events it produced together with the updated reader.
It keeps only the state needed to turn frames into events:
- the contact list currently being received (
CONTACT_START…CONTACT_END), - pending binary requests (so
:binary_responseframes can be decoded into:status_response,:telemetry_response,:mma_response,:acl_responseand:neighbours_responseevents), - the
Meshcore.PacketParserused for RX-log decoding and channel-message path correlation.
Malformed or truncated frames never raise: they are logged and dropped, as in the Python implementation.
Summary
Functions
Drops expired pending binary requests.
Whether channel decryption is enabled.
Decodes one frame. Returns {events, reader}; events is in dispatch order.
Creates a new reader.
Registers a pending binary request keyed by its expected tag (hex), so the
matching :binary_response can be decoded. Expired registrations are purged.
Enables or disables decryption of group-channel packets in the RX log.
Types
@type t() :: %Meshcore.Reader{ contact_nb: non_neg_integer(), contacts: %{required(String.t()) => map()}, parser: Meshcore.PacketParser.t(), pending_binary_requests: %{required(String.t()) => pending()} }
Functions
Drops expired pending binary requests.
Whether channel decryption is enabled.
@spec handle_rx(t(), binary()) :: {[Meshcore.Event.t()], t()}
Decodes one frame. Returns {events, reader}; events is in dispatch order.
@spec new() :: t()
Creates a new reader.
@spec register_binary_request( t(), String.t(), String.t(), atom(), non_neg_integer(), keyword() ) :: t()
Registers a pending binary request keyed by its expected tag (hex), so the
matching :binary_response can be decoded. Expired registrations are purged.
Options: :context (map copied into the result), :is_anon (boolean).
Enables or disables decryption of group-channel packets in the RX log.