Skip to content

Commit cc40280

Browse files
tymoteuszblochmobicaadbridge
authored andcommitted
Member get_interface_name implemented in ESP8266Interface
1 parent e1f52ad commit cc40280

File tree

2 files changed

+15
-0
lines changed

2 files changed

+15
-0
lines changed

components/wifi/esp8266-driver/ESP8266Interface.cpp

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,8 @@
5252

5353
#define TRACE_GROUP "ESPI" // ESP8266 Interface
5454

55+
#define ESP8266_WIFI_IF_NAME "es0"
56+
5557
using namespace mbed;
5658
using namespace rtos;
5759

@@ -413,6 +415,12 @@ const char *ESP8266Interface::get_netmask()
413415
return _conn_stat != NSAPI_STATUS_DISCONNECTED ? _esp.netmask() : NULL;
414416
}
415417

418+
char *ESP8266Interface::get_interface_name(char *interface_name)
419+
{
420+
memcpy(interface_name, ESP8266_WIFI_IF_NAME, sizeof(ESP8266_WIFI_IF_NAME));
421+
return interface_name;
422+
}
423+
416424
int8_t ESP8266Interface::get_rssi()
417425
{
418426
return _esp.rssi();

components/wifi/esp8266-driver/ESP8266Interface.h

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -158,6 +158,13 @@ class ESP8266Interface : public NetworkStack, public WiFiInterface {
158158
*/
159159
virtual const char *get_netmask();
160160

161+
/** Get the network interface name
162+
*
163+
* @return Null-terminated representation of the network interface name
164+
* or null if interface not exists
165+
*/
166+
virtual char *get_interface_name(char *interface_name);
167+
161168
/** Gets the current radio signal strength for active connection
162169
*
163170
* @return Connection strength in dBm (negative value)

0 commit comments

Comments
 (0)