mirror of https://github.com/ARMmbed/mbed-os.git
Added use_apn_lookup in mbed_lib.json
parent
164e8fb717
commit
6c6223ae25
|
@ -28,9 +28,9 @@
|
|||
#include "EasyCellularConnection.h"
|
||||
#include "CellularLog.h"
|
||||
|
||||
#if MBED_CONF_APP_CELLULAR_USE_APN_LOOKUP || MBED_CONF_PPP_CELL_IFACE_APN_LOOKUP
|
||||
#if MBED_CONF_CELLULAR_USE_APN_LOOKUP || MBED_CONF_PPP_CELL_IFACE_APN_LOOKUP
|
||||
#include "APN_db.h"
|
||||
#endif //MBED_CONF_APP_CELLULAR_USE_APN_LOOKUP || MBED_CONF_PPP_CELL_IFACE_APN_LOOKUP
|
||||
#endif //MBED_CONF_CELLULAR_USE_APN_LOOKUP || MBED_CONF_PPP_CELL_IFACE_APN_LOOKUP
|
||||
|
||||
namespace mbed
|
||||
{
|
||||
|
@ -57,9 +57,9 @@ EasyCellularConnection::EasyCellularConnection() : _is_connected(false), _is_in
|
|||
_cellularSerial(MDMTXD, MDMRXD, MBED_CONF_PLATFORM_DEFAULT_SERIAL_BAUD_RATE),
|
||||
_cellularSemaphore(0), _cellularConnectionUtil(), _credentials_err(NSAPI_ERROR_OK)
|
||||
{
|
||||
#if MBED_CONF_APP_CELLULAR_USE_APN_LOOKUP || MBED_CONF_PPP_CELL_IFACE_APN_LOOKUP
|
||||
#if MBED_CONF_CELLULAR_USE_APN_LOOKUP || MBED_CONF_PPP_CELL_IFACE_APN_LOOKUP
|
||||
_credentials_set = false;
|
||||
#endif // #if MBED_CONF_APP_CELLULAR_USE_APN_LOOKUP || MBED_CONF_PPP_CELL_IFACE_APN_LOOKUP
|
||||
#endif // #if MBED_CONF_CELLULAR_USE_APN_LOOKUP || MBED_CONF_PPP_CELL_IFACE_APN_LOOKUP
|
||||
tr_info("EasyCellularConnection()");
|
||||
}
|
||||
|
||||
|
@ -100,11 +100,11 @@ void EasyCellularConnection::set_credentials(const char *apn, const char *uname,
|
|||
CellularNetwork * network = _cellularConnectionUtil.get_network();
|
||||
if (network) {
|
||||
_credentials_err = network->set_credentials(apn, uname, pwd);
|
||||
#if MBED_CONF_APP_CELLULAR_USE_APN_LOOKUP || MBED_CONF_PPP_CELL_IFACE_APN_LOOKUP
|
||||
#if MBED_CONF_CELLULAR_USE_APN_LOOKUP || MBED_CONF_PPP_CELL_IFACE_APN_LOOKUP
|
||||
if (_credentials_err == NSAPI_ERROR_OK) {
|
||||
_credentials_set = true;
|
||||
}
|
||||
#endif // #if MBED_CONF_APP_CELLULAR_USE_APN_LOOKUP || MBED_CONF_PPP_CELL_IFACE_APN_LOOKUP
|
||||
#endif // #if MBED_CONF_CELLULAR_USE_APN_LOOKUP || MBED_CONF_PPP_CELL_IFACE_APN_LOOKUP
|
||||
} else {
|
||||
tr_error("NO Network...");
|
||||
}
|
||||
|
@ -161,7 +161,7 @@ nsapi_error_t EasyCellularConnection::connect()
|
|||
if (err) {
|
||||
return err;
|
||||
}
|
||||
#if MBED_CONF_APP_CELLULAR_USE_APN_LOOKUP || MBED_CONF_PPP_CELL_IFACE_APN_LOOKUP
|
||||
#if MBED_CONF_CELLULAR_USE_APN_LOOKUP || MBED_CONF_PPP_CELL_IFACE_APN_LOOKUP
|
||||
if (!_credentials_set) {
|
||||
_target_state = CellularConnectionUtil::STATE_SIM_PIN;
|
||||
err = _cellularConnectionUtil.continue_to_state(_target_state);
|
||||
|
@ -189,7 +189,7 @@ nsapi_error_t EasyCellularConnection::connect()
|
|||
return err;
|
||||
}
|
||||
}
|
||||
#endif // MBED_CONF_APP_CELLULAR_USE_APN_LOOKUP || MBED_CONF_PPP_CELL_IFACE_APN_LOOKUP
|
||||
#endif // MBED_CONF_CELLULAR_USE_APN_LOOKUP || MBED_CONF_PPP_CELL_IFACE_APN_LOOKUP
|
||||
|
||||
_target_state = CellularConnectionUtil::STATE_CONNECTED;
|
||||
err = _cellularConnectionUtil.continue_to_state(_target_state);
|
||||
|
@ -208,9 +208,9 @@ nsapi_error_t EasyCellularConnection::disconnect()
|
|||
{
|
||||
_credentials_err = NSAPI_ERROR_OK;
|
||||
_is_connected = false;
|
||||
#if MBED_CONF_APP_CELLULAR_USE_APN_LOOKUP || MBED_CONF_PPP_CELL_IFACE_APN_LOOKUP
|
||||
#if MBED_CONF_CELLULAR_USE_APN_LOOKUP || MBED_CONF_PPP_CELL_IFACE_APN_LOOKUP
|
||||
_credentials_set = false;
|
||||
#endif // #if MBED_CONF_APP_CELLULAR_USE_APN_LOOKUP || MBED_CONF_PPP_CELL_IFACE_APN_LOOKUP
|
||||
#endif // #if MBED_CONF_CELLULAR_USE_APN_LOOKUP || MBED_CONF_PPP_CELL_IFACE_APN_LOOKUP
|
||||
if (!_cellularConnectionUtil.get_network()) {
|
||||
return NSAPI_ERROR_NO_CONNECTION;
|
||||
}
|
||||
|
|
|
@ -144,9 +144,9 @@ private:
|
|||
|
||||
bool _is_connected;
|
||||
bool _is_initialized;
|
||||
#if MBED_CONF_APP_CELLULAR_USE_APN_LOOKUP || MBED_CONF_PPP_CELL_IFACE_APN_LOOKUP
|
||||
#if MBED_CONF_CELLULAR_USE_APN_LOOKUP || MBED_CONF_PPP_CELL_IFACE_APN_LOOKUP
|
||||
bool _credentials_set;
|
||||
#endif // #if MBED_CONF_APP_CELLULAR_USE_APN_LOOKUP || MBED_CONF_PPP_CELL_IFACE_APN_LOOKUP
|
||||
#endif // #if MBED_CONF_CELLULAR_USE_APN_LOOKUP || MBED_CONF_PPP_CELL_IFACE_APN_LOOKUP
|
||||
CellularConnectionUtil::CellularState _target_state;
|
||||
|
||||
UARTSerial _cellularSerial;
|
||||
|
|
|
@ -0,0 +1,9 @@
|
|||
{
|
||||
"name": "cellular",
|
||||
"config": {
|
||||
"use_apn_lookup": {
|
||||
"help": "Use APN database lookup",
|
||||
"value": true
|
||||
}
|
||||
}
|
||||
}
|
Loading…
Reference in New Issue