summaryrefslogtreecommitdiff
path: root/fw/esp32/components/eos/cell_sms.c
diff options
context:
space:
mode:
Diffstat (limited to 'fw/esp32/components/eos/cell_sms.c')
-rw-r--r--fw/esp32/components/eos/cell_sms.c17
1 files changed, 9 insertions, 8 deletions
diff --git a/fw/esp32/components/eos/cell_sms.c b/fw/esp32/components/eos/cell_sms.c
index 56e282a..ac710f9 100644
--- a/fw/esp32/components/eos/cell_sms.c
+++ b/fw/esp32/components/eos/cell_sms.c
@@ -210,20 +210,21 @@ void eos_cell_sms_handler(unsigned char mtype, unsigned char *buffer, uint16_t b
pdu_len = strlen(pdu);
buf = eos_net_alloc();
- buf[0] = EOS_CELL_MTYPE_SMS | EOS_CELL_MTYPE_SMS_MSG_ITEM;
+ buf[0] = EOS_CELL_MTYPE_SMS | EOS_CELL_MTYPE_SMS_LIST_ITEM;
rv = sms_decode(buf + 1, &len);
if (rv) {
eos_net_free(buf);
- } else {
- eos_net_send(EOS_NET_MTYPE_CELL, buf, len + 1);
+ continue;
}
+
+ eos_net_send(EOS_NET_MTYPE_CELL, buf, len + 1);
} while (1);
eos_modem_give();
break;
}
- case EOS_CELL_MTYPE_SMS_SEND: {
+ case EOS_CELL_MTYPE_SMS_MSG: {
char b[4];
rv = sms_encode(buffer, buf_len);
@@ -271,14 +272,14 @@ static void sms_received_handler(char *urc, regmatch_t m[]) {
rv = at_expect("^OK", NULL, 1000);
buf = eos_net_alloc();
- buf[0] = EOS_CELL_MTYPE_SMS | EOS_CELL_MTYPE_SMS_MSG_NEW;
+ buf[0] = EOS_CELL_MTYPE_SMS | EOS_CELL_MTYPE_SMS_MSG;
rv = sms_decode(buf + 1, &len);
if (rv) {
eos_net_free(buf);
- } else {
- len++;
- eos_net_send(EOS_NET_MTYPE_CELL, buf, len);
+ return;
}
+
+ eos_net_send(EOS_NET_MTYPE_CELL, buf, len + 1);
}
void eos_cell_sms_init(void) {