Skip to content

Commit 412f654

Browse files
author
Seppo Takalo
committed
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_*
1 parent 701d49d commit 412f654

File tree

1 file changed

+15
-15
lines changed

1 file changed

+15
-15
lines changed

features/netsocket/NetworkInterfaceDefaults.cpp

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -82,21 +82,21 @@ MBED_WEAK NetworkInterface *NetworkInterface::get_target_default_instance()
8282
* We do not hook up to WifiInterface::get_default_instance() unless
8383
* we have at least an access point name.
8484
*/
85-
#ifdef MBED_CONF_DEFAULT_WIFI_SSID
85+
#ifdef MBED_CONF_NSAPI_DEFAULT_WIFI_SSID
8686
WiFiInterface *wifi = WifiInterface::get_default_instance();
8787
if (!wifi) {
8888
return NULL;
8989
}
90-
#ifndef MBED_CONF_DEFAULT_WIFI_PASSWORD
91-
#define MBED_CONF_DEFAULT_WIFI_PASSWORD NULL
90+
#ifndef MBED_CONF_NSAPI_DEFAULT_WIFI_PASSWORD
91+
#define MBED_CONF_NSAPI_DEFAULT_WIFI_PASSWORD NULL
9292
#endif
93-
#ifndef MBED_CONF_DEFAULT_WIFI_SECURITY
94-
#define MBED_CONF_DEFAULT_WIFI_SECURITY NONE
93+
#ifndef MBED_CONF_NSAPI_DEFAULT_WIFI_SECURITY
94+
#define MBED_CONF_NSAPI_DEFAULT_WIFI_SECURITY NONE
9595
#endif
9696
#define concat_(x,y) x##y
9797
#define concat(x,y) concat_(x,y)
98-
#define SECURITY concat(NSAPI_SECURITY_,MBED_CONF_DEFAULT_WIFI_SECURITY)
99-
wifi->set_credentials(MBED_CONF_DEFAULT_WIFI_SSID, MBED_CONF_DEFAULT_WIFI_PASSWORD, SECURITY);
98+
#define SECURITY concat(NSAPI_SECURITY_,MBED_CONF_NSAPI_DEFAULT_WIFI_SECURITY)
99+
wifi->set_credentials(MBED_CONF_NSAPI_DEFAULT_WIFI_SSID, MBED_CONF_NSAPI_DEFAULT_WIFI_PASSWORD, SECURITY);
100100
#else
101101
return NULL;
102102
#endif
@@ -116,17 +116,17 @@ MBED_WEAK NetworkInterface *NetworkInterface::get_target_default_instance()
116116
/* CellularBase is expected to attempt to work without any parameters - we
117117
* will try, at least.
118118
*/
119-
#ifdef MBED_CONF_DEFAULT_CELLULAR_APN
120-
#ifndef MBED_CONF_DEFAULT_CELLULAR_USERNAME
121-
#define MBED_CONF_DEFAULT_CELLULAR_USERNAME NULL
119+
#ifdef MBED_CONF_NSAPI_DEFAULT_CELLULAR_APN
120+
#ifndef MBED_CONF_NSAPI_DEFAULT_CELLULAR_USERNAME
121+
#define MBED_CONF_NSAPI_DEFAULT_CELLULAR_USERNAME NULL
122122
#endif
123-
#ifndef MBED_CONF_DEFAULT_CELLULAR_PASSWORD
124-
#define MBED_CONF_DEFAULT_CELLULAR_PASSWORD NULL
123+
#ifndef MBED_CONF_NSAPI_DEFAULT_CELLULAR_PASSWORD
124+
#define MBED_CONF_NSAPI_DEFAULT_CELLULAR_PASSWORD NULL
125125
#endif
126-
cellular->set_credentials(MBED_CONF_DEFAULT_CELLULAR_APN, MBED_CONF_DEFAULT_CELLULAR_USERNAME, MBED_CONF_DEFAULT_CELLULAR_PASSWORD);
126+
cellular->set_credentials(MBED_CONF_NSAPI_DEFAULT_CELLULAR_APN, MBED_CONF_NSAPI_DEFAULT_CELLULAR_USERNAME, MBED_CONF_NSAPI_DEFAULT_CELLULAR_PASSWORD);
127127
#endif
128-
#ifdef MBED_CONF_DEFAULT_CELLULAR_SIM_PIN
129-
cellular->set_sim_pin(MBED_CONF_DEFAULT_CELLULAR_SIM_PIN);
128+
#ifdef MBED_CONF_NSAPI_DEFAULT_CELLULAR_SIM_PIN
129+
cellular->set_sim_pin(MBED_CONF_NSAPI_DEFAULT_CELLULAR_SIM_PIN);
130130
#endif
131131

132132
return cellular;

0 commit comments

Comments
 (0)