diff uptools/atcmd/smsend_main.c @ 369:06cf82710cca

fcup-smsend: implemented -q option to suppress concat summary output
author Mychaela Falconia <falcon@freecalypso.org>
date Thu, 08 Mar 2018 16:41:57 +0000
parents 3cc79e260066
children 076d533f840d
line wrap: on
line diff
--- 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);
 }