Module encode

Module encode 

Source
Expand description

DPlus packet encoders.

Every encoder writes into a caller-supplied &mut [u8] and returns the number of bytes written. Hot-path encoding is allocation-free.

Functions§

encode_link1
Encode a LINK1 connect request (5 bytes).
encode_link2
Encode a LINK2 login packet (28 bytes).
encode_link1_ack
Encode the server’s LINK1 ACK echo (5 bytes — same shape as LINK1).
encode_link2_reply
Encode an 8-byte LINK2 reply.
encode_poll
Encode a 3-byte keepalive poll.
encode_poll_echo
Encode the server’s poll echo (3 bytes).
encode_unlink
Encode an UNLINK request (5 bytes).
encode_unlink_ack
Encode the server’s UNLINK ACK echo (5 bytes — same shape as UNLINK).
encode_voice_data
Encode a 29-byte voice data packet.
encode_voice_eot
Encode a 32-byte voice EOT packet.
encode_voice_header
Encode a 58-byte voice header.