FreeCalypso > hg > sms-coding-utils
diff gen-pdu/settings.c @ 18:590b0b5bcbbb
sms-gen-tpdu: support setting VP for MO
author | Mychaela Falconia <falcon@freecalypso.org> |
---|---|
date | Sun, 27 Aug 2023 07:55:13 +0000 |
parents | d9d722033ff1 |
children |
line wrap: on
line diff
--- a/gen-pdu/settings.c Sun Aug 27 07:39:14 2023 +0000 +++ b/gen-pdu/settings.c Sun Aug 27 07:55:13 2023 +0000 @@ -14,6 +14,7 @@ extern u_char sc_addr[12], user_addr[12]; extern u_char mr_byte, pid_byte, dcs_byte; extern u_char scts_buf[7]; +extern u_char vp_format, vp_buf[7]; extern int is_septet, scts_is_set; extern int flag_rp, flag_sr, flag_lp, flag_mms, flag_rd; @@ -137,6 +138,46 @@ } void +set_vp_abs(argc, argv) + char **argv; +{ + int rc; + + if (!dir_mo) { + fprintf(stderr, ERR_PREFIX "vp-abs is not allowed in MT mode\n", + input_lineno); + exit(1); + } + rc = encode_gsm_sms_abstime(argv[1], vp_buf); + if (rc < 0) { + fprintf(stderr, ERR_PREFIX "invalid timestamp argument\n", + input_lineno); + exit(1); + } + vp_format = 0x18; +} + +void +set_vp_rel(argc, argv) + char **argv; +{ + char *endp; + + if (!dir_mo) { + fprintf(stderr, ERR_PREFIX "vp-rel is not allowed in MT mode\n", + input_lineno); + exit(1); + } + vp_buf[0] = strtoul(argv[1], &endp, 0); + if (*endp) { + fprintf(stderr, ERR_PREFIX "invalid byte value argument\n", + input_lineno); + exit(1); + } + vp_format = 0x10; +} + +void set_flag_rp() { flag_rp = 1;