Windows bluetooth le api

Windows. Devices. Bluetooth Namespace

Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.

The Windows.Devices.Bluetooth namespace defines a set of Windows Runtime API that allows UWP app and desktop apps to interact with Bluetooth devices. For more information, see Bluetooth.

Classes

Represents a Bluetooth adapter.

Provides functionality to determine the Bluetooth Class Of Device (Bluetooth COD) information for a device.

Represents a Bluetooth device.

Represents a bluetooth device ID.

Provides functionality to determine the Bluetooth Low Energy (LE) Appearance information for a device. To get an instance of this class, call the BluetoothLEAppearance.FromRawValue method or the BluetoothLEAppearance.FromParts method.

Indicates the appearance category code of the Bluetooth LE device.

Indicates the appearance subcategory code of the Bluetooth LE device. For more info on how sub categories map to categories, see the Bluetooth Specification.

Represents Bluetooth LE connection parameters.

For more information on connection parameters and PHY, please reference the Bluetooth Core Specification.

Used to retrieve info about about the Bluetooth LE physical layer (PHY).

For more information on connection parameters and PHY, please reference the Bluetooth Core Specification.

Represents info about the Bluetooth LE physical layer (PHY).

For more information on connection parameters and PHY, please reference the Bluetooth Core Specification.

Represents a Bluetooth LE device.

Represents Bluetooth LE preferred connection parameters.

For more information on connection parameters and PHY, please reference the Bluetooth Core Specification.

Represents a Bluetooth LE preferred connection parameters request.

For more information on connection parameters and PHY, please reference the Bluetooth Core Specification.

Groups parameters used to configure received signal strength indicator (RSSI)-based filtering.

A helper class that provides methods to convert between bluetooth device UUID and short ID.

Enums

Describes the Bluetooth address type.

Indicates whether applicable Bluetooth API methods should operate on values cached in the system, or whether they should retrieve those values from the Bluetooth device. See Remarks in the member topic.

Indicates the connection status of the device.

Specifies common Bluetooth error cases.

Defines constants that specify the status of a Bluetooth LE preferred connection parameters request.

For more information on connection parameters and PHY, please reference the Bluetooth Core Specification.

Читайте также:  Как удалить toshiba bluetooth

Indicates the Major Class code of the device, which is the general family of device with which the device is associated.

Indicates the Minor Class code of the device. These are interpreted in the context of the Major Class codes.

Indicates the service capabilities of a device.

See also

Источник

Bluetooth LEDevice Class

Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.

Represents a Bluetooth LE device.

public ref class BluetoothLEDevice sealed : IClosable
/// [Windows.Foundation.Metadata.ContractVersion(Windows.Foundation.UniversalApiContract, 65536)] /// [Windows.Foundation.Metadata.MarshalingBehavior(Windows.Foundation.Metadata.MarshalingType.Agile)] /// [Windows.Foundation.Metadata.Threading(Windows.Foundation.Metadata.ThreadingModel.Both)] class BluetoothLEDevice final : IClosable
[Windows.Foundation.Metadata.ContractVersion(typeof(Windows.Foundation.UniversalApiContract), 65536)] [Windows.Foundation.Metadata.MarshalingBehavior(Windows.Foundation.Metadata.MarshalingType.Agile)] [Windows.Foundation.Metadata.Threading(Windows.Foundation.Metadata.ThreadingModel.Both)] public sealed class BluetoothLEDevice : System.IDisposable
Public NotInheritable Class BluetoothLEDevice Implements IDisposable

Windows requirements

Windows 10 (introduced in 10.0.10240.0 — for Xbox, see UWP features that aren’t yet supported on Xbox)

Remarks

Version history

Windows version SDK version Value added
1511 10586 Appearance
1511 10586 BluetoothAddressType
1511 10586 DeviceInformation
1511 10586 FromBluetoothAddressAsync(UInt64,BluetoothAddressType)
1511 10586 GetDeviceSelectorFromAppearance
1511 10586 GetDeviceSelectorFromBluetoothAddress(UInt64)
1511 10586 GetDeviceSelectorFromBluetoothAddress(UInt64,BluetoothAddressType)
1511 10586 GetDeviceSelectorFromConnectionStatus
1511 10586 GetDeviceSelectorFromDeviceName
1511 10586 GetDeviceSelectorFromPairingState
1703 15063 DeviceAccessInformation
1703 15063 GetGattServicesAsync
1703 15063 GetGattServicesAsync(BluetoothCacheMode)
1703 15063 GetGattServicesForUuidAsync(Guid)
1703 15063 GetGattServicesForUuidAsync(Guid,BluetoothCacheMode)
1703 15063 RequestAccessAsync
1709 16299 BluetoothDeviceId
1803 17134 WasSecureConnectionUsedForPairing

