|
FreeRTOS:
Wi-Fi Management Library
|
| Return to main page ↑ |
Wi-Fi Interface. More...
#include <stdint.h>#include "portmacro.h"#include "aws_wifi_config.h"Go to the source code of this file.
Data Structures | |
| struct | WIFIWEPKey_t |
| Wi-Fi WEP keys (64- and 128-bit keys only) More... | |
| struct | WIFIWPAPassphrase_t |
| Wi-Fi WPA/WPA2 passphrase. More... | |
| struct | WIFINetworkParams_t |
| Parameters passed to the WIFI_ConnectAP API for connection. More... | |
| struct | WIFIScanConfig_t |
| Wi-Fi scan configuration. More... | |
| struct | WIFIScanResult_t |
| Wi-Fi scan results. More... | |
| struct | WIFIStationInfo_t |
| Wi-Fi SoftAP connected station info. More... | |
| struct | WIFINetworkProfile_t |
| Wi-Fi network parameters passed to the WIFI_NetworkAdd API. More... | |
| struct | WIFIIPAddress_t |
| Wi-Fi station IP address format. More... | |
| struct | WIFIIPConfiguration_t |
| IP address configuration. More... | |
| struct | WIFIConnectionInfo_t |
| Wi-Fi info of the connected AP. More... | |
| struct | WiFiEventInfoReady_t |
| Wi-Fi event info for WI-FI ready. More... | |
| struct | WiFiEventInfoScanDone_t |
| Wi-Fi event info for scan done. More... | |
| struct | WiFiEventInfoConnected_t |
| Wi-Fi event info for station connected to AP. More... | |
| struct | WiFiEventInfoDisconnected_t |
| Wi-Fi event info for station disconnected from AP. More... | |
| struct | WiFiEventInfoConnectionFailed_t |
| Wi-Fi event info for station connection failure. More... | |
| struct | WiFiEventInfoIPReady_t |
| Wi-Fi event info for IP ready. More... | |
| struct | WiFiEventInfoAPStateChanged_t |
| Wi-Fi event info for AP state change. More... | |
| struct | WiFiEventInfoAPStationConnected_t |
| Wi-Fi event info for AP got a connected station. More... | |
| struct | WiFiEventInfoAPStationDisconnected_t |
| Wi-Fi event info for AP got a disconnected station. More... | |
| struct | WiFiEventInfoRxDone_t |
| Wi-Fi event info for receiving a frame in monitor mode (or normal mode with RX filter). More... | |
| struct | WiFiEventInfoTxDone_t |
| Wi-Fi event info for finishing transmitting an injection frame. More... | |
| struct | WIFIEvent_t |
| Wi-Fi combined event data structure. More... | |
| struct | WIFIStatisticInfo_t |
| Wi-Fi Statistic info. More... | |
| struct | WIFICapabilityInfo_t |
| Wi-Fi capabilities. More... | |
Macros | |
| #define | IPV6_LENGTH 4 |
| IPV6 length in 32-bit words. More... | |
| #define | WIFI_WPS_SUPPORTED 0x0001 |
| Wi-Fi lower level supported feature mask. More... | |
| #define | WIFI_ENTERPRISE_SUPPORTED 0x0002 |
| #define | WIFI_P2P_SUPPORTED 0x0004 |
| #define | WIFI_TDLS_SUPPORTED 0x0008 |
Typedefs | |
| typedef void(* | WIFIEventHandler_t) (WIFIEvent_t *xEvent) |
| Wi-Fi event handler definition. More... | |
Functions | |
| WIFIReturnCode_t | WIFI_On (void) |
| Turns on Wi-Fi. More... | |
| WIFIReturnCode_t | WIFI_Off (void) |
| Turns off Wi-Fi. More... | |
| WIFIReturnCode_t | WIFI_ConnectAP (const WIFINetworkParams_t *const pxNetworkParams) |
| Connects to the Wi-Fi Access Point (AP) specified in the input. More... | |
| WIFIReturnCode_t | WIFI_Disconnect (void) |
| Disconnects from the currently connected Access Point. More... | |
| WIFIReturnCode_t | WIFI_Reset (void) |
| Resets the Wi-Fi Module. More... | |
| WIFIReturnCode_t | WIFI_SetMode (WIFIDeviceMode_t xDeviceMode) |
| Sets the Wi-Fi mode. More... | |
| WIFIReturnCode_t | WIFI_GetMode (WIFIDeviceMode_t *pxDeviceMode) |
| Gets the Wi-Fi mode. More... | |
| WIFIReturnCode_t | WIFI_NetworkAdd (const WIFINetworkProfile_t *const pxNetworkProfile, uint16_t *pusIndex) |
| Add a Wi-Fi Network profile. More... | |
| WIFIReturnCode_t | WIFI_NetworkGet (WIFINetworkProfile_t *pxNetworkProfile, uint16_t usIndex) |
| Get a Wi-Fi network profile. More... | |
| WIFIReturnCode_t | WIFI_NetworkDelete (uint16_t usIndex) |
| Delete a Wi-Fi Network profile. More... | |
| WIFIReturnCode_t | WIFI_Ping (uint8_t *pucIPAddr, uint16_t usCount, uint32_t ulIntervalMS) |
| Ping an IP address in the network. More... | |
| WIFIReturnCode_t | WIFI_GetMAC (uint8_t *pucMac) |
| Retrieves the Wi-Fi interface's MAC address. More... | |
| WIFIReturnCode_t | WIFI_GetHostIP (char *pcHost, uint8_t *pucIPAddr) |
| Retrieves the host IP address from a host name using DNS. More... | |
| WIFIReturnCode_t | WIFI_Scan (WIFIScanResult_t *pxBuffer, uint8_t ucNumNetworks) |
| Perform a Wi-Fi network Scan. More... | |
| WIFIReturnCode_t | WIFI_StartAP (void) |
| Start SoftAP mode. More... | |
| WIFIReturnCode_t | WIFI_StopAP (void) |
| Stop SoftAP mode. More... | |
| WIFIReturnCode_t | WIFI_ConfigureAP (const WIFINetworkParams_t *const pxNetworkParams) |
| Configure SoftAP. More... | |
| WIFIReturnCode_t | WIFI_SetPMMode (WIFIPMMode_t xPMModeType, const void *pvOptionValue) |
| Set the Wi-Fi power management mode. More... | |
| WIFIReturnCode_t | WIFI_GetPMMode (WIFIPMMode_t *pxPMModeType, void *pvOptionValue) |
| Get the Wi-Fi power management mode. More... | |
| WIFIReturnCode_t | WIFI_RegisterEvent (WIFIEventType_t xEventType, WIFIEventHandler_t xHandler) |
| Register a Wi-Fi event Handler. More... | |
| BaseType_t | WIFI_IsConnected (const WIFINetworkParams_t *pxNetworkParams) |
| Check if the Wi-Fi is connected and the AP configuration matches the query. More... | |
| WIFIReturnCode_t | WIFI_StartScan (WIFIScanConfig_t *pxScanConfig) |
| Start a Wi-Fi scan. More... | |
| WIFIReturnCode_t | WIFI_GetScanResults (const WIFIScanResult_t **pxBuffer, uint16_t *ucNumNetworks) |
| Get Wi-Fi scan results. It should be called only after scan is completed. Scan results are sorted in decreasing rssi order. More... | |
| WIFIReturnCode_t | WIFI_StartConnectAP (const WIFINetworkParams_t *pxNetworkParams) |
| Connect to the Wi-Fi Access Point (AP) specified in the input. More... | |
| WIFIReturnCode_t | WIFI_StartDisconnect (void) |
| Wi-Fi station disconnects from AP. More... | |
| WIFIReturnCode_t | WIFI_GetConnectionInfo (WIFIConnectionInfo_t *pxConnectionInfo) |
| Get Wi-Fi info of the connected AP. More... | |
| WIFIReturnCode_t | WIFI_GetIPInfo (WIFIIPConfiguration_t *pxIPInfo) |
| Get IP configuration (IP address, NetworkMask, Gateway and DNS server addresses). More... | |
| WIFIReturnCode_t | WIFI_GetRSSI (int8_t *pcRSSI) |
| Get the RSSI of the connected AP. More... | |
| WIFIReturnCode_t | WIFI_GetStationList (WIFIStationInfo_t *pxStationList, uint8_t *pcStationListSize) |
| SoftAP mode get connected station list. More... | |
| WIFIReturnCode_t | WIFI_StartDisconnectStation (uint8_t *pucMac) |
| AP mode disconnecting a station. More... | |
| WIFIReturnCode_t | WIFI_SetMAC (uint8_t *pucMac) |
| Set Wi-Fi MAC addresses. More... | |
| WIFIReturnCode_t | WIFI_SetCountryCode (const char *pcCountryCode) |
| Set country based configuration (including channel list, power table) More... | |
| WIFIReturnCode_t | WIFI_GetCountryCode (char *pcCountryCode) |
| Get the currently configured country code. More... | |
| WIFIReturnCode_t | WIFI_GetStatistic (WIFIStatisticInfo_t *pxStats) |
| Get the Wi-Fi statistics. More... | |
| WIFIReturnCode_t | WIFI_GetCapability (WIFICapabilityInfo_t *pxCaps) |
| Get the Wi-Fi capability. More... | |
Wi-Fi Interface.
| #define IPV6_LENGTH 4 |
IPV6 length in 32-bit words.
| #define WIFI_WPS_SUPPORTED 0x0001 |
Wi-Fi lower level supported feature mask.
| typedef void(* WIFIEventHandler_t) (WIFIEvent_t *xEvent) |
Wi-Fi event handler definition.
| [in] | xEvent | - Wi-Fi event data structure. |
| enum WIFIReturnCode_t |
| enum WIFISecurity_t |
| enum WIFIDeviceMode_t |
| enum WIFIPMMode_t |
| enum WIFIReason_t |
Wi-Fi protocol reason codes.
| enum WIFIEventType_t |
Wi-Fi event types.
| enum WIFIBand_t |
| enum WIFIPhyMode_t |
| enum WIFIBandwidth_t |
| WIFIReturnCode_t WIFI_On | ( | void | ) |
Turns on Wi-Fi.
This function turns on Wi-Fi module,initializes the drivers and must be called before calling any other Wi-Fi API
| WIFIReturnCode_t WIFI_Off | ( | void | ) |
Turns off Wi-Fi.
This function turns off the Wi-Fi module. The Wi-Fi peripheral should be put in a low power or off state in this routine.
| WIFIReturnCode_t WIFI_ConnectAP | ( | const WIFINetworkParams_t *const | pxNetworkParams | ) |
Connects to the Wi-Fi Access Point (AP) specified in the input.
The Wi-Fi should stay connected when the same Access Point it is currently connected to is specified. Otherwise, the Wi-Fi should disconnect and connect to the new Access Point specified. If the new Access Point specifed has invalid parameters, then the Wi-Fi should be disconnected.
| [in] | pxNetworkParams | Configuration to join AP. |
Example
| WIFIReturnCode_t WIFI_Disconnect | ( | void | ) |
Disconnects from the currently connected Access Point.
| WIFIReturnCode_t WIFI_Reset | ( | void | ) |
Resets the Wi-Fi Module.
| WIFIReturnCode_t WIFI_SetMode | ( | WIFIDeviceMode_t | xDeviceMode | ) |
Sets the Wi-Fi mode.
| [in] | xDeviceMode | - Mode of the device Station / Access Point /P2P. |
Example
| WIFIReturnCode_t WIFI_GetMode | ( | WIFIDeviceMode_t * | pxDeviceMode | ) |
Gets the Wi-Fi mode.
| [out] | pxDeviceMode | - return mode Station / Access Point /P2P |
Example
| WIFIReturnCode_t WIFI_NetworkAdd | ( | const WIFINetworkProfile_t *const | pxNetworkProfile, |
| uint16_t * | pusIndex | ||
| ) |
Add a Wi-Fi Network profile.
Adds a Wi-fi network to the network list in Non Volatile memory.
| [in] | pxNetworkProfile | - Network profile parameters |
| [out] | pusIndex | - Network profile index in storage |
Example
| WIFIReturnCode_t WIFI_NetworkGet | ( | WIFINetworkProfile_t * | pxNetworkProfile, |
| uint16_t | usIndex | ||
| ) |
Get a Wi-Fi network profile.
Gets the Wi-Fi network parameters at the given index from network list in non-volatile memory.
| [out] | pxNetworkProfile | - pointer to return network profile parameters |
| [in] | usIndex | - Index of the network profile, must be between 0 to wificonfigMAX_NETWORK_PROFILES |
Example
| WIFIReturnCode_t WIFI_NetworkDelete | ( | uint16_t | usIndex | ) |
Delete a Wi-Fi Network profile.
Deletes the Wi-Fi network profile from the network profile list at given index in non-volatile memory
| [in] | usIndex | - Index of the network profile, must be between 0 to wificonfigMAX_NETWORK_PROFILES. |
If wificonfigMAX_NETWORK_PROFILES is the index, then all network profiles will be deleted.
Example
| WIFIReturnCode_t WIFI_Ping | ( | uint8_t * | pucIPAddr, |
| uint16_t | usCount, | ||
| uint32_t | ulIntervalMS | ||
| ) |
Ping an IP address in the network.
| [in] | pucIPAddr | IP Address array to ping. |
| [in] | usCount | Number of times to ping |
| [in] | ulIntervalMS | Interval in mili-seconds for ping operation |
| WIFIReturnCode_t WIFI_GetMAC | ( | uint8_t * | pucMac | ) |
Retrieves the Wi-Fi interface's MAC address.
| [out] | pucMac | MAC Address buffer sized 6 bytes. |
Example
| WIFIReturnCode_t WIFI_GetHostIP | ( | char * | pcHost, |
| uint8_t * | pucIPAddr | ||
| ) |
Retrieves the host IP address from a host name using DNS.
| [in] | pcHost | - Host (node) name. |
| [in] | pucIPAddr | - IP Address buffer. |
Example
| WIFIReturnCode_t WIFI_Scan | ( | WIFIScanResult_t * | pxBuffer, |
| uint8_t | ucNumNetworks | ||
| ) |
Perform a Wi-Fi network Scan.
| [in] | pxBuffer | - Buffer for scan results. |
| [in] | ucNumNetworks | - Number of networks to retrieve in scan result. |
Example
| WIFIReturnCode_t WIFI_StartAP | ( | void | ) |
Start SoftAP mode.
| WIFIReturnCode_t WIFI_StopAP | ( | void | ) |
Stop SoftAP mode.
| WIFIReturnCode_t WIFI_ConfigureAP | ( | const WIFINetworkParams_t *const | pxNetworkParams | ) |
Configure SoftAP.
| [in] | pxNetworkParams | - Network parameters to configure AP. |
Example
| WIFIReturnCode_t WIFI_SetPMMode | ( | WIFIPMMode_t | xPMModeType, |
| const void * | pvOptionValue | ||
| ) |
Set the Wi-Fi power management mode.
| [in] | xPMModeType | - Power mode type. |
| [in] | pvOptionValue | - A buffer containing the value of the option to set depends on the mode type example - beacon interval in sec |
| WIFIReturnCode_t WIFI_GetPMMode | ( | WIFIPMMode_t * | pxPMModeType, |
| void * | pvOptionValue | ||
| ) |
Get the Wi-Fi power management mode.
| [out] | pxPMModeType | - pointer to get current power mode set. |
| [out] | pvOptionValue | - optional value |
| WIFIReturnCode_t WIFI_RegisterEvent | ( | WIFIEventType_t | xEventType, |
| WIFIEventHandler_t | xHandler | ||
| ) |
Register a Wi-Fi event Handler.
| [in] | xEventType | - Wi-Fi event type. |
| [in] | xHandler | - Wi-Fi event handler. |
| BaseType_t WIFI_IsConnected | ( | const WIFINetworkParams_t * | pxNetworkParams | ) |
Check if the Wi-Fi is connected and the AP configuration matches the query.
param[in] pxNetworkParams - Network parameters to query, if NULL then just check the Wi-Fi link status.
| WIFIReturnCode_t WIFI_StartScan | ( | WIFIScanConfig_t * | pxScanConfig | ) |
Start a Wi-Fi scan.
This is an asynchronous call, the result will be notified by an event.
| [in] | pxScanConfig | - Parameters for scan, NULL if default scan (i.e. broadcast scan on all channels). |
| WIFIReturnCode_t WIFI_GetScanResults | ( | const WIFIScanResult_t ** | pxBuffer, |
| uint16_t * | ucNumNetworks | ||
| ) |
Get Wi-Fi scan results. It should be called only after scan is completed. Scan results are sorted in decreasing rssi order.
| [out] | pxBuffer | - Handle to the READ ONLY scan results buffer. |
| [out] | ucNumNetworks | - Actual number of networks in the scan results. |
| WIFIReturnCode_t WIFI_StartConnectAP | ( | const WIFINetworkParams_t * | pxNetworkParams | ) |
Connect to the Wi-Fi Access Point (AP) specified in the input.
This is an asynchronous call, the result will be notified by an event.
The Wi-Fi should stay connected when the specified AP is the same as the currently connected AP. Otherwise, the Wi-Fi should disconnect and connect to the specified AP. If the specified AP has invalid parameters, the Wi-Fi should be disconnected.
| [in] | pxNetworkParams | - Configuration of the targeted AP. |
| WIFIReturnCode_t WIFI_StartDisconnect | ( | void | ) |
Wi-Fi station disconnects from AP.
This is an asynchronous call. The result will be notified by an event.
| WIFIReturnCode_t WIFI_GetConnectionInfo | ( | WIFIConnectionInfo_t * | pxConnectionInfo | ) |
Get Wi-Fi info of the connected AP.
This is a synchronous call.
| [out] | pxConnectionInfo | - Wi-Fi info of the connected AP. |
| WIFIReturnCode_t WIFI_GetIPInfo | ( | WIFIIPConfiguration_t * | pxIPInfo | ) |
Get IP configuration (IP address, NetworkMask, Gateway and DNS server addresses).
This is a synchronous call.
| [out] | pxIPInfo | - Current IP configuration. |
| WIFIReturnCode_t WIFI_GetRSSI | ( | int8_t * | pcRSSI | ) |
Get the RSSI of the connected AP.
This only works when the station is connected.
| [out] | pcRSSI | - RSSI of the connected AP. |
| WIFIReturnCode_t WIFI_GetStationList | ( | WIFIStationInfo_t * | pxStationList, |
| uint8_t * | pcStationListSize | ||
| ) |
SoftAP mode get connected station list.
| [out] | pxStationList | - Buffer for station list, supplied by the caller. |
| [in,out] | pcStationListSize | - Input size of the list, output number of connected stations. |
| WIFIReturnCode_t WIFI_StartDisconnectStation | ( | uint8_t * | pucMac | ) |
AP mode disconnecting a station.
This is an asynchronous call, the result will be notified by an event.
| [in] | pucMac | - MAC Address of the station to be disconnected. |
| WIFIReturnCode_t WIFI_SetMAC | ( | uint8_t * | pucMac | ) |
Set Wi-Fi MAC addresses.
The given MAC address will become the station MAC address. The AP MAC address (i.e. BSSID) will be the same MAC address but with the local bit set.
| [in] | pucMac | - Station MAC address. |
| WIFIReturnCode_t WIFI_SetCountryCode | ( | const char * | pcCountryCode | ) |
Set country based configuration (including channel list, power table)
| [in] | pcCountryCode | - Country code (null-terminated string, e.g. "US", "CN". See ISO-3166). |
| WIFIReturnCode_t WIFI_GetCountryCode | ( | char * | pcCountryCode | ) |
Get the currently configured country code.
| [out] | pcCountryCode | - Null-terminated string to hold the country code (see ISO-3166). Must be at least 4 bytes. |
| WIFIReturnCode_t WIFI_GetStatistic | ( | WIFIStatisticInfo_t * | pxStats | ) |
Get the Wi-Fi statistics.
| [out] | pxStats | - Structure to hold the WiFi statistics. |
| WIFIReturnCode_t WIFI_GetCapability | ( | WIFICapabilityInfo_t * | pxCaps | ) |
Get the Wi-Fi capability.
| [out] | pxCaps | - Structure to hold the Wi-Fi capabilities. |