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 );
WIFINetworkProfile_t::ucPasswordLength
uint8_t ucPasswordLength
Definition: iot_wifi.h:155
WIFINetworkProfile_t::ucSSIDLength
uint8_t ucSSIDLength
Definition: iot_wifi.h:152
WIFINetworkProfile_t::xSecurity
WIFISecurity_t xSecurity
Definition: iot_wifi.h:156
eWiFiSecurityWPA2
@ eWiFiSecurityWPA2
Definition: iot_wifi.h:67
WIFI_NetworkAdd
WIFIReturnCode_t WIFI_NetworkAdd(const WIFINetworkProfile_t *const pxNetworkProfile, uint16_t *pusIndex)
Add a Wi-Fi Network profile.
WIFIReturnCode_t
WIFIReturnCode_t
Return code denoting API status.
Definition: iot_wifi.h:50
WIFINetworkProfile_t::cPassword
char cPassword[wificonfigMAX_PASSPHRASE_LEN+1]
Definition: iot_wifi.h:154
WIFINetworkProfile_t
Wi-Fi network parameters passed to the WIFI_NetworkAdd API.
Definition: iot_wifi.h:150
WIFINetworkProfile_t::cSSID
char cSSID[wificonfigMAX_SSID_LEN+1]
Definition: iot_wifi.h:151