FreeCalypso > hg > freecalypso-tools
diff uptools/atcmd/smsend_main.c @ 370:076d533f840d
fcup-smsend: implemented automatic concat SMS refno generation
author | Mychaela Falconia <falcon@freecalypso.org> |
---|---|
date | Thu, 08 Mar 2018 17:47:58 +0000 |
parents | 06cf82710cca |
children | 0bd06f481223 |
line wrap: on
line diff
--- a/uptools/atcmd/smsend_main.c Thu Mar 08 16:41:57 2018 +0000 +++ b/uptools/atcmd/smsend_main.c Thu Mar 08 17:47:58 2018 +0000 @@ -12,7 +12,8 @@ #define MAX_MSG_CHARS (153*255) -int sms_write_mode, text_mode, utf8_input, concat_enable, quiet; +int sms_write_mode, text_mode, utf8_input, quiet; +int concat_enable, concat_refno_set; u_char dest_addr[12]; char msgtext[MAX_MSG_CHARS*2+2]; u_char msgtext_gsm7[MAX_MSG_CHARS]; @@ -26,13 +27,17 @@ extern int optind; extern char *optarg; - while ((c = getopt(argc, argv, "B:C:np:qRtuwWX:")) != EOF) { + while ((c = getopt(argc, argv, "B:cC:np:qRtuwWX:")) != EOF) { if (atinterf_cmdline_opt(c)) continue; switch (c) { + case 'c': + concat_enable = 1; + continue; case 'C': concat_enable = 1; concat_refno = strtoul(optarg, 0, 0); + concat_refno_set = 1; continue; case 'q': quiet = 1; @@ -186,6 +191,8 @@ } if (!concat_enable) goto too_long_for_one_sms; + if (!concat_refno_set) + concat_refno = get_concsms_refno_from_host_fs(); nparts = (msgtext_gsmlen + 152) / 153; udh[0] = 0x00; udh[1] = 0x03;