# HG changeset patch # User Mychaela Falconia # Date 1520527317 0 # Node ID 06cf82710cca2608c13513de6d23bdc69e159b80 # Parent 3cc79e26006672236a542e9c428c1441bf7d95e2 fcup-smsend: implemented -q option to suppress concat summary output diff -r 3cc79e260066 -r 06cf82710cca uptools/atcmd/smsend_main.c --- a/uptools/atcmd/smsend_main.c Thu Mar 08 16:28:26 2018 +0000 +++ b/uptools/atcmd/smsend_main.c Thu Mar 08 16:41:57 2018 +0000 @@ -12,7 +12,7 @@ #define MAX_MSG_CHARS (153*255) -int sms_write_mode, text_mode, utf8_input, concat_enable; +int sms_write_mode, text_mode, utf8_input, concat_enable, quiet; u_char dest_addr[12]; char msgtext[MAX_MSG_CHARS*2+2]; u_char msgtext_gsm7[MAX_MSG_CHARS]; @@ -26,7 +26,7 @@ extern int optind; extern char *optarg; - while ((c = getopt(argc, argv, "B:C:np:RtuwWX:")) != EOF) { + while ((c = getopt(argc, argv, "B:C:np:qRtuwWX:")) != EOF) { if (atinterf_cmdline_opt(c)) continue; switch (c) { @@ -34,6 +34,9 @@ concat_enable = 1; concat_refno = strtoul(optarg, 0, 0); continue; + case 'q': + quiet = 1; + continue; case 't': text_mode = 1; continue; @@ -177,7 +180,7 @@ send_in_pdu_mode(dest_addr, msgtext_gsm7, msgtext_gsmlen, 0, 0); if (sms_write_mode == 1) sendafterwr_process(); - if (concat_enable) + if (concat_enable && !quiet) printf("Message sent as single SMS\n"); exit(0); } @@ -207,6 +210,7 @@ atinterf_exec_cmd_needok("AT+CMMS=0", 0, 0); if (sms_write_mode == 1) sendafterwr_process(); - printf("Message sent as %u SMS segments\n", nparts); + if (!quiet) + printf("Message sent as %u SMS segments\n", nparts); exit(0); }