17#ifndef ESP32_INTERFACE_H
18#define ESP32_INTERFACE_H
20#include "ESP32Stack.h"
42 ESP32Interface(PinName en, PinName io0, PinName tx, PinName rx,
bool debug =
false,
43 PinName rts = NC, PinName cts = NC,
int baudrate = 230400);
66 uint8_t channel = 0)
override;
104 ResetPin(PinName rst_pin);
120 nsapi_connection_status_t _connection_status;
121 mbed::Callback<void(nsapi_event_t, intptr_t)> _connection_status_cb;
123 void set_connection_status(nsapi_connection_status_t connection_status);
124 void wifi_status_cb(int8_t wifi_status);
ESP32Interface class Implementation of the NetworkStack for the ESP32.
const char * get_mac_address() override
Get the local MAC address.
nsapi_connection_status_t get_connection_status() const override
Get the connection status.
nsapi_error_t get_ip_address(SocketAddress *sockAddr) override
Get the local IP address.
nsapi_error_t get_gateway(SocketAddress *sockAddr) override
Get the local gateway.
ESP32Interface()
ESP32Interface lifetime Configuration defined in mbed_lib.json.
int set_credentials(const char *ssid, const char *pass, nsapi_security_t security=NSAPI_SECURITY_NONE) override
Set the Wi-Fi network credentials.
nsapi_error_t get_netmask(SocketAddress *sockAddr) override
Get the local network mask.
int connect(const char *ssid, const char *pass, nsapi_security_t security=NSAPI_SECURITY_NONE, uint8_t channel=0) override
Attempt to connect to a Wi-Fi network.
int8_t get_rssi() override
Get the current radio signal strength for active connection.
nsapi_error_t set_dhcp(bool dhcp) override
Enable or disable DHCP on connecting the network.
int connect() override
Attempt to connect to a Wi-Fi network.
ESP32Interface(PinName en, PinName io0, PinName tx, PinName rx, bool debug=false, PinName rts=NC, PinName cts=NC, int baudrate=230400)
ESP32Interface lifetime.
void attach(mbed::Callback< void(nsapi_event_t, intptr_t)> status_cb) override
Register callback for status reporting.
~ESP32Interface() override
ESP32Interface default destructor.
nsapi_error_t set_network(const SocketAddress &ip_address, const SocketAddress &netmask, const SocketAddress &gateway) override
Configure this network interface to use a static IP address.
ESP32Interface(PinName tx, PinName rx, bool debug=false)
ESP32Interface lifetime.
int disconnect() override
Stop the interface.
int set_channel(uint8_t channel) override
Set the Wi-Fi network channel.
ESP32Stack class Implementation of the NetworkStack for the ESP32.
virtual nsapi_error_t add_dns_server(const SocketAddress &address, const char *interface_name)
Add a domain name server to list of servers to query.
virtual nsapi_error_t gethostbyname(const char *host, SocketAddress *address, nsapi_version_t version=NSAPI_UNSPEC, const char *interface_name=NULL)
Translate a hostname to an IP address with specific version using network interface name.
Common interface between Wi-Fi devices.
Callback class based on template specialization.
A digital output, used for setting the state of a pin.
enum nsapi_security nsapi_security_t
Enum of encryption types.
signed int nsapi_error_t
Type used to represent error codes.