FreeCalypso > hg > sms-coding-utils
diff gen-pdu/message.c @ 16:d9d722033ff1
sms-gen-tpdu: add support for first octet flags
author | Mychaela Falconia <falcon@freecalypso.org> |
---|---|
date | Sun, 27 Aug 2023 07:32:46 +0000 |
parents | 0fe95ca922c7 |
children | 590b0b5bcbbb |
line wrap: on
line diff
--- a/gen-pdu/message.c Sun Aug 27 06:43:23 2023 +0000 +++ b/gen-pdu/message.c Sun Aug 27 07:32:46 2023 +0000 @@ -16,6 +16,7 @@ extern u_char mr_byte, pid_byte, dcs_byte; extern u_char scts_buf[7]; extern int is_septet, scts_is_set; +extern int flag_rp, flag_sr, flag_lp, flag_mms, flag_rd; extern int input_lineno; @@ -25,11 +26,18 @@ u_char fo; if (dir_mo) - fo = 1; - else - fo = 0; + fo = flag_rd ? 5 : 1; + else { + fo = flag_mms ? 0 : 4; + if (flag_lp) + fo |= 0x08; + } + if (flag_sr) + fo |= 0x20; if (udhi) fo |= 0x40; + if (flag_rp) + fo |= 0x80; printf("%02X", fo); }