From 3af816f20b94326b05a6dde21d7f734df14b61d3 Mon Sep 17 00:00:00 2001 From: Uros Majstorovic Date: Fri, 7 Aug 2020 19:26:12 +0200 Subject: net driver: removed obsolete flags; urc process simplefied; pcm: added active flag; tested cell voice/data --- fw/esp32/components/eos/cell_data.c | 23 +++++++++++++++++------ 1 file changed, 17 insertions(+), 6 deletions(-) (limited to 'fw/esp32/components/eos/cell_data.c') 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 +#include #include @@ -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; + } } -- cgit v1.2.3