Bluetooth Connection Steps in the Application

Let's perform the Bluetooth connection steps in the application.

  • Click on the Datasources module.
  • Then click on the + icon on the screen that opens to create a new Datasource. On the screen that opens, select the Bluetooth field and click the CREATE button by naming it.
  • In the screen that opens, there are Device Name, Device Id, Device Address fields.

Device Name: The name of the device visible to the user.

It is mandatory to enter the Device Name field.

Device ID (Identifier): Unique identification information of the device. Not every device has it.

Device Address: The physical Bluetooth address of the device.

For example, the address of a Bluetooth device can be seen as: 00:1A:2B:3C:4D:5E.

It is not mandatory to enter Device Id and Device Address.

If multiple data measurements are made between Bluetooth devices, characteristics are often used to distinguish and understand this data. Characteristics are used as a component of a particular service or data type. For example, if a temperature sensor makes multiple measurements, each measurement is transmitted under a different characteristic.

Each characteristic represents a specific type of data. For example, a characteristic may contain Temperature Data or Humidity Data. In this way, the receiving device can distinguish between these data by recognizing which characteristic represents which type of data.

While Bluetooth technology can share data between multiple data measuring devices, certain methods need to be created to distinguish what kind of data it is.

Click Add New Method to create a method.

GATT stands for Generic Attribute Profile, a key component of Bluetooth Low Energy (BLE) technology. GATT is a standard protocol that governs how BLE devices exchange and communicate data. GATT defines how BLE devices will share data, what data they will share and how it will be controlled. On the screen that opens, there are Name, Characteristic ID, Service ID, Characteristic Type fields describing the main components of GATT.

Name: This is the field where the created method name is entered.

Characteristic ID:

A number that uniquely identifies the characteristics available under Bluetooth Low Energy (BLE) services. The characteristic ID is typically used to distinguish each characteristic.

Service ID: GATT defines services that devices can use to represent specific functions or data types. Each service includes one or more characteristics. A Service ID is a service number that identifies the services of Bluetooth BLE devices. Each service contains one or more characteristics. Service ID is a unique number that identifies a service.

Characteristic Type:

Characteristics, as units under services, represent a specific function or data. Each characteristic is identified by a UUID (Universally Unique Identifier) and can allow operations such as read (Read), write (Write) or mark (Notify or Indicate).

For example, a temperature measurement characteristic represents temperature data and can allow the central device to read this data. A characteristic is a value that indicates the type or nature of the data it carries. This means that the data is temperature, humidity, pressure or some other type of measurement. The characteristic type usually corresponds to the types defined in a specific Bluetooth profile or manual. For example, Temperature Measurement.

Once the required fields have been filled in, click on the Save button to create the method.

In order for the created Method to be interpreted by the platform, actions must be created by clicking +Add Action in the Properties panel.

For example, click +Add Action→ Sub Arrayto convert the first two values read from a device into bytes (divide by 128) and convert them into temperature values. Click Symbol Picker in Sub Array.

This selection will be made because we want to read the Bluetooth value.

In the Count field, enter the value 2 since the first two values are requested.

Click +Add Action->Arithmetic→Dividefor byte conversion.

Click on the symbol picker in the value in Divide and select Action Results→Sub Arrayto call the value from the sub array.

Then type 128 in the value2 field.

Then click the CREATE button.