summaryrefslogtreecommitdiff
path: root/fw/esp32/components/eos/cell_sms.c
diff options
context:
space:
mode:
authorUros Majstorovic <majstor@majstor.org>2022-10-24 19:59:27 +0200
committerUros Majstorovic <majstor@majstor.org>2022-10-24 19:59:27 +0200
commitb74b1c08b76e448df27b6fff50cca6fed3e4e7a7 (patch)
tree763f116e381e1b7442dbee63cafa9a14cdd8a7da /fw/esp32/components/eos/cell_sms.c
parenta5a94dea7043fa6b65693cf0cc11d426d49c637d (diff)
fixed cell voice and sms driver
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) {