Merge pull request #7245 from SeppoTakalo/fix-default-interface

Fix default interface selection by using correct macro names.
pull/7263/head
Cruz Monrreal 2018-06-19 08:46:28 -05:00 committed by GitHub
commit 2bb686ff1e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 17 additions and 16 deletions

View File

@ -82,21 +82,22 @@ 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);
return wifi;
#else #else
return NULL; return NULL;
#endif #endif
@ -116,17 +117,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;