Skip to content

Commit ed2bb74

Browse files
author
Veijo Pesonen
committed
Fixes includes
1 parent 9bcf9ab commit ed2bb74

File tree

4 files changed

+36
-26
lines changed

4 files changed

+36
-26
lines changed

ESP8266/ESP8266.cpp

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -14,20 +14,23 @@
1414
* limitations under the License.
1515
*/
1616

17+
#include <string.h>
18+
#include <stdint.h>
19+
1720
#include "ESP8266.h"
18-
#include "Callback.h"
19-
#include "mbed_error.h"
21+
#include "features/netsocket/nsapi_types.h"
2022
#include "mbed_trace.h"
21-
#include "nsapi_types.h"
2223
#include "PinNames.h"
24+
#include "platform/Callback.h"
25+
#include "platform/mbed_error.h"
2326

2427
#define TRACE_GROUP "ESPA" // ESP8266 AT layer
2528

26-
#include <cstring>
27-
2829
#define ESP8266_DEFAULT_BAUD_RATE 115200
2930
#define ESP8266_ALL_SOCKET_IDS -1
3031

32+
using namespace mbed;
33+
3134
ESP8266::ESP8266(PinName tx, PinName rx, bool debug, PinName rts, PinName cts)
3235
: _sdk_v(-1, -1, -1),
3336
_at_v(-1, -1, -1),

ESP8266/ESP8266.h

Lines changed: 15 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -17,11 +17,16 @@
1717
#ifndef ESP8266_H
1818
#define ESP8266_H
1919

20-
#include "ATCmdParser.h"
21-
#include "Mutex.h"
22-
#include "nsapi_types.h"
23-
#include "rtos.h"
20+
#include <stdint.h>
21+
22+
#include "rtos/Mutex.h"
2423
#include "drivers/UARTSerial.h"
24+
#include "platform/ATCmdParser.h"
25+
#include "platform/Callback.h"
26+
#include "platform/mbed_error.h"
27+
#include "features/netsocket/nsapi_types.h"
28+
#include "features/netsocket/WiFiAccessPoint.h"
29+
#include "PinNames.h"
2530

2631
// Various timeouts for different ESP8266 operations
2732
#ifndef ESP8266_CONNECT_TIMEOUT
@@ -281,7 +286,7 @@ class ESP8266 {
281286
*
282287
* @param func A pointer to a void function, or 0 to set as none
283288
*/
284-
void sigio(Callback<void()> func);
289+
void sigio(mbed::Callback<void()> func);
285290

286291
/**
287292
* Attach a function to call whenever sigio happens in the serial
@@ -292,7 +297,7 @@ class ESP8266 {
292297
template <typename T, typename M>
293298
void sigio(T *obj, M method)
294299
{
295-
sigio(Callback<void()>(obj, method));
300+
sigio(mbed::Callback<void()>(obj, method));
296301
}
297302

298303
/**
@@ -368,13 +373,13 @@ class ESP8266 {
368373
int32_t _recv_tcp_passive(int id, void *data, uint32_t amount, uint32_t timeout);
369374

370375
// UART settings
371-
UARTSerial _serial;
376+
mbed::UARTSerial _serial;
372377
PinName _serial_rts;
373378
PinName _serial_cts;
374-
Mutex _smutex; // Protect serial port access
379+
rtos::Mutex _smutex; // Protect serial port access
375380

376381
// AT Command Parser
377-
ATCmdParser _parser;
382+
mbed::ATCmdParser _parser;
378383

379384
// Wifi scan result handling
380385
bool _recv_ap(nsapi_wifi_ap_t *ap);
@@ -432,7 +437,7 @@ class ESP8266 {
432437

433438
// Connection state reporting
434439
nsapi_connection_status_t _conn_status;
435-
Callback<void()> _conn_stat_cb; // ESP8266Interface registered
440+
mbed::Callback<void()> _conn_stat_cb; // ESP8266Interface registered
436441
};
437442

438443
#endif

ESP8266Interface.cpp

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -14,15 +14,17 @@
1414
* limitations under the License.
1515
*/
1616

17-
#include <cstring>
18-
#include "events/EventQueue.h"
19-
#include "events/mbed_shared_queues.h"
20-
#include "platform/Callback.h"
17+
#include <string.h>
18+
#include <stdint.h>
19+
2120
#include "ESP8266.h"
2221
#include "ESP8266Interface.h"
23-
#include "mbed_debug.h"
22+
#include "events/EventQueue.h"
23+
#include "events/mbed_shared_queues.h"
24+
#include "features/netsocket/nsapi_types.h"
2425
#include "mbed_trace.h"
25-
#include "nsapi_types.h"
26+
#include "platform/Callback.h"
27+
#include "platform/mbed_debug.h"
2628

2729
#ifndef MBED_CONF_ESP8266_DEBUG
2830
#define MBED_CONF_ESP8266_DEBUG false

ESP8266Interface.h

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -22,11 +22,11 @@
2222
#include "events/EventQueue.h"
2323
#include "events/mbed_shared_queues.h"
2424
#include "platform/Callback.h"
25-
#include "netsocket/nsapi_types.h"
26-
#include "netsocket/NetworkInterface.h"
27-
#include "netsocket/NetworkStack.h"
28-
#include "netsocket/WiFiAccessPoint.h"
29-
#include "netsocket/WiFiInterface.h"
25+
#include "features/netsocket/nsapi_types.h"
26+
#include "features/netsocket/NetworkInterface.h"
27+
#include "features/netsocket/NetworkStack.h"
28+
#include "features/netsocket/WiFiAccessPoint.h"
29+
#include "features/netsocket/WiFiInterface.h"
3030

3131
#include "ESP8266.h"
3232

0 commit comments

Comments
 (0)