diff options
Diffstat (limited to 'fw/esp32/components/eos/cell_ussd.c')
-rw-r--r-- | fw/esp32/components/eos/cell_ussd.c | 9 |
1 files changed, 6 insertions, 3 deletions
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[]) { |