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
BluetoothAddress
Gets the device address.
public ulong BluetoothAddress { get; }
Property Value
BluetoothAddressType
Gets the address type for the Bluetooth LE device.
public BluetoothAddressType BluetoothAddressType { get; }
Property Value
ConnectionStatus
Gets the connection status of the device.
public BluetoothConnectionStatus ConnectionStatus { get; }
Property Value
Name
Gets the name of the Bluetooth LE device.
public string Name { get; }
Property Value
Pairing
Returns the Pairing object for the state of device paring.
public DevicePairing Pairing { get; }
Property Value
WasSecureConnectionUsedForPairing
Gets a boolean indicating whether the BluetoothLEDevice was paired using a Secure Connection.
public bool WasSecureConnectionUsedForPairing { get; }
Property Value
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
ulongA 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
ulongA BluetoothAddress value containing the 64-bit address of the peer Bluetooth LE device.
bluetoothAddressType
BluetoothAddressTypeA 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
GetGattServicesForUuid(Guid)
Returns the GattDeviceServices for the Bluetooth LowEnergy device with the specified UUID.
public GattDeviceServicesResult GetGattServicesForUuid(Guid serviceUuid)
Parameters
serviceUuid
GuidThe service UUID.
Returns
- GattDeviceServicesResult
GattDeviceServicesResult
Events
ConnectionStatusChanged
Occurs when the connection status for the device has changed.
public event EventHandler ConnectionStatusChanged
Event Type
GattServicesChanged
Occurs when the list of GATT services supported by the device has changed.
public event EventHandler GattServicesChanged