Share via


RfcommDeviceService.RequestAccessAsync Method

Definition

Used to request explicit access to the Rfcomm service. This invokes Device Consent and must be called on the UI thread. By default, unpaired devices do not require consent, while paired devices do. FromIdAsync will only display a consent prompt when called for a paired device. RequestAccessAsync allows the app to make the access request explicit in the event where the device may become paired in the future through other uses of the device.

public:
 virtual IAsyncOperation<DeviceAccessStatus> ^ RequestAccessAsync() = RequestAccessAsync;
/// [Windows.Foundation.Metadata.RemoteAsync]
IAsyncOperation<DeviceAccessStatus> RequestAccessAsync();
[Windows.Foundation.Metadata.RemoteAsync]
public IAsyncOperation<DeviceAccessStatus> RequestAccessAsync();
function requestAccessAsync()
Public Function RequestAccessAsync () As IAsyncOperation(Of DeviceAccessStatus)

Returns

After the async operation completes, returns a DeviceAccessStatus object.

Attributes

Windows requirements

Device family
Windows 10 Anniversary Edition (introduced in 10.0.14393.0 - for Xbox, see UWP features that aren't yet supported on Xbox)
API contract
Windows.Foundation.UniversalApiContract (introduced in v3.0)
App capabilities
bluetooth

Applies to