DeviceInformationPairing.PairAsync Method
Definition
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
Overloads
PairAsync() |
Attempts to pair the device. |
PairAsync(DevicePairingProtectionLevel) |
Attempts to pair the device using a provided level of protection. |
PairAsync(DevicePairingProtectionLevel, IDevicePairingSettings) |
Attempts to pair a device object with a specified protection level and custom settings. |
PairAsync()
Attempts to pair the device.
public:
virtual IAsyncOperation<DevicePairingResult ^> ^ PairAsync() = PairAsync;
/// [Windows.Foundation.Metadata.Overload("PairAsync")]
/// [Windows.Foundation.Metadata.RemoteAsync]
IAsyncOperation<DevicePairingResult> PairAsync();
[Windows.Foundation.Metadata.Overload("PairAsync")]
[Windows.Foundation.Metadata.RemoteAsync]
public IAsyncOperation<DevicePairingResult> PairAsync();
function pairAsync()
Public Function PairAsync () As IAsyncOperation(Of DevicePairingResult)
Returns
The result of the pairing action.
- Attributes
See also
Applies to
PairAsync(DevicePairingProtectionLevel)
Attempts to pair the device using a provided level of protection.
public:
virtual IAsyncOperation<DevicePairingResult ^> ^ PairAsync(DevicePairingProtectionLevel minProtectionLevel) = PairAsync;
/// [Windows.Foundation.Metadata.Overload("PairWithProtectionLevelAsync")]
/// [Windows.Foundation.Metadata.RemoteAsync]
IAsyncOperation<DevicePairingResult> PairAsync(DevicePairingProtectionLevel const& minProtectionLevel);
[Windows.Foundation.Metadata.Overload("PairWithProtectionLevelAsync")]
[Windows.Foundation.Metadata.RemoteAsync]
public IAsyncOperation<DevicePairingResult> PairAsync(DevicePairingProtectionLevel minProtectionLevel);
function pairAsync(minProtectionLevel)
Public Function PairAsync (minProtectionLevel As DevicePairingProtectionLevel) As IAsyncOperation(Of DevicePairingResult)
Parameters
- minProtectionLevel
- DevicePairingProtectionLevel
The required level of protection to use for the pairing action.
Returns
The result of the pairing action.
- Attributes
Remarks
For all protocols other than Bluetooth, the minProtectionLevel value is ignored and the default behavior is always assumed. For the Bluetooth protocol, the pairing attempt will fail if the device doesn’t support the specified minimum protection level or a higher level. If the device doesn’t support the specified minimum protection level but does support a higher protection level, the higher protection level is used.
See also
Applies to
PairAsync(DevicePairingProtectionLevel, IDevicePairingSettings)
Attempts to pair a device object with a specified protection level and custom settings.
public:
virtual IAsyncOperation<DevicePairingResult ^> ^ PairAsync(DevicePairingProtectionLevel minProtectionLevel, IDevicePairingSettings ^ devicePairingSettings) = PairAsync;
/// [Windows.Foundation.Metadata.Overload("PairWithProtectionLevelAndSettingsAsync")]
/// [Windows.Foundation.Metadata.RemoteAsync]
IAsyncOperation<DevicePairingResult> PairAsync(DevicePairingProtectionLevel const& minProtectionLevel, IDevicePairingSettings const& devicePairingSettings);
[Windows.Foundation.Metadata.Overload("PairWithProtectionLevelAndSettingsAsync")]
[Windows.Foundation.Metadata.RemoteAsync]
public IAsyncOperation<DevicePairingResult> PairAsync(DevicePairingProtectionLevel minProtectionLevel, IDevicePairingSettings devicePairingSettings);
function pairAsync(minProtectionLevel, devicePairingSettings)
Public Function PairAsync (minProtectionLevel As DevicePairingProtectionLevel, devicePairingSettings As IDevicePairingSettings) As IAsyncOperation(Of DevicePairingResult)
Parameters
- minProtectionLevel
- DevicePairingProtectionLevel
The required level of protection to use for the pairing action.
- devicePairingSettings
- IDevicePairingSettings
The custom device pairing settings.
Returns
The result of the pairing action.
- Attributes
Windows requirements
Device family |
Windows 10 (introduced in 10.0.10586.0)
|
API contract |
Windows.Foundation.UniversalApiContract (introduced in v2.0)
|
Remarks
For all protocols other than Bluetooth, the minProtectionLevel value is ignored and the default behavior is always assumed. For the Bluetooth protocol, the pairing attempt will fail if the device doesn’t support the specified minimum protection level or a higher level. If the device doesn’t support the specified minimum protection level but does support a higher protection level, the higher protection level is used.