Skip to content

Commit 8eff369

Browse files
RobMeadesadbridge
authored andcommitted
Fix cellular APN_db.h lookup.
1 parent d4a81f5 commit 8eff369

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
@@ -558,18 +558,12 @@ nsapi_error_t PPPCellularInterface::connect()
558558
nsapi_error_t retcode;
559559
bool success;
560560
bool did_init = false;
561+
const char *apn_config = NULL;
561562

562563
if (dev_info.ppp_connection_up) {
563564
return NSAPI_ERROR_IS_CONNECTED;
564565
}
565566

566-
const char *apn_config = NULL;
567-
#if MBED_CONF_PPP_CELL_IFACE_APN_LOOKUP
568-
if (!set_credentials_api_used) {
569-
apn_config = apnconfig(dev_info.imsi);
570-
}
571-
#endif
572-
573567
do {
574568
retry_init:
575569

@@ -604,6 +598,12 @@ nsapi_error_t PPPCellularInterface::connect()
604598
return NSAPI_ERROR_NO_CONNECTION;
605599
}
606600

601+
#if MBED_CONF_PPP_CELL_IFACE_APN_LOOKUP
602+
if (!apn_config) {
603+
apn_config = apnconfig(dev_info.imsi);
604+
}
605+
#endif
606+
607607
/* Check if user want skip SIM pin checking on boot up */
608608
if (set_sim_pin_check_request) {
609609
retcode = do_sim_pin_check(_at, _pin);
@@ -629,6 +629,7 @@ nsapi_error_t PPPCellularInterface::connect()
629629
_apn = _APN_GET(apn_config);
630630
_uname = _APN_GET(apn_config);
631631
_pwd = _APN_GET(apn_config);
632+
tr_info("Looked up APN %s.", _apn);
632633
}
633634
#endif
634635

0 commit comments

Comments
 (0)