Skip to content

Commit d03a1fa

Browse files
author
Seppo Takalo
committed
Allow ESP8266 to provide default WifiInterface
ESP can be se to be default interface for the build by setting "esp8266.provide-default": true, in mbed_app.json
1 parent 5a88ff9 commit d03a1fa

File tree

2 files changed

+13
-0
lines changed

2 files changed

+13
-0
lines changed

ESP8266Interface.cpp

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -575,3 +575,12 @@ nsapi_connection_status_t ESP8266Interface::get_connection_status() const
575575
{
576576
return _esp.get_connection_status();
577577
}
578+
579+
#if MBED_CONF_ESP8266_PROVIDE_DEFAULT
580+
581+
WiFiInterface *WiFiInterface::get_default_instance() {
582+
static ESP8266Interface esp();
583+
return &esp;
584+
}
585+
586+
#endif

mbed_lib.json

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,10 @@
1212
"debug": {
1313
"help": "Enable debug logs",
1414
"value": false
15+
},
16+
"provide-default": {
17+
"help": "Provide default WifiInterface. [true/false]",
18+
"value": false
1519
}
1620
},
1721
"target_overrides": {

0 commit comments

Comments
 (0)