diff options
author | Uros Majstorovic <majstor@majstor.org> | 2020-08-07 19:26:12 +0200 |
---|---|---|
committer | Uros Majstorovic <majstor@majstor.org> | 2020-08-07 19:26:12 +0200 |
commit | 3af816f20b94326b05a6dde21d7f734df14b61d3 (patch) | |
tree | a4bbdb6e22c670b7231d9d909dc6b75fe9c5433e /fw/esp32/components/eos/cell_data.c | |
parent | a35636fc4a55e6b0cfbb5772f7274ee749059836 (diff) |
net driver: removed obsolete flags; urc process simplefied; pcm: added active flag; tested cell voice/data
Diffstat (limited to 'fw/esp32/components/eos/cell_data.c')
-rw-r--r-- | fw/esp32/components/eos/cell_data.c | 23 |
1 files changed, 17 insertions, 6 deletions
diff --git a/fw/esp32/components/eos/cell_data.c b/fw/esp32/components/eos/cell_data.c index 6732346..f9a755f 100644 --- a/fw/esp32/components/eos/cell_data.c +++ b/fw/esp32/components/eos/cell_data.c @@ -1,4 +1,5 @@ #include <stdlib.h> +#include <string.h> #include <esp_log.h> @@ -6,15 +7,25 @@ #include "cell.h" void eos_cell_data_handler(unsigned char mtype, unsigned char *buffer, uint16_t size) { - int rv; - - rv = eos_modem_take(1000); - if (rv) return; + char *apn, *user, *pass; buffer += 1; size -= 1; switch (mtype) { - } + case EOS_CELL_MTYPE_DATA_CONFIGURE: + apn = (char *)buffer; + user = apn + strlen(apn) + 1; + pass = user + strlen(user) + 1; + eos_ppp_set_apn(apn); + eos_ppp_set_auth(user, pass); + break; - eos_modem_give(); + case EOS_CELL_MTYPE_DATA_CONNECT: + eos_ppp_connect(); + break; + + case EOS_CELL_MTYPE_DATA_DISCONNECT: + eos_ppp_disconnect(); + break; + } } |