Windows desktop applications
Collapse the table of content
Expand the table of content
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.

RfcommDeviceService.FromIdAsync | fromIdAsync method

Gets an RfcommDeviceService object from a DeviceInformation Id for an RFCOMM service instance.

Syntax


Windows.Devices.Bluetooth.Rfcomm.RfcommDeviceService.fromIdAsync(deviceId).done( /* Your success and error handlers */ );

Parameters

deviceId

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

The DeviceInformation Id that identifies the RFCOMM service instance. This id can be retrieved from Windows.Devices.Enumeration.

Return value

Type: IAsyncOperation<RfcommDeviceService>

The RfcommDeviceService object that represents the RFCOMM service instance.

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.

If a store app has not declared the right capabilities or the user does not grant consent, the method returns a null object.

See How to specify device capabilities for Bluetooth (Windows) to declare the right capabilities.

Warning  If the device acting as the RFCOMM server does not have the correct channel registered in its manifest, this method throws an exception when called on the device acting as the RFCOMM client.
 

Requirements (Windows 10 device family)

Device family

Universal, introduced version 10.0.10240.0 [for Xbox, see UWP features that aren't yet supported on Xbox]

API contract

Windows.Foundation.UniversalApiContract, introduced version 1.0

Namespace

Windows.Devices.Bluetooth.Rfcomm
Windows::Devices::Bluetooth::Rfcomm [C++]

Metadata

Windows.Foundation.UniversalApiContract.winmd

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

Minimum supported client

Windows 8.1

Minimum supported server

None supported

Minimum supported phone

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

Namespace

Windows.Devices.Bluetooth.Rfcomm
Windows::Devices::Bluetooth::Rfcomm [C++]

Metadata

Windows.winmd

See also

RfcommDeviceService

 

 

Show:
© 2016 Microsoft