Skip to main content

Module cmux

Module cmux 

Source
Expand description

3GPP TS 27.010 (GSM 07.10) basic-option frame encode/decode.

Frame: F9 | address | control | length (1–2 octets, EA) | info | FCS | F9. No byte stuffing: the length field delimits the info, so payload bytes may be 0xF9. FCS is CRC-8 (reflected poly 0x07, i.e. 0xE0) over address+control+length; for UI frames the info field is included too.

Structs§

DecodedFrame
Deframer
Streaming deframer: keeps partial frames across reads and resyncs on garbage.

Constants§

DEFAULT_MAX_RX_INFO
Default receive limit for the info field: room for a 1500-byte IP packet in PPP framing. A corrupt length octet (noise, a lost flag) then costs one dropped frame, not a stall until 32 KiB more arrive. Raise it with Deframer::with_max_info when AT+CMUX sets a larger N1.
DISC
DM
FLAG
MAX_INFO
Largest info field the basic option can describe: the 2-octet length field holds 15 bits (27.010 §5.2.1.5).
PF
SABM
Frame types (control field with the P/F bit cleared).
TX_N1
Info bytes per transmitted frame. Basic option defaults N1 to 31 unless AT+CMUX sets it, so 31 is the only size every modem accepts.
UA
UI
UIH

Functions§

decode_address
encode_address
encode_frame
One frame. cr is the address C/R bit; as initiator we set it on commands and UIH.
encode_uih
UIH data frames for payload, split into TX_N1-sized info fields.
fcs