Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
def gen_tpdu(ref, to, fromm, text, empty):
# See 3GPP TS 23.040 version 11.5.0 Release 11.
# TP-PID = 40 ==> short message type 0
# TP-DCS = c3 ==> disable "other message indicator" and discard message
TPPID = 0x40 if empty else 0
TPDCS = 0xc3 if empty else 0
if empty:
text = ""
pdu = SMS_DELIVER.create(
fromm, to, text, tp_pid=TPPID, tp_dcs=TPDCS).toPDU()
return [pdu]