HidDevice.FromIdAsync | fromIdAsync method

Applies to Windows and Windows Phone

Opens a handle to the device identified by the deviceId parameter. The acess type is specified by the accessMode parameter.

Syntax


public:
static IAsyncOperation<HidDevice>^ FromIdAsync(
  String^ deviceId, 
  FileAccessMode accessMode
)

Parameters

deviceId

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

The DeviceInformation ID that identifies the HID device.

accessMode

Type: FileAccessMode

Specifies the access mode. The supported access modes are Read and ReadWrite.

Return value

Type: IAsyncOperation<HidDevice>

A HidDevice object.

Remarks

The first time this method is invoked by a store app, it should be called from a UI thread in order to display the consent prompt. After the user has granted consent, the method can be invoked from any application thread.

The manifest for your app must declare a specific HID device capability before you invoke this method; and, this capability must map to the capabilities of the target device.

If there is no declaration in the manifest, or, if the declaration specifies a device not supported by the HID API, this method fails with an error of E_ACCESSDENIED.

Requirements

Minimum supported client

Windows 8.1

Minimum supported server

Windows Server 2012 R2

Minimum supported phone

Windows Phone 8.1 [Windows Phone Silverlight 8.1 and Windows Runtime apps]

Namespace

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

Metadata

Windows.winmd

See also

HidDevice

 

 

Show:
© 2014 Microsoft