diff options
author | John Klug <john.klug@multitech.com> | 2023-01-10 16:40:41 -0600 |
---|---|---|
committer | John Klug <john.klug@multitech.com> | 2023-01-10 16:40:41 -0600 |
commit | a64a1538c6576eccfb841861cd9acf9b22c732d8 (patch) | |
tree | 00031ede7deeb96674eb000a336179f22ad32710 /src/sms_send.c | |
parent | c97e4dad4fa1720cc510d44b404a1727907c22a5 (diff) | |
parent | 78a27efb55e1c509604fe9d96f8c421d6b1bda36 (diff) | |
download | sms-utils-master.tar.gz sms-utils-master.tar.bz2 sms-utils-master.zip |
[GP-1842] Update the Cellular code to use SIM IMSI for Verizon detection
See merge request !14
Diffstat (limited to 'src/sms_send.c')
-rw-r--r-- | src/sms_send.c | 74 |
1 files changed, 37 insertions, 37 deletions
diff --git a/src/sms_send.c b/src/sms_send.c index bc98cb4..a95a0ca 100644 --- a/src/sms_send.c +++ b/src/sms_send.c @@ -224,25 +224,25 @@ static int do_send(int fd, struct send_options *options, int argc, char **argv) printf("preparing for send...\n"); } - //LE910-SVG SMS SEND WORKAROUND - if (is_vzw_lte()) { - log_info("setting text mode for Verizon LTE"); - tmp = atcmd_plus_cmgf_write(fd, SMS_TEXT_MODE); - if (tmp < 0) { - log_error("failed to set text mode for sending with Verizon LTE."); - return false; - } - } + //LE910-SVG SMS SEND WORKAROUND + if (is_telit_lte_vzw_3gpp2_format()) { + log_info("setting text mode for Verizon LTE"); + tmp = atcmd_plus_cmgf_write(fd, SMS_TEXT_MODE); + if (tmp < 0) { + log_error("failed to set text mode for sending with Verizon LTE."); + return false; + } + } if (options->cmgw_first) { - if (isCdmaTypeModel()) { + if (is_telit_3gpp2_format()) { log_debug("using CDMA pdu encoding for cmgw"); - tmp = pdu_encode_cdma(buf, sizeof(buf), &pdu); - } - else { + tmp = pdu_encode_cdma(buf, sizeof(buf), &pdu); + } + else { log_debug("using GSM pdu encoding for cmgw"); - tmp = pdu_encode(buf, sizeof(buf), &pdu); - } + tmp = pdu_encode(buf, sizeof(buf), &pdu); + } if (tmp < 0) { log_error("pdu encode failed"); return false; @@ -252,13 +252,13 @@ static int do_send(int fd, struct send_options *options, int argc, char **argv) printf("writing message to memory\n"); } - //LE910-SVG SMS SEND WORKAROUND - if (is_vzw_lte()) { - mem_index = atcmd_plus_cmgw_write_text(fd, NULL, SMS_ADDR_UNSPEC, NULL, pdu.user_data, pdu.user_data_len); - } - else { - mem_index = atcmd_plus_cmgw_write(fd, buf, pdu.msg_len); - } + //LE910-SVG SMS SEND WORKAROUND + if (is_telit_lte_vzw_3gpp2_format()) { + mem_index = atcmd_plus_cmgw_write_text(fd, NULL, SMS_ADDR_UNSPEC, NULL, pdu.user_data, pdu.user_data_len); + } + else { + mem_index = atcmd_plus_cmgw_write(fd, buf, pdu.msg_len); + } if (mem_index < 0) { log_error("write message to memory failed"); return false; @@ -298,27 +298,27 @@ static int do_send(int fd, struct send_options *options, int argc, char **argv) continue; } } else { - if (isCdmaTypeModel()) { - log_debug("using CDMA pdu encoding for cmgs"); - tmp = pdu_encode_cdma(buf, sizeof(buf), &pdu); - } - else { - log_debug("using GSM pdu encoding for cmgs"); - tmp = pdu_encode(buf, sizeof(buf), &pdu); - } + if (is_telit_3gpp2_format()) { + log_debug("using CDMA pdu encoding for cmgs"); + tmp = pdu_encode_cdma(buf, sizeof(buf), &pdu); + } + else { + log_debug("using GSM pdu encoding for cmgs"); + tmp = pdu_encode(buf, sizeof(buf), &pdu); + } if (tmp < 0) { printf("sending message to %s failed\n", argv[i]); failed++; continue; } - //LE910-SVG SMS SEND WORKAROUND - if (is_vzw_lte()) { - tmp = atcmd_plus_cmgs_write_text(fd, pdu.addr.addr, pdu.user_data, pdu.user_data_len); - } - else { - tmp = atcmd_plus_cmgs_write(fd, buf, pdu.msg_len); - } + //LE910-SVG SMS SEND WORKAROUND + if (is_telit_lte_vzw_3gpp2_format()) { + tmp = atcmd_plus_cmgs_write_text(fd, pdu.addr.addr, pdu.user_data, pdu.user_data_len); + } + else { + tmp = atcmd_plus_cmgs_write(fd, buf, pdu.msg_len); + } if (tmp < 0) { printf("sending message to %s failed\n", argv[i]); failed++; |