Skip to content

Commit

Permalink
Resolve header issues
Browse files Browse the repository at this point in the history
  • Loading branch information
Chris Snow authored and Chris Snow committed Oct 17, 2024
1 parent dac35fd commit 1a84cd5
Show file tree
Hide file tree
Showing 5 changed files with 12 additions and 25 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -19,26 +19,13 @@
#define ESP32_H

#if DEVICE_SERIAL && defined(MBED_CONF_EVENTS_PRESENT) && defined(MBED_CONF_NSAPI_PRESENT) && defined(MBED_CONF_RTOS_PRESENT)
#include <vector>
#include <stdint.h>
#include <stdlib.h>

#include "drivers/DigitalOut.h"
#include "drivers/SerialBase.h"
#include "netsocket/nsapi_types.h"
#include "netsocket/WiFiAccessPoint.h"
#include "PinNames.h"
#include "platform/ATCmdParser.h"
#include "platform/Callback.h"
#include "platform/mbed_error.h"
#include "platform/mbed_version.h"
#include "rtos/Mutex.h"
#include "rtos/ThisThread.h"

#if (MBED_MAJOR_VERSION < 6)
#include "drivers/UARTSerial.h"
#else
#include "drivers/BufferedSerial.h"
#endif

#ifndef ESP32_CONNECT_TIMEOUT
#define ESP32_CONNECT_TIMEOUT 15000
Expand Down Expand Up @@ -275,11 +262,7 @@ class ESP32
mbed::DigitalOut * _p_wifi_io0;
bool _init_end_common;
bool _init_end_wifi;
#if (MBED_MAJOR_VERSION < 6)
mbed::UARTSerial _serial;
#else
mbed::BufferedSerial _serial;
#endif
mbed::ATCmdParser _parser;
struct packet {
struct packet *next;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,8 @@
#include <string.h>
#include "ESP32Interface.h"

using namespace std::chrono_literals;

// ESP32Interface implementation
ESP32Interface::ESP32Interface() :
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,
Expand All @@ -34,7 +36,7 @@ ESP32Interface::ESP32Interface() :
_connection_status_cb(NULL)
{
memset(_ap_ssid, 0, sizeof(_ap_ssid));
_esp->attach_wifi_status(callback(this, &ESP32Interface::wifi_status_cb));
_esp->attach_wifi_status(mbed::callback(this, &ESP32Interface::wifi_status_cb));
}

ESP32Interface::ESP32Interface(PinName en, PinName io0, PinName tx, PinName rx, bool debug,
Expand All @@ -53,7 +55,7 @@ ESP32Interface::ESP32Interface(PinName en, PinName io0, PinName tx, PinName rx,
_connection_status_cb(NULL)
{
memset(_ap_ssid, 0, sizeof(_ap_ssid));
_esp->attach_wifi_status(callback(this, &ESP32Interface::wifi_status_cb));
_esp->attach_wifi_status(mbed::callback(this, &ESP32Interface::wifi_status_cb));
}

ESP32Interface::ESP32Interface(PinName tx, PinName rx, bool debug) :
Expand All @@ -71,7 +73,7 @@ ESP32Interface::ESP32Interface(PinName tx, PinName rx, bool debug) :
_connection_status_cb(NULL)
{
memset(_ap_ssid, 0, sizeof(_ap_ssid));
_esp->attach_wifi_status(callback(this, &ESP32Interface::wifi_status_cb));
_esp->attach_wifi_status(mbed::callback(this, &ESP32Interface::wifi_status_cb));
}

nsapi_error_t ESP32Interface::set_network(const SocketAddress &ip_address, const SocketAddress &netmask, const SocketAddress &gateway)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@
#ifndef ESP32_INTERFACE_H
#define ESP32_INTERFACE_H

#include "mbed.h"
#include "ESP32Stack.h"

/** ESP32Interface class
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@
#ifndef ESP32_INTERFACE_AP_H
#define ESP32_INTERFACE_AP_H

#include "mbed.h"
#include "ESP32Stack.h"


Expand Down Expand Up @@ -253,7 +252,7 @@ class ESP32InterfaceAP : public ESP32Stack, public WiFiInterface
SocketAddress _netmask;
SocketAddress _gateway;
nsapi_connection_status_t _connection_status;
Callback<void(nsapi_event_t, intptr_t)> _connection_status_cb;
mbed::Callback<void(nsapi_event_t, intptr_t)> _connection_status_cb;
};

#endif
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,12 @@
#ifndef ESP32_STACK_H
#define ESP32_STACK_H

#include "mbed.h"

#include "ESP32.h"
#include "netsocket/NetworkInterface.h"
#include "netsocket/NetworkStack.h"
#include "netsocket/nsapi_types.h"
#include "netsocket/WiFiInterface.h"

/** ESP32Stack class
* Implementation of the NetworkStack for the ESP32
Expand Down

0 comments on commit 1a84cd5

Please sign in to comment.