From cd38e2b12d6f13dfd03eed207aa7f262e00099f1 Mon Sep 17 00:00:00 2001 From: Serhii Kostiuk Date: Fri, 6 Jan 2023 16:57:35 +0200 Subject: [GP-1842] Refactoring - Fixed indentations This project uses tabs, not spaces. Make the indentation consistent. --- src/sms_send.c | 72 +++++++++++++++++++++++++++++----------------------------- 1 file changed, 36 insertions(+), 36 deletions(-) (limited to 'src/sms_send.c') diff --git a/src/sms_send.c b/src/sms_send.c index bc98cb4..149ce1a 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_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; + } + } if (options->cmgw_first) { - if (isCdmaTypeModel()) { + if (isCdmaTypeModel()) { 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 + //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); - } + 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 (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 (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_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); + } if (tmp < 0) { printf("sending message to %s failed\n", argv[i]); failed++; -- cgit v1.2.3 From e8b95d56ac9e06c3dc55f2c6fc3b2e177f9b10b0 Mon Sep 17 00:00:00 2001 From: Serhii Kostiuk Date: Fri, 6 Jan 2023 17:52:09 +0200 Subject: [GP-1842] Refactoring - Renamed Verizon 3GPP2 detection functions Renamed the functions to better represent their behavior and purpose. --- src/sms_send.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'src/sms_send.c') diff --git a/src/sms_send.c b/src/sms_send.c index 149ce1a..a95a0ca 100644 --- a/src/sms_send.c +++ b/src/sms_send.c @@ -225,7 +225,7 @@ static int do_send(int fd, struct send_options *options, int argc, char **argv) } //LE910-SVG SMS SEND WORKAROUND - if (is_vzw_lte()) { + 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) { @@ -235,7 +235,7 @@ static int do_send(int fd, struct send_options *options, int argc, char **argv) } 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); } @@ -253,7 +253,7 @@ static int do_send(int fd, struct send_options *options, int argc, char **argv) } //LE910-SVG SMS SEND WORKAROUND - if (is_vzw_lte()) { + 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 { @@ -298,7 +298,7 @@ static int do_send(int fd, struct send_options *options, int argc, char **argv) continue; } } else { - if (isCdmaTypeModel()) { + if (is_telit_3gpp2_format()) { log_debug("using CDMA pdu encoding for cmgs"); tmp = pdu_encode_cdma(buf, sizeof(buf), &pdu); } @@ -313,7 +313,7 @@ static int do_send(int fd, struct send_options *options, int argc, char **argv) } //LE910-SVG SMS SEND WORKAROUND - if (is_vzw_lte()) { + 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 { -- cgit v1.2.3