FreeRTOS:
Wi-Fi Management Library
|
Return to main page ↑ |
Wi-Fi Interface. More...
#include <stdint.h>
#include "portmacro.h"
#include "aws_wifi_config.h"
#include "types/iot_network_types.h"
Go to the source code of this file.
Data Structures | |
struct | WIFINetworkParams_t |
Parameters passed to the WIFI_ConnectAP API for connection. More... | |
struct | WIFIScanResult_t |
Wi-Fi scan results. More... | |
struct | WIFINetworkProfile_t |
Wi-Fi network parameters passed to the WIFI_NetworkAdd API. More... | |
Enumerations | |
enum | WIFIReturnCode_t { eWiFiSuccess = 0, eWiFiFailure = 1, eWiFiTimeout = 2, eWiFiNotSupported = 3 } |
Return code denoting API status. More... | |
enum | WIFISecurity_t { eWiFiSecurityOpen = 0, eWiFiSecurityWEP, eWiFiSecurityWPA, eWiFiSecurityWPA2, eWiFiSecurityWPA2_ent, eWiFiSecurityNotSupported } |
Wi-Fi Security types. More... | |
enum | WIFIDeviceMode_t { eWiFiModeStation = 0, eWiFiModeAP, eWiFiModeP2P, eWiFiModeNotSupported } |
Wi-Fi device modes. More... | |
enum | WIFIPMMode_t { eWiFiPMNormal = 0, eWiFiPMLowPower, eWiFiPMAlwaysOn, eWiFiPMNotSupported } |
Wi-Fi device power management modes. 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_GetIP (uint8_t *pucIPAddr) |
Retrieves the Wi-Fi interface's IP address. 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_RegisterNetworkStateChangeEventCallback (IotNetworkStateChangeEventCallback_t xCallback) |
Registers application callback for network state change events from WiFi layer. More... | |
BaseType_t | WIFI_IsConnected (void) |
Check if the Wi-Fi is connected. More... | |
Wi-Fi Interface.
enum WIFIReturnCode_t |
enum WIFISecurity_t |
enum WIFIDeviceMode_t |
enum WIFIPMMode_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_GetIP | ( | uint8_t * | pucIPAddr | ) |
Retrieves the Wi-Fi interface's IP address.
[out] | pucIPAddr | IP Address buffer. |
Example
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_RegisterNetworkStateChangeEventCallback | ( | IotNetworkStateChangeEventCallback_t | xCallback | ) |
Registers application callback for network state change events from WiFi layer.
[in] | xCallback | Application callback for network state change events. |
BaseType_t WIFI_IsConnected | ( | void | ) |
Check if the Wi-Fi is connected.