Skip to content

Commit 8424bec

Browse files
author
Seppo Takalo
authored
Merge pull request #78 from ARMmbed/default_interface
Allow ESP8266 to provide default WifiInterface
2 parents 5a88ff9 + d03a1fa commit 8424bec

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)