From b74b1c08b76e448df27b6fff50cca6fed3e4e7a7 Mon Sep 17 00:00:00 2001 From: Uros Majstorovic Date: Mon, 24 Oct 2022 19:59:27 +0200 Subject: fixed cell voice and sms driver --- fw/esp32/components/eos/cell_sms.c | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) (limited to 'fw/esp32/components/eos/cell_sms.c') 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) { -- cgit v1.2.3