Skip to content

Commit

Permalink
Fixes includes
Browse files Browse the repository at this point in the history
  • Loading branch information
Veijo Pesonen committed Nov 1, 2018
1 parent 9bcf9ab commit ed2bb74
Show file tree
Hide file tree
Showing 4 changed files with 36 additions and 26 deletions.
13 changes: 8 additions & 5 deletions ESP8266/ESP8266.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -14,20 +14,23 @@
* limitations under the License.
*/

#include <string.h>
#include <stdint.h>

#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 <cstring>

#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),
Expand Down
25 changes: 15 additions & 10 deletions ESP8266/ESP8266.h
Original file line number Diff line number Diff line change
Expand Up @@ -17,11 +17,16 @@
#ifndef ESP8266_H
#define ESP8266_H

#include "ATCmdParser.h"
#include "Mutex.h"
#include "nsapi_types.h"
#include "rtos.h"
#include <stdint.h>

#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
Expand Down Expand Up @@ -281,7 +286,7 @@ class ESP8266 {
*
* @param func A pointer to a void function, or 0 to set as none
*/
void sigio(Callback<void()> func);
void sigio(mbed::Callback<void()> func);

/**
* Attach a function to call whenever sigio happens in the serial
Expand All @@ -292,7 +297,7 @@ class ESP8266 {
template <typename T, typename M>
void sigio(T *obj, M method)
{
sigio(Callback<void()>(obj, method));
sigio(mbed::Callback<void()>(obj, method));
}

/**
Expand Down Expand Up @@ -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);
Expand Down Expand Up @@ -432,7 +437,7 @@ class ESP8266 {

// Connection state reporting
nsapi_connection_status_t _conn_status;
Callback<void()> _conn_stat_cb; // ESP8266Interface registered
mbed::Callback<void()> _conn_stat_cb; // ESP8266Interface registered
};

#endif
14 changes: 8 additions & 6 deletions ESP8266Interface.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -14,15 +14,17 @@
* limitations under the License.
*/

#include <cstring>
#include "events/EventQueue.h"
#include "events/mbed_shared_queues.h"
#include "platform/Callback.h"
#include <string.h>
#include <stdint.h>

#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
Expand Down
10 changes: 5 additions & 5 deletions ESP8266Interface.h
Original file line number Diff line number Diff line change
Expand Up @@ -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"

Expand Down

0 comments on commit ed2bb74

Please sign in to comment.