Fix default interface selection by using correct macro names.

Code was written using MBED_CONF_DEFAULT_* but the mbed_lib.json file
that created these values is prefixed with "nsapi" and therefore
final macros are MBED_CONF_NSAPI_DEFAULT_*
pull/7245/head
Seppo Takalo 2018-06-18 18:59:43 +03:00
parent 701d49d8eb
commit 412f654c8d
1 changed files with 15 additions and 15 deletions

View File

@ -82,21 +82,21 @@ MBED_WEAK NetworkInterface *NetworkInterface::get_target_default_instance()
* We do not hook up to WifiInterface::get_default_instance() unless * We do not hook up to WifiInterface::get_default_instance() unless
* we have at least an access point name. * we have at least an access point name.
*/ */
#ifdef MBED_CONF_DEFAULT_WIFI_SSID #ifdef MBED_CONF_NSAPI_DEFAULT_WIFI_SSID
WiFiInterface *wifi = WifiInterface::get_default_instance(); WiFiInterface *wifi = WifiInterface::get_default_instance();
if (!wifi) { if (!wifi) {
return NULL; return NULL;
} }
#ifndef MBED_CONF_DEFAULT_WIFI_PASSWORD #ifndef MBED_CONF_NSAPI_DEFAULT_WIFI_PASSWORD
#define MBED_CONF_DEFAULT_WIFI_PASSWORD NULL #define MBED_CONF_NSAPI_DEFAULT_WIFI_PASSWORD NULL
#endif #endif
#ifndef MBED_CONF_DEFAULT_WIFI_SECURITY #ifndef MBED_CONF_NSAPI_DEFAULT_WIFI_SECURITY
#define MBED_CONF_DEFAULT_WIFI_SECURITY NONE #define MBED_CONF_NSAPI_DEFAULT_WIFI_SECURITY NONE
#endif #endif
#define concat_(x,y) x##y #define concat_(x,y) x##y
#define concat(x,y) concat_(x,y) #define concat(x,y) concat_(x,y)
#define SECURITY concat(NSAPI_SECURITY_,MBED_CONF_DEFAULT_WIFI_SECURITY) #define SECURITY concat(NSAPI_SECURITY_,MBED_CONF_NSAPI_DEFAULT_WIFI_SECURITY)
wifi->set_credentials(MBED_CONF_DEFAULT_WIFI_SSID, MBED_CONF_DEFAULT_WIFI_PASSWORD, SECURITY); wifi->set_credentials(MBED_CONF_NSAPI_DEFAULT_WIFI_SSID, MBED_CONF_NSAPI_DEFAULT_WIFI_PASSWORD, SECURITY);
#else #else
return NULL; return NULL;
#endif #endif
@ -116,17 +116,17 @@ MBED_WEAK NetworkInterface *NetworkInterface::get_target_default_instance()
/* CellularBase is expected to attempt to work without any parameters - we /* CellularBase is expected to attempt to work without any parameters - we
* will try, at least. * will try, at least.
*/ */
#ifdef MBED_CONF_DEFAULT_CELLULAR_APN #ifdef MBED_CONF_NSAPI_DEFAULT_CELLULAR_APN
#ifndef MBED_CONF_DEFAULT_CELLULAR_USERNAME #ifndef MBED_CONF_NSAPI_DEFAULT_CELLULAR_USERNAME
#define MBED_CONF_DEFAULT_CELLULAR_USERNAME NULL #define MBED_CONF_NSAPI_DEFAULT_CELLULAR_USERNAME NULL
#endif #endif
#ifndef MBED_CONF_DEFAULT_CELLULAR_PASSWORD #ifndef MBED_CONF_NSAPI_DEFAULT_CELLULAR_PASSWORD
#define MBED_CONF_DEFAULT_CELLULAR_PASSWORD NULL #define MBED_CONF_NSAPI_DEFAULT_CELLULAR_PASSWORD NULL
#endif #endif
cellular->set_credentials(MBED_CONF_DEFAULT_CELLULAR_APN, MBED_CONF_DEFAULT_CELLULAR_USERNAME, MBED_CONF_DEFAULT_CELLULAR_PASSWORD); cellular->set_credentials(MBED_CONF_NSAPI_DEFAULT_CELLULAR_APN, MBED_CONF_NSAPI_DEFAULT_CELLULAR_USERNAME, MBED_CONF_NSAPI_DEFAULT_CELLULAR_PASSWORD);
#endif #endif
#ifdef MBED_CONF_DEFAULT_CELLULAR_SIM_PIN #ifdef MBED_CONF_NSAPI_DEFAULT_CELLULAR_SIM_PIN
cellular->set_sim_pin(MBED_CONF_DEFAULT_CELLULAR_SIM_PIN); cellular->set_sim_pin(MBED_CONF_NSAPI_DEFAULT_CELLULAR_SIM_PIN);
#endif #endif
return cellular; return cellular;