From 6a4b3ef0e72ee134b81a523ce41fd4c45f3b4429 Mon Sep 17 00:00:00 2001 From: Uros Majstorovic Date: Sun, 4 Sep 2022 18:43:50 +0200 Subject: fixed wifi and cell --- fw/esp32/components/eos/cell_ussd.c | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) (limited to 'fw/esp32/components/eos/cell_ussd.c') diff --git a/fw/esp32/components/eos/cell_ussd.c b/fw/esp32/components/eos/cell_ussd.c index 5b90e35..976fd51 100644 --- a/fw/esp32/components/eos/cell_ussd.c +++ b/fw/esp32/components/eos/cell_ussd.c @@ -17,8 +17,10 @@ static int cmd_len; void eos_cell_ussd_handler(unsigned char mtype, unsigned char *buffer, uint16_t buf_len) { int rv; + buffer++; + buf_len--; switch (mtype) { - case EOS_CELL_MTYPE_USSD_REQUEST: + case EOS_CELL_MTYPE_USSD_REQUEST: { if (buf_len > EOS_CELL_MAX_USSD_STR) return; buffer[buf_len] = '\0'; @@ -33,8 +35,9 @@ void eos_cell_ussd_handler(unsigned char mtype, unsigned char *buffer, uint16_t eos_modem_give(); break; + } - case EOS_CELL_MTYPE_USSD_CANCEL: + case EOS_CELL_MTYPE_USSD_CANCEL: { rv = eos_modem_take(1000); if (rv) return; @@ -43,8 +46,8 @@ void eos_cell_ussd_handler(unsigned char mtype, unsigned char *buffer, uint16_t eos_modem_give(); break; + } } - } static void ussd_reply_handler(char *urc, regmatch_t m[]) { -- cgit v1.2.3