Asynchronous Wi-Fi direct (P2P) enabling mode function.
The WILC supports P2P in device listening mode ONLY (intent is ZERO). The WILC P2P implementation does not support P2P GO (Group Owner) mode. Active P2P devices (e.g. phones) could find the WILC in the search list. When the P2P GO Peer device place provisional discovery request, a Wi-Fi notification event M2M_WIFI_REQ_P2P_AUTH is triggered with config methods opted by peer device. In response to callback event M2M_WIFI_REQ_P2P_AUTH, the Application should send response back to WILC with either m2m_wifi_allow_p2p_connection() API in case of CONF_METHOD_PBC, or m2m_wifi_set_p2p_pin() for CONF_METHOD_DISPLAY & CONF_METHOD_KEYPAD (pin request) to allow P2P connection. However, the application can ignore the event to reject the p2p connection request. When a device is connected to WILC, a Wi-Fi notification event M2M_WIFI_RESP_CON_STATE_CHANGED is triggered. Refer to the code examples for a more illustrative example.
Functions | |
NMI_API sint8 | m2m_wifi_p2p (uint8 u8Channel, tenuP2PTrigger enuTrigger, uint16 u16WPS_CfgMehods) |
NMI_API sint8 m2m_wifi_p2p | ( | uint8 | u8Channel, |
tenuP2PTrigger | enuTrigger, | ||
uint16 | u16WPS_CfgMehods | ||
) |
[in] | u8Channel | P2P Listen RF channel. According to the P2P standard It must hold only one of the following values 1, 6 or 11. |
[in] | enuTrigger | P2P Trigger method. Could be:
|
[in] | u16WPS_CfgMehods | WSC Config methods ["Device configuration methods" in m2m_types.h] |
The code snippet shown an example of how the p2p mode operates.
References tstrM2MP2PConnect::enuTrigger, hif_send(), M2M_ERR, M2M_ERR_FAIL, M2M_REQ_GRP_WIFI, M2M_SUCCESS, M2M_WIFI_CH_1, M2M_WIFI_CH_11, M2M_WIFI_CH_6, M2M_WIFI_REQ_ENABLE_P2P, NULL, tstrM2MP2PConnect::u16WPS_CfgMethods, and tstrM2MP2PConnect::u8ListenChannel.
Referenced by os_m2m_wifi_p2p_imp().