From ed2bb74e55e8137dad01cb53605e87923650986e Mon Sep 17 00:00:00 2001 From: Veijo Pesonen Date: Wed, 24 Oct 2018 14:24:53 +0300 Subject: [PATCH] Fixes includes --- ESP8266/ESP8266.cpp | 13 ++++++++----- ESP8266/ESP8266.h | 25 +++++++++++++++---------- ESP8266Interface.cpp | 14 ++++++++------ ESP8266Interface.h | 10 +++++----- 4 files changed, 36 insertions(+), 26 deletions(-) diff --git a/ESP8266/ESP8266.cpp b/ESP8266/ESP8266.cpp index 81c6a95..b6e9f80 100644 --- a/ESP8266/ESP8266.cpp +++ b/ESP8266/ESP8266.cpp @@ -14,20 +14,23 @@ * limitations under the License. */ +#include +#include + #include "ESP8266.h" -#include "Callback.h" -#include "mbed_error.h" +#include "features/netsocket/nsapi_types.h" #include "mbed_trace.h" -#include "nsapi_types.h" #include "PinNames.h" +#include "platform/Callback.h" +#include "platform/mbed_error.h" #define TRACE_GROUP "ESPA" // ESP8266 AT layer -#include - #define ESP8266_DEFAULT_BAUD_RATE 115200 #define ESP8266_ALL_SOCKET_IDS -1 +using namespace mbed; + ESP8266::ESP8266(PinName tx, PinName rx, bool debug, PinName rts, PinName cts) : _sdk_v(-1, -1, -1), _at_v(-1, -1, -1), diff --git a/ESP8266/ESP8266.h b/ESP8266/ESP8266.h index 1fb25e8..d4cd8e3 100644 --- a/ESP8266/ESP8266.h +++ b/ESP8266/ESP8266.h @@ -17,11 +17,16 @@ #ifndef ESP8266_H #define ESP8266_H -#include "ATCmdParser.h" -#include "Mutex.h" -#include "nsapi_types.h" -#include "rtos.h" +#include + +#include "rtos/Mutex.h" #include "drivers/UARTSerial.h" +#include "platform/ATCmdParser.h" +#include "platform/Callback.h" +#include "platform/mbed_error.h" +#include "features/netsocket/nsapi_types.h" +#include "features/netsocket/WiFiAccessPoint.h" +#include "PinNames.h" // Various timeouts for different ESP8266 operations #ifndef ESP8266_CONNECT_TIMEOUT @@ -281,7 +286,7 @@ class ESP8266 { * * @param func A pointer to a void function, or 0 to set as none */ - void sigio(Callback func); + void sigio(mbed::Callback func); /** * Attach a function to call whenever sigio happens in the serial @@ -292,7 +297,7 @@ class ESP8266 { template void sigio(T *obj, M method) { - sigio(Callback(obj, method)); + sigio(mbed::Callback(obj, method)); } /** @@ -368,13 +373,13 @@ class ESP8266 { int32_t _recv_tcp_passive(int id, void *data, uint32_t amount, uint32_t timeout); // UART settings - UARTSerial _serial; + mbed::UARTSerial _serial; PinName _serial_rts; PinName _serial_cts; - Mutex _smutex; // Protect serial port access + rtos::Mutex _smutex; // Protect serial port access // AT Command Parser - ATCmdParser _parser; + mbed::ATCmdParser _parser; // Wifi scan result handling bool _recv_ap(nsapi_wifi_ap_t *ap); @@ -432,7 +437,7 @@ class ESP8266 { // Connection state reporting nsapi_connection_status_t _conn_status; - Callback _conn_stat_cb; // ESP8266Interface registered + mbed::Callback _conn_stat_cb; // ESP8266Interface registered }; #endif diff --git a/ESP8266Interface.cpp b/ESP8266Interface.cpp index e66029e..00399fd 100644 --- a/ESP8266Interface.cpp +++ b/ESP8266Interface.cpp @@ -14,15 +14,17 @@ * limitations under the License. */ -#include -#include "events/EventQueue.h" -#include "events/mbed_shared_queues.h" -#include "platform/Callback.h" +#include +#include + #include "ESP8266.h" #include "ESP8266Interface.h" -#include "mbed_debug.h" +#include "events/EventQueue.h" +#include "events/mbed_shared_queues.h" +#include "features/netsocket/nsapi_types.h" #include "mbed_trace.h" -#include "nsapi_types.h" +#include "platform/Callback.h" +#include "platform/mbed_debug.h" #ifndef MBED_CONF_ESP8266_DEBUG #define MBED_CONF_ESP8266_DEBUG false diff --git a/ESP8266Interface.h b/ESP8266Interface.h index ab0cfd9..c0311c2 100644 --- a/ESP8266Interface.h +++ b/ESP8266Interface.h @@ -22,11 +22,11 @@ #include "events/EventQueue.h" #include "events/mbed_shared_queues.h" #include "platform/Callback.h" -#include "netsocket/nsapi_types.h" -#include "netsocket/NetworkInterface.h" -#include "netsocket/NetworkStack.h" -#include "netsocket/WiFiAccessPoint.h" -#include "netsocket/WiFiInterface.h" +#include "features/netsocket/nsapi_types.h" +#include "features/netsocket/NetworkInterface.h" +#include "features/netsocket/NetworkStack.h" +#include "features/netsocket/WiFiAccessPoint.h" +#include "features/netsocket/WiFiInterface.h" #include "ESP8266.h"