Asychronous wi-fi hotspot enabling function. The WILC supports AP mode operation with the following limitations:
- Up to 8 STA could be associated at a time.
- Open, WEP and WPA2 are the only supported security types
◆ m2m_wifi_enable_ap()
- Parameters
-
[in] | pstrM2MAPConfig | A structure holding the AP configurations. |
- Precondition
- A Wi-Fi notification callback of type tpfAppWifiCb MUST be implemented and registered at intalization. Registering the callback is done through passing it to the m2m_wifi_init.
- The m2m_wifi_handle_events MUST be called to receive the responses in the callback.
- See also
- tpfAppWifiCb tenuM2mSecType m2m_wifi_init tstrM2mWifiStateChanged tstrM2MAPConfig
- Returns
- The function returns M2M_SUCCESS for successful operations and a negative value otherwise.
Example
The code snippet demonstrates how the AP mode is enabled after the driver is initialized in the application's main function
#include "m2m_wifi.h"
void wifi_event_cb(uint8 u8WiFiEvent, void * pvMsg)
{
switch(u8WiFiEvent)
{
{
printf("STA has Associated\n");
}
break;
default:
break;
}
}
int main()
{
{
strcpy(apConfig.
au8SSID,
"WILC_SSID");
strcpy((char *)cfg.uniAuth.au8PSK, "12345678");
while(1)
{
}
}
}