public class WifiP2pCallback extends Object
Your application can implement the callbacks as needed.
| 构造器 | 说明 |
|---|---|
WifiP2pCallback() |
| 限定符和类型 | 方法 | 说明 |
|---|---|---|
void |
eventExecFail(int reason) |
Called when the Wi-Fi P2P request fails.
|
void |
eventExecOk() |
Called when the Wi-Fi P2P request succeeds.
|
void |
eventP2pControllerDisconnected() |
Called when the Wi-Fi P2P controller is disconnected.
|
void |
eventP2pDevice(WifiP2pDevice p2pDevice) |
Called when the Wi-Fi P2P device information becomes available.
|
void |
eventP2pDevicesList(List<WifiP2pDevice> devices) |
Called when the list of available Wi-Fi P2P devices is obtained.
|
void |
eventP2pGroup(WifiP2pGroup group) |
Called when the Wi-Fi P2P group information becomes available.
|
void |
eventP2pNetwork(WifiP2pNetworkInfo networkInfo) |
Called when the Wi-Fi P2P network information becomes available.
|
public void eventExecFail(int reason)
reason - Indicates the cause of the Wi-Fi P2P request failure.public void eventExecOk()
public void eventP2pGroup(WifiP2pGroup group)
Your application can use WifiP2pController#requestP2pInfo(int, WifiP2pCallback)
to request the Wi-Fi P2P group information.
The request ID used to obtain the Wi-Fi P2P group information
is WifiP2pController#GROUP_INFO_REQUEST.
group - Indicates the Wi-Fi P2P group information, which is defined in WifiP2pGroup.public void eventP2pDevice(WifiP2pDevice p2pDevice)
Your application can use WifiP2pController#requestP2pInfo(int, WifiP2pCallback)
to request the Wi-Fi P2P device information.
The request ID used to obtain the Wi-Fi P2P device information
is WifiP2pController#DEVICE_INFO_REQUEST.
p2pDevice - Indicates the Wi-Fi P2P device information, which is defined in WifiP2pDevice.public void eventP2pDevicesList(List<WifiP2pDevice> devices)
Your application can use WifiP2pController#requestP2pInfo(int, WifiP2pCallback)
to request the list of available Wi-Fi P2P devices.
The request ID used to obtain the list of available Wi-Fi P2P devices
is WifiP2pController#DEVICE_LIST_REQUEST.
devices - Indicates the list of available Wi-Fi P2P devices, which is defined in WifiP2pDevice.public void eventP2pNetwork(WifiP2pNetworkInfo networkInfo)
Your application can use WifiP2pController#requestP2pInfo(int, WifiP2pCallback)
to request the Wi-Fi P2P network information.
The request ID used to obtain the Wi-Fi P2P network information
is WifiP2pController#NETWORK_INFO_REQUEST.
networkInfo - Indicates the Wi-Fi P2P network information, which is defined in WifiP2pNetworkInfo.public void eventP2pControllerDisconnected()
After the Wi-Fi P2P controller is disconnected, all Wi-Fi P2P callbacks are deregistered and cannot be used to obtain P2P information.