Pocuter WIFI configurations.
More...
#include <PocuterWIFI.h>
|
| enum | AUTH_MODE {
WIFIAUTH_OPEN = 0,
WIFIAUTH_WEP,
WIFIAUTH_WPA_PSK,
WIFIAUTH_WPA2_PSK,
WIFIAUTH_WPA_WPA2_PSK,
WIFIAUTH_WPA2_ENTERPRISE,
WIFIAUTH_WPA3_PSK,
WIFIAUTH_WPA2_WPA3_PSK,
WIFIAUTH_WAPI_PSK,
WIFIAUTH_MAX
} |
| |
| enum | WIFIERROR {
WIFIERROR_OK = 0,
WIFIERROR_INIT_FAILED,
WIFIERROR_COULD_NOT_SET_WIFI_MODE,
WIFIERROR_NO_CREDENTIALS,
WIFIERROR_WPS_TIMEOUT,
WIFIERROR_UNKNOWN
} |
| |
| enum | WIFIEVENT {
WIFIEVENT_DISCONNECTED,
WIFIEVENT_CONNECTED,
WIFIEVENT_TRY_CONNECTING,
WIFIEVENT_GOT_IP,
WIFIEVENT_WPS_TIMEOUT,
WIFIEVENT_WPS_FAILED
} |
| |
| enum | WIFI_STATE {
WIFI_STATE_INIT_FAILED,
WIFI_STATE_DISCONNECTED,
WIFI_STATE_TRY_CONNECTING,
WIFI_STATE_CONNECTED,
WIFI_WAITING_WPS,
WIFI_WAITING_AP
} |
| |
| typedef void() | wifiEventHandler(WIFIEVENT, void *data, void *userData) |
| | typedef of the event handler More...
|
| |
Pocuter WIFI configurations.
◆ wifiEventHandler
| typedef void() PocuterWIFI::wifiEventHandler(WIFIEVENT, void *data, void *userData) |
typedef of the event handler
- Parameters
-
| WIFIEVENT | the type of event |
| data | additionally event data |
| userData | a pointer to userdata, set by registerEventHandler |
◆ AUTH_MODE
| Enumerator |
|---|
| WIFIAUTH_OPEN | authenticate mode : open
|
| WIFIAUTH_WEP | authenticate mode : WEP
|
| WIFIAUTH_WPA_PSK | authenticate mode : WPA_PSK
|
| WIFIAUTH_WPA2_PSK | authenticate mode : WPA2_PSK
|
| WIFIAUTH_WPA_WPA2_PSK | authenticate mode : WPA_WPA2_PSK
|
| WIFIAUTH_WPA2_ENTERPRISE | authenticate mode : WPA2_ENTERPRISE
|
| WIFIAUTH_WPA3_PSK | authenticate mode : WPA3_PSK
|
| WIFIAUTH_WPA2_WPA3_PSK | authenticate mode : WPA2_WPA3_PSK
|
| WIFIAUTH_WAPI_PSK | authenticate mode : WAPI_PSK
|
| WIFIAUTH_MAX | |
◆ WIFI_STATE
| Enumerator |
|---|
| WIFI_STATE_INIT_FAILED | |
| WIFI_STATE_DISCONNECTED | |
| WIFI_STATE_TRY_CONNECTING | |
| WIFI_STATE_CONNECTED | |
| WIFI_WAITING_WPS | |
| WIFI_WAITING_AP | |
◆ WIFIERROR
| Enumerator |
|---|
| WIFIERROR_OK | |
| WIFIERROR_INIT_FAILED | |
| WIFIERROR_COULD_NOT_SET_WIFI_MODE | |
| WIFIERROR_NO_CREDENTIALS | |
| WIFIERROR_WPS_TIMEOUT | |
| WIFIERROR_UNKNOWN | |
◆ WIFIEVENT
| Enumerator |
|---|
| WIFIEVENT_DISCONNECTED | |
| WIFIEVENT_CONNECTED | |
| WIFIEVENT_TRY_CONNECTING | |
| WIFIEVENT_GOT_IP | |
| WIFIEVENT_WPS_TIMEOUT | |
| WIFIEVENT_WPS_FAILED | |
◆ connect() [1/2]
connect to wifi with saved credentials
- Note
- The function will not block. You can see the current state by polling getState or setting the eventhandler.
- Returns
- WIFIERROR_OK the access point is available WIFIERROR_INIT_FAILED could not init WIFI
◆ connect() [2/2]
connect to wifi with given credentials
- Note
- The function will not block. You can see the current state by polling getState or setting the eventhandler.
- Parameters
-
- Returns
- WIFIERROR_OK the access point is available WIFIERROR_INIT_FAILED could not init WIFI
◆ getCredentials()
get the current credentials
- Parameters
-
- Returns
- WIFIERROR_OK the access point is available
◆ getIpInfo()
| virtual const ipInfo* PocuterWIFI::getIpInfo |
( |
| ) |
|
|
pure virtual |
get ipInfo
- Note
- you will only get an ipInfo if you are connected. Otherwise you will get NULL.
- Returns
- ipInfo the ipInfo struct NULL if you are not connected
◆ getState()
get the state of the WIFI
- Returns
- WIFI_STATE
◆ registerEventHandler()
| virtual void PocuterWIFI::registerEventHandler |
( |
wifiEventHandler * |
h, |
|
|
void * |
u |
|
) |
| |
|
pure virtual |
registers an event handler
- Parameters
-
| h | a pointer to the callback function |
| u | a pointer to user data sent to the event handler on each event |
◆ scanAPs()
| virtual WIFIERROR PocuterWIFI::scanAPs |
( |
apInfo * |
i, |
|
|
uint16_t * |
size, |
|
|
uint16_t * |
totalAPs |
|
) |
| |
|
pure virtual |
scan for access points
- Note
- this function will block. You have to allocate the memory of the apInfo array and set the size in the size parameter.
- Parameters
-
| i | an array of apInfo's already allocated |
| size | (in and out) set this to the cont of the allocated apInfo elements and it will be set to the actually saved access point count. |
| totalAPs | (out) the total number of access points found |
- Returns
- WIFIERROR_OK the access point is available WIFIERROR_INIT_FAILED could not init WIFI
◆ startAccessPoint()
| virtual WIFIERROR PocuterWIFI::startAccessPoint |
( |
| ) |
|
|
pure virtual |
starts an access point to set the WIFI credentials
- Note
- the access point will be called "Pocuter". The function will not block. The Pocter will restart when the credentials were set.
- Returns
- WIFIERROR_OK the access point is available
◆ startWPS()
starts WPS request.
- Note
- the function will block until a timeout or the WPS was successful
- Returns
- WIFIERROR_WPS_TIMEOUT it timed out
WIFIERROR_OK a new connection was established
The documentation for this class was generated from the following file: