Table of Contents

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

bool

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

bool

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

DevicePairingIOCapabilities

IsAuthenticated

Gets a value that indicates if latest pairing was Authenicated.

public bool IsAuthenticated { get; }

Property Value

bool

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

bool

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

bool

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

DevicePairingProtectionLevel

WasSecureConnectionUsedForPairing

Gets a value that indicates if connection was secure for pairing.

public bool WasSecureConnectionUsedForPairing { get; }

Property Value

bool

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 DevicePairingProtectionLevel

The 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

DevicePairing.PairingCompleteHandler

PairingRequested

Event raised when a pairing action is requested.

public event DevicePairing.DevicePairingRequestedHandler PairingRequested

Event Type

DevicePairing.DevicePairingRequestedHandler