BluetoothLEDevice BluetoothLEDevice BluetoothLEDevice BluetoothLEDevice BluetoothLEDevice Class

Definition

Represents a Bluetooth LE device.

public : sealed class BluetoothLEDevice : IBluetoothLEDevice, IBluetoothLEDevice2, IBluetoothLEDevice3, IBluetoothLEDevice4, IBluetoothLEDevice5, IClosable
struct winrt::Windows::Devices::Bluetooth::BluetoothLEDevice : IBluetoothLEDevice, IBluetoothLEDevice2, IBluetoothLEDevice3, IBluetoothLEDevice4, IBluetoothLEDevice5, IClosable
public sealed class BluetoothLEDevice : IBluetoothLEDevice, IBluetoothLEDevice2, IBluetoothLEDevice3, IBluetoothLEDevice4, IBluetoothLEDevice5, IDisposable
Public NotInheritable Class BluetoothLEDevice Implements IBluetoothLEDevice, IBluetoothLEDevice2, IBluetoothLEDevice3, IBluetoothLEDevice4, IBluetoothLEDevice5, IDisposable
// This class does not provide a public constructor.
Attributes

Windows 10 requirements

Device family
Windows 10 (introduced v10.0.10240.0 - for Xbox, see UWP features that aren't yet supported on Xbox)
API contract
Windows.Foundation.UniversalApiContract (introduced v1)
Capabilities
bluetooth

Properties

Appearance Appearance Appearance Appearance Appearance

Gets the BluetoothLEAppearance object for the Bluetooth LE device.

BluetoothAddress BluetoothAddress BluetoothAddress BluetoothAddress BluetoothAddress

Gets the device address.

BluetoothAddressType BluetoothAddressType BluetoothAddressType BluetoothAddressType BluetoothAddressType

Gets the address type for the Bluetooth LE device.

BluetoothDeviceId BluetoothDeviceId BluetoothDeviceId BluetoothDeviceId BluetoothDeviceId

Gets the bluetooth device ID.

ConnectionStatus ConnectionStatus ConnectionStatus ConnectionStatus ConnectionStatus

Gets the connection status of the device.

DeviceAccessInformation DeviceAccessInformation DeviceAccessInformation DeviceAccessInformation DeviceAccessInformation

Gets the DeviceAccessInformation.

DeviceId DeviceId DeviceId DeviceId DeviceId

Gets the device Id.

DeviceInformation DeviceInformation DeviceInformation DeviceInformation DeviceInformation

Gets the DeviceInformation object for the Bluetooth LE device.

GattServices GattServices GattServices GattServices GattServices

Gets the read-only list of GATT services supported by the device.

Name Name Name Name Name

Gets the name of the Bluetooth LE device.

WasSecureConnectionUsedForPairing WasSecureConnectionUsedForPairing WasSecureConnectionUsedForPairing WasSecureConnectionUsedForPairing WasSecureConnectionUsedForPairing

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

Methods

Close() Close() Close() Close() Close()

Closes this Bluetooth LE device. This may close the connection to the device if this is the only app with a connection.

Dispose() Dispose() Dispose() Dispose() Dispose()

Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resources.

FromBluetoothAddressAsync(UInt64) FromBluetoothAddressAsync(UInt64) FromBluetoothAddressAsync(UInt64) FromBluetoothAddressAsync(UInt64) FromBluetoothAddressAsync(UInt64)

Returns a BluetoothLEDevice object for the given BluetoothAddress and initiates a connection.

FromBluetoothAddressAsync(UInt64, BluetoothAddressType) FromBluetoothAddressAsync(UInt64, BluetoothAddressType) FromBluetoothAddressAsync(UInt64, BluetoothAddressType) FromBluetoothAddressAsync(UInt64, BluetoothAddressType) FromBluetoothAddressAsync(UInt64, BluetoothAddressType)

Returns a BluetoothLEDevice object for the given BluetoothAddress value and BluetoothAddressType value and initiates a connection.

FromIdAsync(String) FromIdAsync(String) FromIdAsync(String) FromIdAsync(String) FromIdAsync(String)

Returns a BluetoothLEDevice object for the given Id and initiate a connection.

GetDeviceSelector() GetDeviceSelector() GetDeviceSelector() GetDeviceSelector() GetDeviceSelector()

Gets an Advanced Query Syntax (AQS) string for identifying all Bluetooth Low Energy (LE) devices. This string is passed to the FindAllAsync or CreateWatcher method in order to get a list of Bluetooth LE devices.

GetDeviceSelectorFromAppearance(BluetoothLEAppearance) GetDeviceSelectorFromAppearance(BluetoothLEAppearance) GetDeviceSelectorFromAppearance(BluetoothLEAppearance) GetDeviceSelectorFromAppearance(BluetoothLEAppearance) GetDeviceSelectorFromAppearance(BluetoothLEAppearance)

Creates an Advanced Query Syntax (AQS) filter string from a BluetoothLEAppearance object. The AQS string is passed into the CreateWatcher method to return a collection of DeviceInformation objects with the specified appearance.

GetDeviceSelectorFromBluetoothAddress(UInt64) GetDeviceSelectorFromBluetoothAddress(UInt64) GetDeviceSelectorFromBluetoothAddress(UInt64) GetDeviceSelectorFromBluetoothAddress(UInt64) GetDeviceSelectorFromBluetoothAddress(UInt64)

Creates an Advanced Query Syntax (AQS) filter string from a 64-bit address that represents a Bluetooth LE device. The AQS string is passed into the CreateWatcher method to return a collection of DeviceInformation objects.

GetDeviceSelectorFromBluetoothAddress(UInt64, BluetoothAddressType) GetDeviceSelectorFromBluetoothAddress(UInt64, BluetoothAddressType) GetDeviceSelectorFromBluetoothAddress(UInt64, BluetoothAddressType) GetDeviceSelectorFromBluetoothAddress(UInt64, BluetoothAddressType) GetDeviceSelectorFromBluetoothAddress(UInt64, BluetoothAddressType)

Creates an Advanced Query Syntax (AQS) filter string from a 64-bit address and address type that represents a Bluetooth LE device. The AQS string is passed into the CreateWatcher method.

GetDeviceSelectorFromConnectionStatus(BluetoothConnectionStatus) GetDeviceSelectorFromConnectionStatus(BluetoothConnectionStatus) GetDeviceSelectorFromConnectionStatus(BluetoothConnectionStatus) GetDeviceSelectorFromConnectionStatus(BluetoothConnectionStatus) GetDeviceSelectorFromConnectionStatus(BluetoothConnectionStatus)

Creates an Advanced Query Syntax (AQS) filter string that contains a query for Bluetooth LE devices with the indicated BluetoothConnectionStatus. The AQS string is passed into the CreateWatcher method to return a collection of DeviceInformation objects with the indicated Bluetooth connection status.

GetDeviceSelectorFromDeviceName(String) GetDeviceSelectorFromDeviceName(String) GetDeviceSelectorFromDeviceName(String) GetDeviceSelectorFromDeviceName(String) GetDeviceSelectorFromDeviceName(String)

Creates an Advanced Query Syntax (AQS) filter string that contains a query for the Bluetooth LE device name. The AQS string is passed into the CreateWatcher method to return a collection of DeviceInformation objects containing the specified Bluetooth LE device name.

GetDeviceSelectorFromPairingState(Boolean) GetDeviceSelectorFromPairingState(Boolean) GetDeviceSelectorFromPairingState(Boolean) GetDeviceSelectorFromPairingState(Boolean) GetDeviceSelectorFromPairingState(Boolean)

Creates an Advanced Query Syntax (AQS) filter string that contains a query for Bluetooth LE devices that are either paired or unpaired. The AQS string is passed into the CreateWatcher method to return a collection of DeviceInformation objects.

GetGattService(Guid) GetGattService(Guid) GetGattService(Guid) GetGattService(Guid) GetGattService(Guid)

Returns the GATT service with the given service Id.

GetGattServicesAsync() GetGattServicesAsync() GetGattServicesAsync() GetGattServicesAsync() GetGattServicesAsync()

Gets the GattDeviceServices for this Bluetooth LowEnergy device.

GetGattServicesAsync(BluetoothCacheMode) GetGattServicesAsync(BluetoothCacheMode) GetGattServicesAsync(BluetoothCacheMode) GetGattServicesAsync(BluetoothCacheMode) GetGattServicesAsync(BluetoothCacheMode)

Returns the GattDeviceServices for this Bluetooth LowEnergy device with the specified cache mode.

GetGattServicesForUuidAsync(Guid) GetGattServicesForUuidAsync(Guid) GetGattServicesForUuidAsync(Guid) GetGattServicesForUuidAsync(Guid) GetGattServicesForUuidAsync(Guid)

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

GetGattServicesForUuidAsync(Guid, BluetoothCacheMode) GetGattServicesForUuidAsync(Guid, BluetoothCacheMode) GetGattServicesForUuidAsync(Guid, BluetoothCacheMode) GetGattServicesForUuidAsync(Guid, BluetoothCacheMode) GetGattServicesForUuidAsync(Guid, BluetoothCacheMode)

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

RequestAccessAsync() RequestAccessAsync() RequestAccessAsync() RequestAccessAsync() RequestAccessAsync()

Requests access to the Bluetooth LowEnergy device.

Events

ConnectionStatusChanged ConnectionStatusChanged ConnectionStatusChanged ConnectionStatusChanged ConnectionStatusChanged

Occurs when the connection status for the device has changed.

GattServicesChanged GattServicesChanged GattServicesChanged GattServicesChanged GattServicesChanged

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

NameChanged NameChanged NameChanged NameChanged NameChanged

Occurs when the name of the device has changed.

See also