Information
The topic you requested is included in another documentation set. For convenience, it's displayed below. Choose Switch to see the topic in its original location.

ServiceDevice.GetDeviceSelectorFromServiceId | getDeviceSelectorFromServiceId method

An Advanced Query Syntax (AQS) string for identifying a device service by its GUIDs. This string is passed to the FindAllAsync or CreateWatcher method.

Syntax


var string = Windows.Devices.Portable.ServiceDevice.getDeviceSelectorFromServiceId(serviceId);

Parameters

serviceId

Type: String [JavaScript] | System.Guid [.NET] | Platform::Guid [C++]

The service identifier.

Return value

Type: String [JavaScript] | System.String [.NET] | Platform::String [C++]

The AQS string.

Remarks

To access the device services, you must declare the device service in the capabilities section of the app manifest file. For a list of the GUIDs representing the device services, see Windows.Devices.Portable.

The Enumerating Common Devices tutorial explains how to use selector strings to discover available devices.

The Portable Device Services Sample demonstrates how to access the device service once you have discovered it.

Note  Access to device services using this API is only available to Windows Store device apps given privileged access to a device by the device manufacturer. For more information about Windows Store device apps, see Windows 8 Device Experience: Windows Store device apps.
 

Requirements (Windows 10 device family)

Device family

Desktop, introduced version 10.0.10240.0

API contract

Windows.Devices.Portable.PortableDeviceContract, introduced version 1.0

Namespace

Windows.Devices.Portable
Windows::Devices::Portable [C++]

Metadata

Windows.Devices.Portable.PortableDeviceContract.winmd

Requirements (Windows 8.x and Windows Phone 8.x)

Minimum supported client

Windows 8

Minimum supported server

Windows Server 2012

Minimum supported phone

None supported

Namespace

Windows.Devices.Portable
Windows::Devices::Portable [C++]

Metadata

Windows.winmd

See also

ServiceDevice
Concepts
Windows 8 Device Experience: Windows Store device apps
Samples
Portable Device Services Sample
Tutorials
Enumerating Common Devices

 

 

Show: