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

Add a Wi-Fi Network profile.

WIFIReturnCode_t WIFI_NetworkAdd( const WIFINetworkProfile_t * const pxNetworkProfile,
uint16_t * pusIndex );

Adds a Wi-fi network to the network list in Non Volatile memory.

Parameters
[in]pxNetworkProfile- Network profile parameters
[out]pusIndex- Network profile index in storage
Returns
Index of the profile storage on success, or failure return code on failure.

Example

WIFINetworkProfile_t xNetworkProfile = {0};
WIFIReturnCode_t xWiFiStatus;
uint16_t usIndex;
strncpy( xNetworkProfile.cSSID, "SSID_Name", SSIDLen));
xNetworkProfile.ucSSIDLength = SSIDLen;
strncpy( xNetworkProfile.cPassword, "PASSWORD",PASSLen );
xNetworkProfile.ucPasswordLength = PASSLen;
xNetworkProfile.xSecurity = eWiFiSecurityWPA2;
WIFI_NetworkAdd( &xNetworkProfile, &usIndex );