-api-id | -api-type | -api-device-family-note |
---|---|---|
T:Windows.Devices.WiFiDirect.WiFiDirectDevice |
winrt class |
xbox |
Manages connections to associated Wi-Fi Direct devices.
You can use the WiFiDirectDevice class to establish a socket connection with other devices that have a Wi-Fi Direct (WFD) capable device. You can call the GetDeviceSelector method to get the device identifier for a Wi-Fi Direct device. Once you have a reference to a WiFiDirectDevice on your computer, you can call the GetConnectionEndpointPairs method to get an EndpointPair object and establish a socket connection using the Windows.Networking.Sockets API.
You can add a handler for the ConnectionStatusChanged event to be notified when the connection has been established or disconnected.
Only one app can be connected to a Wi-Fi Direct device at a time.
You must enable the Proximity capability to communicate with Wi-Fi Direct devices.
[!code-csharp2]