Bluetooth

As part of the Dell Edge Gateway IoT Solutions, IOTech provides a Bluetooth Device Service that supports Generic Attribute Profile (GATT) Bluetooth devices. This allows Edge Xpert to read data from, and issue commands to, GATT Bluetooth devices.

The Bluetooth Device Service provides a means of integrating Bluetooth device services with Edge Xpert. For more information about Bluetooth, refer to the Bluetooth Special Interest Group (SIG) website.

The Edge Xpert Bluetooth Device Service uses the BlueZ stack, which is the official Linux Bluetooth protocol stack. BlueZ is an open-source project, and is distributed under GNU Public License (GPL). The BlueZ kernel has been part of the official Linux kernel since version 2.4.6. The BlueZ Linux module must be installed on the host to support connections between the Device Service and Bluetooth devices using D-Bus.

Edge Xpert uses the D-Bus protocol to communicate with BlueZ to read and write data with Gatt Bluetooth devices. D-Bus is an Inter-Process Communication (IPC) and Remote Procedure Classing (RPC) mechanism, which was specifically designed for efficient and easy-to-use communication between processes running on the same machine. D-Bus daemon must be running on the host with the Device Service to allow communication between the Bluetooth Device Service and the BlueZ daemon.

The Bluetooth Device Service is designed for the Dell 3002 Gateway. It can be used with any GATT devices that are compliant with Bluetooth 5.0.

The Bluetooth Device Service supports the following key features:

  • Discovery of all Bluetooth devices that meet the following criteria:
    • Within range
    • Advertising connectability
    • Advertising name
  • Connecting to a device that meets the above criteria
  • Reading the value of the specified device characteristic
  • Writing the value of the specified device characteristic
  • Disconnecting from the device

The Bluetooth Device Service supports the following data types:

  • Boolean
  • String
  • Binary
  • UInt8, UInt16, UInt32, UInt64
  • Int8, Int16, Int32, Int64
  • Float32
  • Float64

Bluetooth Attributes

The device profile defines what resources are available on a particular device. Ensure that the following profile attributes are defined in the YAML file:

Required Profile Attributes
Attribute Description
characteristicUuid The Universally Unique Identifier (UUID) of the characteristic. The UUID format is separated by dashes as illustrated below
attributes:
   { characteristicUuid: "f000aa72-0451-4000-b000-000000000000" }

For further information on the characteristic UUID, refer to the Bluetooth device specification.

GATT Characteristics

Some GATT characteristics are Vendor-specific and do not follow the Bluetooth GATT standard data types. Some of these devices return data in a final readable format, such as an Integer or a Float. However, some do not, and the data must be converted to a readable format that can be used with Edge Xpert. To address this, a conversion function can be created, as described in the following topic:

Bluetooth Examples

The following examples illustrate how the Bluetooth Device Service can be used:

These examples assume that the Edge Xpert services are running with at least the --xpert-manager and --device-bluetooth parameters. A suitable command would be as follows:

edgexpert up --xpert-manager --device-bluetooth

Note

All examples require a physical Bluetooth device connected to a compatible gateway. In our examples, we have used the CC2650 Sensor Tag. You will need to edit the profile and configuration files with the correct values for your device.