Asynchronous WPS triggering function.
This function is called for the WILC to enter the WPS (Wi-Fi Protected Setup) mode. The result is passed to the Wi-Fi notification callback with the event M2M_WIFI_REQ_WPS.
- Parameters
-
[in] | u8TriggerType | WPS Trigger method. Could be:
|
[in] | pcPinNumber | PIN number for WPS PIN method. It is not used if the trigger type is WPS_PBC_TRIGGER. It must follow the rules stated by the WPS Standard. |
- Warning
- This function is not allowed in AP or P2P modes.
- Precondition
- A Wi-Fi notification callback of type (tpfAppWifiCb MUST be implemented and registered at startup. Registering the callback is done through passing it to the m2m_wifi_init.
- The event M2M_WIFI_REQ_WPS must be handled in the callback to receive the WPS status.
- The WILC device MUST be in IDLE or STA mode. If AP or P2P mode is active, the WPS will not be performed.
- The m2m_wifi_handle_events MUST be called to receive the responses in the callback.
- See Also
- tpfAppWifiCb m2m_wifi_init M2M_WIFI_REQ_WPS tenuWPSTrigger tstrM2MWPSInfo
- Returns
- The function returns M2M_SUCCESS for successful operations and a negative value otherwise.
Example
The code snippet shows an example of how wifi wps is triggered .
void wifi_event_cb(
uint8 u8WiFiEvent,
void * pvMsg)
{
switch(u8WiFiEvent)
{
case M2M_WIFI_REQ_WPS:
{
{
printf(
"WPS SSID : %s\n",pstrWPS->
au8SSID);
printf(
"WPS PSK : %s\n",pstrWPS->
au8PSK);
printf(
"WPS Channel : %d\n",pstrWPS->
u8Ch + 1);
}
else
{
printf("(ERR) WPS Is not enabled OR Timedout\n");
}
}
break;
default:
break;
}
}
{
{
while(1)
{
}
}
}
References tstrM2MWPSConnect::acPinNumber, gu8scanInProgress, hif_send(), m2m_memcpy(), M2M_REQ_GRP_WIFI, M2M_WIFI_REQ_START_WPS, NULL, tstrM2MWPSConnect::u8TriggerType, and WPS_PIN_TRIGGER.
Referenced by os_m2m_wifi_wps_imp().