FreeRTOS: Wi-Fi Management Library
Return to main page ↑
WIFI_ConnectAP

Connects to the Wi-Fi Access Point (AP) specified in the input.

WIFIReturnCode_t WIFI_ConnectAP( const WIFINetworkParams_t * const pxNetworkParams );

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.

Parameters
[in]pxNetworkParamsConfiguration to join AP.
Returns
eWiFiSuccess if connection is successful, failure code otherwise.

Example

WIFINetworkParams_t xNetworkParams;
WIFIReturnCode_t xWifiStatus;
xNetworkParams.pcSSID = "SSID String";
xNetworkParams.ucSSIDLength = SSIDLen;
xNetworkParams.pcPassword = "Password String";
xNetworkParams.ucPasswordLength = PassLength;
xNetworkParams.xSecurity = eWiFiSecurityWPA2;
xWifiStatus = WIFI_ConnectAP( &( xNetworkParams ) );
if(xWifiStatus == eWiFiSuccess)
{
//Connected to AP.
}
See also
WIFINetworkParams_t
eWiFiSecurityWPA2
@ eWiFiSecurityWPA2
Definition: iot_wifi.h:67
WIFINetworkParams_t::pcPassword
const char * pcPassword
Definition: iot_wifi.h:111
WIFINetworkParams_t::ucPasswordLength
uint8_t ucPasswordLength
Definition: iot_wifi.h:112
eWiFiSuccess
@ eWiFiSuccess
Definition: iot_wifi.h:51
WIFINetworkParams_t
Parameters passed to the WIFI_ConnectAP API for connection.
Definition: iot_wifi.h:108
WIFINetworkParams_t::ucSSIDLength
uint8_t ucSSIDLength
Definition: iot_wifi.h:110
WIFINetworkParams_t::pcSSID
const char * pcSSID
Definition: iot_wifi.h:109
WIFI_ConnectAP
WIFIReturnCode_t WIFI_ConnectAP(const WIFINetworkParams_t *const pxNetworkParams)
Connects to the Wi-Fi Access Point (AP) specified in the input.
WIFIReturnCode_t
WIFIReturnCode_t
Return code denoting API status.
Definition: iot_wifi.h:50
WIFINetworkParams_t::xSecurity
WIFISecurity_t xSecurity
Definition: iot_wifi.h:113