Class DevicePairing
- Namespace
- nanoFramework.Device.Bluetooth
- Assembly
- nanoFramework.Device.Bluetooth.dll
Contains information and enables pairing for a device.
public sealed class DevicePairing
- Inheritance
-
DevicePairing
- Inherited Members
- Extension Methods
Properties
AllowBonding
When true will allow device to be bonded. See Bonding methods. Defaults to true.
public bool AllowBonding { get; set; }
Property Value
CanPair
Gets a value that indicates whether the device can be paired. True if the device can be paired, otherwise false.
public bool CanPair { get; }
Property Value
IOCapabilities
Gets or sets the IO capabilities of the device. By default the IO capabilties are set to NoInputNoOutput which will cause Unauthenicated Just Wroks pairing.
public DevicePairingIOCapabilities IOCapabilities { get; set; }
Property Value
IsAuthenticated
Gets a value that indicates if latest pairing was Authenicated.
public bool IsAuthenticated { get; }
Property Value
IsPaired
Gets a value that indicates whether the device is currently paired. True if the device is currently paired, otherwise false.
public bool IsPaired { get; }
Property Value
OutOfBand
True if uses external method for exchange of information for pairing process. Could be predefined info in device. Defaults to false.
public bool OutOfBand { get; set; }
Property Value
ProtectionLevel
Gets or sets protection level to be used for pairing. The default value is set based on the protection level requirements in added characteristics and descriptors.
public DevicePairingProtectionLevel ProtectionLevel { get; set; }
Property Value
WasSecureConnectionUsedForPairing
Gets a value that indicates if connection was secure for pairing.
public bool WasSecureConnectionUsedForPairing { get; }
Property Value
Methods
Pair()
Attempts to initiate a pairing of device using default protecion level.
public DevicePairingResult Pair()
Returns
- DevicePairingResult
The result of the device pairing action.
Pair(DevicePairingProtectionLevel)
Attempts to pair the device using a provided level of protection.
public DevicePairingResult Pair(DevicePairingProtectionLevel minProtectionLevel)
Parameters
minProtectionLevel
DevicePairingProtectionLevelThe required level of protection to use for the pairing action.
Returns
- DevicePairingResult
The result of the pairing action.
Unpair()
Unpairs the device.
public DeviceUnpairingResult Unpair()
Returns
- DeviceUnpairingResult
The result of the unpairing action.
Events
PairingComplete
Event fired when a Pairing has completed. Check status for succesful completion and the IsPaired, IsAuthenticated.
public event DevicePairing.PairingCompleteHandler PairingComplete
Event Type
PairingRequested
Event raised when a pairing action is requested.
public event DevicePairing.DevicePairingRequestedHandler PairingRequested