Merge pull request #5016 from u-blox/apndb_fix

Fix cellular APN_db.h lookup.
pull/5205/merge
Jimmy Brisson 2017-09-27 09:06:46 -05:00 committed by GitHub
commit 908a05b231
1 changed files with 8 additions and 7 deletions

View File

@ -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