FreeCalypso > hg > sms-coding-utils
comparison 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 |
comparison
equal
deleted
inserted
replaced
17:dc1cc851025c | 18:590b0b5bcbbb |
---|---|
12 | 12 |
13 extern int dir_mo, include_sca; | 13 extern int dir_mo, include_sca; |
14 extern u_char sc_addr[12], user_addr[12]; | 14 extern u_char sc_addr[12], user_addr[12]; |
15 extern u_char mr_byte, pid_byte, dcs_byte; | 15 extern u_char mr_byte, pid_byte, dcs_byte; |
16 extern u_char scts_buf[7]; | 16 extern u_char scts_buf[7]; |
17 extern u_char vp_format, vp_buf[7]; | |
17 extern int is_septet, scts_is_set; | 18 extern int is_septet, scts_is_set; |
18 extern int flag_rp, flag_sr, flag_lp, flag_mms, flag_rd; | 19 extern int flag_rp, flag_sr, flag_lp, flag_mms, flag_rd; |
19 | 20 |
20 extern int input_lineno; | 21 extern int input_lineno; |
21 | 22 |
135 } | 136 } |
136 scts_is_set = 1; | 137 scts_is_set = 1; |
137 } | 138 } |
138 | 139 |
139 void | 140 void |
141 set_vp_abs(argc, argv) | |
142 char **argv; | |
143 { | |
144 int rc; | |
145 | |
146 if (!dir_mo) { | |
147 fprintf(stderr, ERR_PREFIX "vp-abs is not allowed in MT mode\n", | |
148 input_lineno); | |
149 exit(1); | |
150 } | |
151 rc = encode_gsm_sms_abstime(argv[1], vp_buf); | |
152 if (rc < 0) { | |
153 fprintf(stderr, ERR_PREFIX "invalid timestamp argument\n", | |
154 input_lineno); | |
155 exit(1); | |
156 } | |
157 vp_format = 0x18; | |
158 } | |
159 | |
160 void | |
161 set_vp_rel(argc, argv) | |
162 char **argv; | |
163 { | |
164 char *endp; | |
165 | |
166 if (!dir_mo) { | |
167 fprintf(stderr, ERR_PREFIX "vp-rel is not allowed in MT mode\n", | |
168 input_lineno); | |
169 exit(1); | |
170 } | |
171 vp_buf[0] = strtoul(argv[1], &endp, 0); | |
172 if (*endp) { | |
173 fprintf(stderr, ERR_PREFIX "invalid byte value argument\n", | |
174 input_lineno); | |
175 exit(1); | |
176 } | |
177 vp_format = 0x10; | |
178 } | |
179 | |
180 void | |
140 set_flag_rp() | 181 set_flag_rp() |
141 { | 182 { |
142 flag_rp = 1; | 183 flag_rp = 1; |
143 } | 184 } |
144 | 185 |