summaryrefslogtreecommitdiff
path: root/fw/esp32/components/eos/cell_sms.c
diff options
context:
space:
mode:
authorUros Majstorovic <majstor@majstor.org>2025-07-28 23:37:45 +0200
committerUros Majstorovic <majstor@majstor.org>2025-07-28 23:37:45 +0200
commitfc70c6f78f43dbeda91d47b2d2071d4da4082121 (patch)
treec104744b62d3ea2c1a4a05eaab8283f368215300 /fw/esp32/components/eos/cell_sms.c
parent58f41971b1e801ad2fbcea08e5152afa2b18ca73 (diff)
upgrade to ESP-IDF v5; fixed SPI net and app protocoles; reimplemented power management;
Diffstat (limited to 'fw/esp32/components/eos/cell_sms.c')
-rw-r--r--fw/esp32/components/eos/cell_sms.c13
1 files changed, 9 insertions, 4 deletions
diff --git a/fw/esp32/components/eos/cell_sms.c b/fw/esp32/components/eos/cell_sms.c
index 5145cd7..1cd4cda 100644
--- a/fw/esp32/components/eos/cell_sms.c
+++ b/fw/esp32/components/eos/cell_sms.c
@@ -13,7 +13,7 @@
#define CTRL_Z 0x1a
-static const char *TAG = "EOS SMS";
+static const char *TAG = "EOS CELL SMS";
static char _pdu_in[2048];
static char _pdu_out[2048];
@@ -266,7 +266,8 @@ void eos_cell_sms_handler(unsigned char mtype, unsigned char *buffer, uint16_t b
}
buf_len = _rv;
- eos_net_send(EOS_NET_MTYPE_CELL, buf, buf_len + 1);
+ rv = eos_net_send(EOS_NET_MTYPE_CELL, buf, buf_len + 1);
+ if (rv) ESP_LOGE(TAG, "NET SEND ERR:%d", rv);
} while (1);
eos_modem_give();
@@ -345,9 +346,13 @@ static void sms_received_handler(char *urc, regmatch_t m[]) {
}
buf_len = _rv;
- eos_net_send(EOS_NET_MTYPE_CELL, buf, buf_len + 1);
+ rv = eos_net_send(EOS_NET_MTYPE_CELL, buf, buf_len + 1);
+ if (rv) ESP_LOGE(TAG, "NET SEND ERR:%d", rv);
}
void eos_cell_sms_init(void) {
- at_urc_insert("^\\+CMTI: .*,([0-9]+)$", sms_received_handler, REG_EXTENDED);
+ int rv;
+
+ rv = at_urc_insert("^\\+CMTI: .*,([0-9]+)$", sms_received_handler, REG_EXTENDED);
+ assert(rv == EOS_OK);
}