Delen via


RfcommDeviceService.FromIdAsync(String) Method

Definition

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

public:
 static IAsyncOperation<RfcommDeviceService ^> ^ FromIdAsync(Platform::String ^ deviceId);
/// [Windows.Foundation.Metadata.RemoteAsync]
 static IAsyncOperation<RfcommDeviceService> FromIdAsync(winrt::hstring const& deviceId);
[Windows.Foundation.Metadata.RemoteAsync]
public static IAsyncOperation<RfcommDeviceService> FromIdAsync(string deviceId);
function fromIdAsync(deviceId)
Public Shared Function FromIdAsync (deviceId As String) As IAsyncOperation(Of RfcommDeviceService)

Parameters

deviceId
String

Platform::String

winrt::hstring

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

Returns

The RfcommDeviceService object that represents the RFCOMM service instance.

Attributes

Windows requirements

App capabilities
bluetooth

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.

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.

Applies to