Skip to content

Latest commit

 

History

History
30 lines (20 loc) · 1.89 KB

wifidirectservice.md

File metadata and controls

30 lines (20 loc) · 1.89 KB
-api-id -api-type -api-device-family-note
T:Windows.Devices.WiFiDirect.Services.WiFiDirectService
winrt class
xbox

Windows.Devices.WiFiDirect.Services.WiFiDirectService

-description

Represents a Wi-Fi Direct service. This class is used by code on a device that seeks to use a Wi-Fi Direct Service, to establish a Wi-Fi Direct Service session with the service provider.

-remarks

This is one of several classes that support connecting two devices with a preference for which device should be the Group Owner. See the Windows.Devices.WiFiDirect.Service topic for a discussion of device pairing and how it can cause the Group Owner preference to be ignored (and how to fix that.)

Your code does not instantiate this class directly. Instead, your code follows this process to get an instance of this class and use it to establish a Wi-Fi Direct Service session.

  1. Use one of the GetSelector methods to get a query string for a particular service
  2. Create a DeviceWatcher that watches for Advertisers that match the query string. When an Advertiser is found, decide whether to use that Advertiser, either programmatically or by asking the user to indicate a choice.
  3. Once your Seeker has identified the desired service advertiser, call the static FromIdAsync method with the Device ID of the chosen advertiser device. FromIdAsync retrieves an instance of WiFiDirectService for the requested service on the requested device.
  4. Proceed to establish a session by calling WiFiDirectService.ConnectAsync.

-examples

-see-also