FreeCalypso > hg > freecalypso-tools
comparison uptools/atcmd/smsend_main.c @ 467:dc2fd8e6f42c
uptools/atcmd: null pointer passing fixes
author | Mychaela Falconia <falcon@freecalypso.org> |
---|---|
date | Mon, 11 Feb 2019 22:17:46 +0000 |
parents | ed9b67e7e741 |
children | 2969032bdfac |
comparison
equal
deleted
inserted
replaced
466:5bcf12be0834 | 467:dc2fd8e6f42c |
---|---|
140 | 140 |
141 common_init() | 141 common_init() |
142 { | 142 { |
143 atinterf_init(); | 143 atinterf_init(); |
144 /* enable verbose error messages */ | 144 /* enable verbose error messages */ |
145 atinterf_exec_cmd_needok("AT+CMEE=2", 0, 0); | 145 atinterf_exec_cmd_needok("AT+CMEE=2", (char *) 0, (void *) 0); |
146 } | 146 } |
147 | 147 |
148 gsm7_mode_main() | 148 gsm7_mode_main() |
149 { | 149 { |
150 u_char msgtext_gsm7[MAX_MSG_CHARS]; | 150 u_char msgtext_gsm7[MAX_MSG_CHARS]; |
205 udh[2] = concat_refno; | 205 udh[2] = concat_refno; |
206 udh[3] = nparts; | 206 udh[3] = nparts; |
207 common_init(); | 207 common_init(); |
208 prep_for_pdu_mode(); | 208 prep_for_pdu_mode(); |
209 if (sms_write_mode == 0) | 209 if (sms_write_mode == 0) |
210 atinterf_exec_cmd_needok("AT+CMMS=1", 0, 0); | 210 atinterf_exec_cmd_needok("AT+CMMS=1", (char *) 0, (void *) 0); |
211 pos = 0; | 211 pos = 0; |
212 remain = msgtext_gsmlen; | 212 remain = msgtext_gsmlen; |
213 for (n = 1; n <= nparts; n++) { | 213 for (n = 1; n <= nparts; n++) { |
214 udh[4] = n; | 214 udh[4] = n; |
215 chunk = 153; | 215 chunk = 153; |
218 send_in_pdu_mode(dest_addr, msgtext_gsm7 + pos, chunk, udh, 5); | 218 send_in_pdu_mode(dest_addr, msgtext_gsm7 + pos, chunk, udh, 5); |
219 pos += chunk; | 219 pos += chunk; |
220 remain -= chunk; | 220 remain -= chunk; |
221 } | 221 } |
222 if (sms_write_mode == 0) | 222 if (sms_write_mode == 0) |
223 atinterf_exec_cmd_needok("AT+CMMS=0", 0, 0); | 223 atinterf_exec_cmd_needok("AT+CMMS=0", (char *) 0, (void *) 0); |
224 if (sms_write_mode == 1) | 224 if (sms_write_mode == 1) |
225 sendafterwr_process(); | 225 sendafterwr_process(); |
226 if (!concat_quiet) | 226 if (!concat_quiet) |
227 printf("Message sent as %u SMS segments\n", nparts); | 227 printf("Message sent as %u SMS segments\n", nparts); |
228 exit(0); | 228 exit(0); |
268 udh[2] = concat_refno; | 268 udh[2] = concat_refno; |
269 udh[3] = nparts; | 269 udh[3] = nparts; |
270 common_init(); | 270 common_init(); |
271 prep_for_pdu_mode(); | 271 prep_for_pdu_mode(); |
272 if (sms_write_mode == 0) | 272 if (sms_write_mode == 0) |
273 atinterf_exec_cmd_needok("AT+CMMS=1", 0, 0); | 273 atinterf_exec_cmd_needok("AT+CMMS=1", (char *) 0, (void *) 0); |
274 pos = 0; | 274 pos = 0; |
275 remain = msgtext_unilen; | 275 remain = msgtext_unilen; |
276 for (n = 1; n <= nparts; n++) { | 276 for (n = 1; n <= nparts; n++) { |
277 udh[4] = n; | 277 udh[4] = n; |
278 chunk = 67; | 278 chunk = 67; |
281 send_pdu_ucs2(dest_addr, msgtext_uni + pos, chunk, udh, 5); | 281 send_pdu_ucs2(dest_addr, msgtext_uni + pos, chunk, udh, 5); |
282 pos += chunk; | 282 pos += chunk; |
283 remain -= chunk; | 283 remain -= chunk; |
284 } | 284 } |
285 if (sms_write_mode == 0) | 285 if (sms_write_mode == 0) |
286 atinterf_exec_cmd_needok("AT+CMMS=0", 0, 0); | 286 atinterf_exec_cmd_needok("AT+CMMS=0", (char *) 0, (void *) 0); |
287 if (sms_write_mode == 1) | 287 if (sms_write_mode == 1) |
288 sendafterwr_process(); | 288 sendafterwr_process(); |
289 if (!concat_quiet) | 289 if (!concat_quiet) |
290 printf("Message sent as %u SMS segments\n", nparts); | 290 printf("Message sent as %u SMS segments\n", nparts); |
291 exit(0); | 291 exit(0); |