Skip to content

Commit bce900d

Browse files
committed
Fix cellular APN_db.h lookup.
1 parent 4978a08 commit bce900d

File tree

1 file changed

+8
-7
lines changed

1 file changed

+8
-7
lines changed

features/netsocket/cellular/generic_modem_driver/PPPCellularInterface.cpp

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -540,18 +540,12 @@ nsapi_error_t PPPCellularInterface::connect()
540540
nsapi_error_t retcode;
541541
bool success;
542542
bool did_init = false;
543+
const char *apn_config = NULL;
543544

544545
if (dev_info.ppp_connection_up) {
545546
return NSAPI_ERROR_IS_CONNECTED;
546547
}
547548

548-
const char *apn_config = NULL;
549-
#if MBED_CONF_PPP_CELL_IFACE_APN_LOOKUP
550-
if (!set_credentials_api_used) {
551-
apn_config = apnconfig(dev_info.imsi);
552-
}
553-
#endif
554-
555549
do {
556550
retry_init:
557551

@@ -586,6 +580,12 @@ nsapi_error_t PPPCellularInterface::connect()
586580
return NSAPI_ERROR_NO_CONNECTION;
587581
}
588582

583+
#if MBED_CONF_PPP_CELL_IFACE_APN_LOOKUP
584+
if (!apn_config) {
585+
apn_config = apnconfig(dev_info.imsi);
586+
}
587+
#endif
588+
589589
/* Check if user want skip SIM pin checking on boot up */
590590
if (set_sim_pin_check_request) {
591591
retcode = do_sim_pin_check(_at, _pin);
@@ -611,6 +611,7 @@ nsapi_error_t PPPCellularInterface::connect()
611611
_apn = _APN_GET(apn_config);
612612
_uname = _APN_GET(apn_config);
613613
_pwd = _APN_GET(apn_config);
614+
tr_info("Looked up APN %s.", _apn);
614615
}
615616
#endif
616617

0 commit comments

Comments
 (0)