From 63db795dce4e752d0d36a48faf1652f650dfb240 Mon Sep 17 00:00:00 2001 From: Serhii Kostiuk Date: Tue, 18 Jun 2019 17:22:51 +0300 Subject: [MTR-MTQ] Quectel support for sms-utils Added support of Quectel-specific commands into the "atcmd_plus_iccid_read()" function --- src/atcmd.c | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/src/atcmd.c b/src/atcmd.c index 9e230c5..694782d 100644 --- a/src/atcmd.c +++ b/src/atcmd.c @@ -1294,8 +1294,18 @@ int atcmd_plus_iccid_read(int fd) char *save; char *token; int tmp; + char* command; - atcmd_writeline(fd, "AT#CCID"); + if (is_telit_model()) { + command = "AT#CCID"; + } else if (is_quectel_model()) { + command = "AT+QCCID"; + } else { + log_error("unsupported modem manufacturer, unable to detect ICCID"); + return -1; + } + + atcmd_writeline(fd, command); //Swallow extra "\r\n" tmp = atcmd_readline(fd, buf, sizeof(buf)); if (tmp <= 0) { -- cgit v1.2.3