Skip to content

Commit 1a84cd5

Browse files
Chris SnowChris Snow
authored andcommitted
Resolve header issues
1 parent dac35fd commit 1a84cd5

File tree

5 files changed

+12
-25
lines changed

5 files changed

+12
-25
lines changed

connectivity/drivers/wifi/COMPONENT_ESPRESSIF_ESP32/ESP32/ESP32.h

Lines changed: 1 addition & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -19,26 +19,13 @@
1919
#define ESP32_H
2020

2121
#if DEVICE_SERIAL && defined(MBED_CONF_EVENTS_PRESENT) && defined(MBED_CONF_NSAPI_PRESENT) && defined(MBED_CONF_RTOS_PRESENT)
22-
#include <vector>
23-
#include <stdint.h>
24-
#include <stdlib.h>
22+
2523
#include "drivers/DigitalOut.h"
26-
#include "drivers/SerialBase.h"
2724
#include "netsocket/nsapi_types.h"
2825
#include "netsocket/WiFiAccessPoint.h"
29-
#include "PinNames.h"
3026
#include "platform/ATCmdParser.h"
31-
#include "platform/Callback.h"
32-
#include "platform/mbed_error.h"
33-
#include "platform/mbed_version.h"
34-
#include "rtos/Mutex.h"
3527
#include "rtos/ThisThread.h"
36-
37-
#if (MBED_MAJOR_VERSION < 6)
38-
#include "drivers/UARTSerial.h"
39-
#else
4028
#include "drivers/BufferedSerial.h"
41-
#endif
4229

4330
#ifndef ESP32_CONNECT_TIMEOUT
4431
#define ESP32_CONNECT_TIMEOUT 15000
@@ -275,11 +262,7 @@ class ESP32
275262
mbed::DigitalOut * _p_wifi_io0;
276263
bool _init_end_common;
277264
bool _init_end_wifi;
278-
#if (MBED_MAJOR_VERSION < 6)
279-
mbed::UARTSerial _serial;
280-
#else
281265
mbed::BufferedSerial _serial;
282-
#endif
283266
mbed::ATCmdParser _parser;
284267
struct packet {
285268
struct packet *next;

connectivity/drivers/wifi/COMPONENT_ESPRESSIF_ESP32/ESP32Interface.cpp

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,8 @@
1717
#include <string.h>
1818
#include "ESP32Interface.h"
1919

20+
using namespace std::chrono_literals;
21+
2022
// ESP32Interface implementation
2123
ESP32Interface::ESP32Interface() :
2224
ESP32Stack(MBED_CONF_ESP32_WIFI_EN, MBED_CONF_ESP32_WIFI_IO0, MBED_CONF_ESP32_WIFI_TX, MBED_CONF_ESP32_WIFI_RX, MBED_CONF_ESP32_WIFI_DEBUG,
@@ -34,7 +36,7 @@ ESP32Interface::ESP32Interface() :
3436
_connection_status_cb(NULL)
3537
{
3638
memset(_ap_ssid, 0, sizeof(_ap_ssid));
37-
_esp->attach_wifi_status(callback(this, &ESP32Interface::wifi_status_cb));
39+
_esp->attach_wifi_status(mbed::callback(this, &ESP32Interface::wifi_status_cb));
3840
}
3941

4042
ESP32Interface::ESP32Interface(PinName en, PinName io0, PinName tx, PinName rx, bool debug,
@@ -53,7 +55,7 @@ ESP32Interface::ESP32Interface(PinName en, PinName io0, PinName tx, PinName rx,
5355
_connection_status_cb(NULL)
5456
{
5557
memset(_ap_ssid, 0, sizeof(_ap_ssid));
56-
_esp->attach_wifi_status(callback(this, &ESP32Interface::wifi_status_cb));
58+
_esp->attach_wifi_status(mbed::callback(this, &ESP32Interface::wifi_status_cb));
5759
}
5860

5961
ESP32Interface::ESP32Interface(PinName tx, PinName rx, bool debug) :
@@ -71,7 +73,7 @@ ESP32Interface::ESP32Interface(PinName tx, PinName rx, bool debug) :
7173
_connection_status_cb(NULL)
7274
{
7375
memset(_ap_ssid, 0, sizeof(_ap_ssid));
74-
_esp->attach_wifi_status(callback(this, &ESP32Interface::wifi_status_cb));
76+
_esp->attach_wifi_status(mbed::callback(this, &ESP32Interface::wifi_status_cb));
7577
}
7678

7779
nsapi_error_t ESP32Interface::set_network(const SocketAddress &ip_address, const SocketAddress &netmask, const SocketAddress &gateway)

connectivity/drivers/wifi/COMPONENT_ESPRESSIF_ESP32/ESP32Interface.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,6 @@
1717
#ifndef ESP32_INTERFACE_H
1818
#define ESP32_INTERFACE_H
1919

20-
#include "mbed.h"
2120
#include "ESP32Stack.h"
2221

2322
/** ESP32Interface class

connectivity/drivers/wifi/COMPONENT_ESPRESSIF_ESP32/ESP32InterfaceAP.h

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,6 @@
1717
#ifndef ESP32_INTERFACE_AP_H
1818
#define ESP32_INTERFACE_AP_H
1919

20-
#include "mbed.h"
2120
#include "ESP32Stack.h"
2221

2322

@@ -253,7 +252,7 @@ class ESP32InterfaceAP : public ESP32Stack, public WiFiInterface
253252
SocketAddress _netmask;
254253
SocketAddress _gateway;
255254
nsapi_connection_status_t _connection_status;
256-
Callback<void(nsapi_event_t, intptr_t)> _connection_status_cb;
255+
mbed::Callback<void(nsapi_event_t, intptr_t)> _connection_status_cb;
257256
};
258257

259258
#endif

connectivity/drivers/wifi/COMPONENT_ESPRESSIF_ESP32/ESP32Stack.h

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,8 +18,12 @@
1818
#ifndef ESP32_STACK_H
1919
#define ESP32_STACK_H
2020

21-
#include "mbed.h"
21+
2222
#include "ESP32.h"
23+
#include "netsocket/NetworkInterface.h"
24+
#include "netsocket/NetworkStack.h"
25+
#include "netsocket/nsapi_types.h"
26+
#include "netsocket/WiFiInterface.h"
2327

2428
/** ESP32Stack class
2529
* Implementation of the NetworkStack for the ESP32

0 commit comments

Comments
 (0)