From 8eff3699019f708ed74984a742cdde6ac863502a Mon Sep 17 00:00:00 2001 From: Rob Meades Date: Mon, 4 Sep 2017 14:46:59 +0100 Subject: [PATCH] Fix cellular APN_db.h lookup. --- .../generic_modem_driver/PPPCellularInterface.cpp | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/features/netsocket/cellular/generic_modem_driver/PPPCellularInterface.cpp b/features/netsocket/cellular/generic_modem_driver/PPPCellularInterface.cpp index f87864626f..22d9a19320 100644 --- a/features/netsocket/cellular/generic_modem_driver/PPPCellularInterface.cpp +++ b/features/netsocket/cellular/generic_modem_driver/PPPCellularInterface.cpp @@ -558,18 +558,12 @@ nsapi_error_t PPPCellularInterface::connect() nsapi_error_t retcode; bool success; bool did_init = false; + const char *apn_config = NULL; if (dev_info.ppp_connection_up) { return NSAPI_ERROR_IS_CONNECTED; } - const char *apn_config = NULL; -#if MBED_CONF_PPP_CELL_IFACE_APN_LOOKUP - if (!set_credentials_api_used) { - apn_config = apnconfig(dev_info.imsi); - } -#endif - do { retry_init: @@ -604,6 +598,12 @@ nsapi_error_t PPPCellularInterface::connect() return NSAPI_ERROR_NO_CONNECTION; } +#if MBED_CONF_PPP_CELL_IFACE_APN_LOOKUP + if (!apn_config) { + apn_config = apnconfig(dev_info.imsi); + } +#endif + /* Check if user want skip SIM pin checking on boot up */ if (set_sim_pin_check_request) { retcode = do_sim_pin_check(_at, _pin); @@ -629,6 +629,7 @@ nsapi_error_t PPPCellularInterface::connect() _apn = _APN_GET(apn_config); _uname = _APN_GET(apn_config); _pwd = _APN_GET(apn_config); + tr_info("Looked up APN %s.", _apn); } #endif