Skip to main content

Module sms

Module sms 

Source
Expand description

SMS codecs: 3GPP TS 23.038 alphabets and TS 23.040 TPDUs as used by TS 27.005 PDU mode (AT+CMGF=0).

  • gsm7: default alphabet, extension table, national language tables, septet packing.
  • ucs2: UTF-16BE user data, surrogate pairs included.
  • pdu: decode SMS-DELIVER / SMS-SUBMIT / SMS-STATUS-REPORT, encode SMS-SUBMIT (with automatic concatenation).
  • [concat]: multipart reassembly keyed by (type, address, reference, total).

All decoders are byte based and return errors for malformed input; none panic.

Modules§

concat
Reassembly of concatenated SMS (23.040 §9.2.3.24.1/.8).
gsm7
GSM 7-bit default alphabet, extension table and national language tables (3GPP TS 23.038 §6.2.1 and Annex A), plus septet packing (§6.1.2.1).
pdu
3GPP TS 23.040 TPDUs in TS 27.005 PDU-mode form (SMSC address + TPDU).
ucs2
UCS2 user data (23.038 §6.2.3). Encoded as UTF-16BE, so characters outside the BMP travel as surrogate pairs, as every current handset expects.

Functions§

hex_decode
Hex string → bytes. Accepts either case and surrounding whitespace; None for odd length or a non-hex character.
hex_encode
Bytes → uppercase hex.