summaryrefslogtreecommitdiff
path: root/fw/esp32/components/eos/cell_ussd.c
diff options
context:
space:
mode:
Diffstat (limited to 'fw/esp32/components/eos/cell_ussd.c')
-rw-r--r--fw/esp32/components/eos/cell_ussd.c13
1 files changed, 9 insertions, 4 deletions
diff --git a/fw/esp32/components/eos/cell_ussd.c b/fw/esp32/components/eos/cell_ussd.c
index 375025f..fb77b67 100644
--- a/fw/esp32/components/eos/cell_ussd.c
+++ b/fw/esp32/components/eos/cell_ussd.c
@@ -9,7 +9,7 @@
#include "at_cmd.h"
#include "cell.h"
-static const char *TAG = "EOS USSD";
+static const char *TAG = "EOS CELL USSD";
extern char *at_cmd_buf;
@@ -64,7 +64,8 @@ static void ussd_reply_handler(char *urc, regmatch_t m[]) {
len = 2;
if (m[2].rm_so == -1) {
- eos_net_send(EOS_NET_MTYPE_CELL, buf, len);
+ rv = eos_net_send(EOS_NET_MTYPE_CELL, buf, len);
+ if (rv) ESP_LOGE(TAG, "NET SEND ERR:%d", rv);
return;
}
@@ -101,9 +102,13 @@ static void ussd_reply_handler(char *urc, regmatch_t m[]) {
return;
}
- eos_net_send(EOS_NET_MTYPE_CELL, buf, len);
+ rv = eos_net_send(EOS_NET_MTYPE_CELL, buf, len);
+ if (rv) ESP_LOGE(TAG, "NET SEND ERR:%d", rv);
}
void eos_cell_ussd_init(void) {
- at_urc_insert("^\\+CUSD: ([0-9])(,\".*)?", ussd_reply_handler, REG_EXTENDED);
+ int rv;
+
+ rv = at_urc_insert("^\\+CUSD: ([0-9])(,\".*)?", ussd_reply_handler, REG_EXTENDED);
+ assert(rv == EOS_OK);
}