Table of Contents

Class BluetoothLEDevice

Namespace
nanoFramework.Device.Bluetooth
Assembly
nanoFramework.Device.Bluetooth.dll

Represents a Bluetooth LE device.

public class BluetoothLEDevice : IDisposable
Inheritance
BluetoothLEDevice
Implements
Inherited Members
Extension Methods

Properties

Appearance

Gets the appearance of the Bluetooth LE device.

public ushort Appearance { get; }

Property Value

ushort

BluetoothAddress

Gets the device address.

public ulong BluetoothAddress { get; }

Property Value

ulong

BluetoothAddressType

Gets the address type for the Bluetooth LE device.

public BluetoothAddressType BluetoothAddressType { get; }

Property Value

BluetoothAddressType

ConnectionStatus

Gets the connection status of the device.

public BluetoothConnectionStatus ConnectionStatus { get; }

Property Value

BluetoothConnectionStatus

Name

Gets the name of the Bluetooth LE device.

public string Name { get; }

Property Value

string

Pairing

Returns the Pairing object for the state of device paring.

public DevicePairing Pairing { get; }

Property Value

DevicePairing

WasSecureConnectionUsedForPairing

Gets a boolean indicating whether the BluetoothLEDevice was paired using a Secure Connection.

public bool WasSecureConnectionUsedForPairing { get; }

Property Value

bool

Methods

Close()

Closes the connection to the Bluetooth LE device.

public void Close()

Dispose()

Dispose BluetoothLEDevice

public void Dispose()

Dispose(bool)

Dispose BluetoothLEDevice

protected virtual void Dispose(bool disposing)

Parameters

disposing bool

Finalize()

Finalizer - dispose

protected override void Finalize()

FromBluetoothAddress(ulong)

Returns a BluetoothLEDevice object representing the peer Bluetooth LE device with the given address.

public static BluetoothLEDevice FromBluetoothAddress(ulong bluetoothAddress)

Parameters

bluetoothAddress ulong

A BluetoothAddress value containing the 64-bit address of the peer Bluetooth LE device.

Returns

BluetoothLEDevice

BluetoothLEDevice object representing the peer Bluetooth LE device with the given address.

FromBluetoothAddress(ulong, BluetoothAddressType)

Returns a BluetoothLEDevice object representing the peer device with the given address and address type. See Remarks.

public static BluetoothLEDevice FromBluetoothAddress(ulong bluetoothAddress, BluetoothAddressType bluetoothAddressType)

Parameters

bluetoothAddress ulong

A BluetoothAddress value containing the 64-bit address of the peer Bluetooth LE device.

bluetoothAddressType BluetoothAddressType

A BluetoothAddressType value containing the address type of the peer Bluetooth LE device.

Returns

BluetoothLEDevice

Returns a BluetoothLEDevice object representing the peer device with the given address and address type.

GetGattServices()

Gets the GattDeviceServices for this Bluetooth LowEnergy device.

public GattDeviceServicesResult GetGattServices()

Returns

GattDeviceServicesResult

GetGattServicesForUuid(Guid)

Returns the GattDeviceServices for the Bluetooth LowEnergy device with the specified UUID.

public GattDeviceServicesResult GetGattServicesForUuid(Guid serviceUuid)

Parameters

serviceUuid Guid

The service UUID.

Returns

GattDeviceServicesResult

GattDeviceServicesResult

Events

ConnectionStatusChanged

Occurs when the connection status for the device has changed.

public event EventHandler ConnectionStatusChanged

Event Type

EventHandler

GattServicesChanged

Occurs when the list of GATT services supported by the device has changed.

public event EventHandler GattServicesChanged

Event Type

EventHandler