18#ifndef EMW3080B_INTERFACE_H
19#define EMW3080B_INTERFACE_H
21#if defined(MBED_CONF_NSAPI_PRESENT)
26#include "mbed_debug.h"
29#include "netsocket/EMACInterface.h"
30#include "netsocket/OnboardNetworkStack.h"
31#include "EMW3080B_EMAC.h"
39 EMW3080BInterface(
bool debug = MBED_CONF_EMW3080B_WIFI_DEBUG,
40 PinName mosi = MBED_CONF_EMW3080B_WIFI_MOSI,
41 PinName miso = MBED_CONF_EMW3080B_WIFI_MISO,
42 PinName sclk = MBED_CONF_EMW3080B_WIFI_SCLK,
43 PinName nss = MBED_CONF_EMW3080B_WIFI_NSS,
44 PinName notify = MBED_CONF_EMW3080B_WIFI_NOTIFY,
45 PinName flow = MBED_CONF_EMW3080B_WIFI_FLOW,
46 PinName reset = MBED_CONF_EMW3080B_WIFI_RESET,
47 PinName tx = MBED_CONF_EMW3080B_WIFI_TX,
48 PinName rx = MBED_CONF_EMW3080B_WIFI_RX,
49 EMAC &emac = EMW3080B_EMAC::get_instance(),
123 MX_WIFIObject_t MxWifiObj;
132 case MX_WIFI_SEC_NONE:
135 case MX_WIFI_SEC_WEP:
138 case MX_WIFI_SEC_WPA_AES:
139 case MX_WIFI_SEC_WPA_TKIP:
142 case MX_WIFI_SEC_WPA2_AES:
143 case MX_WIFI_SEC_WPA2_TKIP:
144 case MX_WIFI_SEC_WPA2_MIXED:
147 case MX_WIFI_SEC_AUTO:
160 MX_WIFI_SecurityType_t mx_sec;
164 mx_sec = MX_WIFI_SEC_NONE;
167 mx_sec = MX_WIFI_SEC_WEP;
170 mx_sec = MX_WIFI_SEC_WPA_AES;
173 mx_sec = MX_WIFI_SEC_WPA2_AES;
176 mx_sec = MX_WIFI_SEC_AUTO;
184#define MAX_AP_COUNT 20
187 int8_t IO_Init(uint16_t mode);
188 int8_t IO_DeInit(
void);
189 void IO_Delay(uint32_t delayms);
190 uint16_t IO_Send(uint8_t *data, uint16_t len);
191 uint16_t IO_Receive(uint8_t *buffer, uint16_t buff_size);
197 mwifi_ap_info_t _ap_info[MAX_AP_COUNT];
198 MX_WIFI_SecurityType_t _sec;
199 volatile bool _isConnected;
202 uint8_t _debug_level;
Common interface between Wi-Fi devices.
This interface should be used to abstract low level access to networking hardware All operations rece...
EMACInterface class Implementation of the NetworkInterface for an EMAC-based driver.
mbed OS API for onboard IP stack abstraction
static OnboardNetworkStack & get_default_instance()
Return the default on-board network stack.
Common interface between Wi-Fi devices.
virtual nsapi_error_t set_channel(uint8_t channel)=0
Set the Wi-Fi network channel.
nsapi_error_t connect() override=0
Attempt to connect to a Wi-Fi network.
virtual int8_t get_rssi()=0
Get the current radio signal strength for active connection.
virtual nsapi_error_t set_credentials(const char *ssid, const char *pass, nsapi_security_t security=NSAPI_SECURITY_NONE)=0
Set the Wi-Fi network credentials.
nsapi_error_t disconnect() override=0
Stop the interface.
virtual nsapi_size_or_error_t scan(WiFiAccessPoint *res, nsapi_size_t count)=0
Scan for available networks.
enum nsapi_security nsapi_security_t
Enum of encryption types.
signed int nsapi_error_t
Type used to represent error codes.
@ NSAPI_SECURITY_WPA_WPA2
@ NSAPI_ERROR_UNSUPPORTED