Expand description
USSD: 7-bit packing with the CBS/USSD padding rule (3GPP TS 23.038 §6.1.2.3.1),
CBS data coding scheme (23.038 §5) and the +CUSD result line (TS 27.007 §7.15).
Structs§
- CbsDcs
- What a CBS/USSD data coding scheme says about the payload (23.038 §5).
- Cusd
- One
+CUSD: <m>[,<str>[,<dcs>]]line. - Ussd
Text - A decoded USSD string.
Enums§
- Cscs
- TE character set chosen with
AT+CSCS(27.007 §5.5). With a GSM 7-bit<dcs>the modem converts<str>into it (27.007 §7.15); the parser cannot see+CSCS, so the caller says which one is active. - Cusd
Status <m>of+CUSD(27.007 §7.15).
Functions§
- decode
- Decode a network USSD string (the octets, not hex) per its DCS. 8-bit data is read
as ISO-8859-1; compressed data (23.042) is not supported and returns
None. - decode_
gsm7 - Packed USSD string → text (GSM 7-bit default alphabet).
- encode
- Text → packed USSD string (GSM 7-bit default alphabet).
- pack_
septets - Pack septets after
fill_bitszero bits. When the last octet has 7 spare bits they carry a CR; when the text ends with CR exactly on an octet boundary another CR is appended, so the receiver can tell padding from data. - parse_
cusd - Parse one logical
+CUSDline (prefix case-insensitive). The string may hold commas, CR/LF and quotes; the closing quote is the last one on the line. A trailingOKglued to the line after the string or the DCS is ignored; anOKinside an unclosed string is kept as text.Noneif this is not a+CUSDline. - unpack_
septets - Unpack every septet after
fill_bits, dropping the padding CR (7 spare bits) and the extra CR added after a CR that ended on an octet boundary.