summaryrefslogtreecommitdiff
path: root/fw/esp32/components/eos/cell_ussd.c
diff options
context:
space:
mode:
authorUros Majstorovic <majstor@majstor.org>2022-09-04 18:43:50 +0200
committerUros Majstorovic <majstor@majstor.org>2022-09-04 18:43:50 +0200
commit6a4b3ef0e72ee134b81a523ce41fd4c45f3b4429 (patch)
treec4cb9b524711238b162511f515d484df4052e3ab /fw/esp32/components/eos/cell_ussd.c
parent03ec4d6158bd3c555b6c60b9e7476740464f19fa (diff)
fixed wifi and cell
Diffstat (limited to 'fw/esp32/components/eos/cell_ussd.c')
-rw-r--r--fw/esp32/components/eos/cell_ussd.c9
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[]) {