Properties

Gets the BluetoothLEAppearance object for the Bluetooth LE device.

Gets the address type for the Bluetooth LE device.

Gets the bluetooth device ID.

Gets the connection status of the device.

Gets the DeviceAccessInformation.

Gets the device information for the Bluetooth LE device.

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

The GattServices API is deprecated, and it may not be available in future versions of Windows. Instead, use GetGattServicesAsync.

Gets the name of the Bluetooth LE device.

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

Methods

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

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

Returns a BluetoothLEDevice object representing the peer Bluetooth LE device with the given address. See Remarks (in this member topic).

Returns a BluetoothLEDevice object representing the peer device with the given address and address type. See Remarks (in this member topic).

Returns a BluetoothLEDevice object for the given Id. See Remarks in the member topic.

Retrieves connection parameters for the remote device. If multiple apps or other system scenarios also request these parameters, then the system automatically combines the parameters, where compatible, based on system priority.

Читайте также:  Наушники беспроводные сони bluetooth накладные

When the device is not connected, the connection parameters are invalid (all zero).

Retrieves info about about the Bluetooth LE physical layer (PHY).

When the device is not connected, the connection PHYs are invalid (all false)

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.

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.

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.

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.

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.

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.

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.

Returns the GATT service with the given service Id.

The GetGattService API is deprecated, and it may not be available in future versions of Windows. Instead, use GetGattServicesAsync.

Gets the GattDeviceServices for this Bluetooth LowEnergy device.

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

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

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

Requests access to the Bluetooth LowEnergy device.

Retrieves a Bluetooth LE preferred connection parameters request object for the specified Bluetooth LE preferred connection parameters object.

Events

An event that’s raised when the current connection parameters for the device change. The parameters will update only after a connection to the device has been established.

Читайте также:  Блютуз наушники sony wh 1000xm3

An event that’s raised when the current PHY for the device changes. The PHY will update only after a connection to the device has been established.

Occurs when the connection status for the device has changed.

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

Occurs when the name of the device has changed.

Applies to

See also

Источник

Bluetooth Low Energy sample

Shows how to use the Windows Bluetooth LE APIs to act either as a BLE client or server.

Note: This sample is part of a large collection of UWP feature samples. You can download this sample as a standalone ZIP file from docs.microsoft.com, or you can download the entire collection as a single ZIP file, but be sure to unzip everything to access shared dependencies. For more info on working with the ZIP file, the samples collection, and GitHub, see Get the UWP samples from GitHub. For more samples, see the Samples portal on the Windows Dev Center.

Client

Shows how to act as a client to communicate with a Bluetooth Low Energy (LE) device using the Bluetooth GATT protocol. Acts as a GATT client to access nearby GATT servers like heart rate sensors or temperature sensors.

Specifically, this sample shows how to:

  • Enumerate nearby Bluetooth LE devices
  • Query for supported services
  • Query for supported characteristics
  • Read and write data
  • Subscribe to indicate and notify events

Server

As of build 15003 and above, Bluetooth LE GATT Server APIs are available. This sample can be used to advertise support for CalcService — a custom service that allows a remote client to write to two operand characteristics and an operator and read the result.

This samples shows how to:

  • Initialize and publish a custom service/characteristic hierarchy
  • Implement event handlers to handle incoming read/write requests
  • Notify connected clients of a characteristic value change

More Details

Search for «BT_Code» to find the portions of the sample that are particularly relevant to Bluetooth. Note in particular the «bluetooth» capability declaration in the manifest.

Note The Windows universal samples require Visual Studio to build and Windows 10 to execute.

To obtain information about Windows 10 development, go to the Windows Dev Center

To obtain information about Microsoft Visual Studio and the tools for developing Windows apps, go to Visual Studio

Источник

Оцените статью
Adblock
detector