E-mail: info@hyxkiot.com Call: +86 18664368785
Your Location:Home > News > Industry News

Bluetooth Service and UUID Introduction

Release date:2022-5-24 23:32:20

Bluetooth is a technology that uses radio communication to complete the communication and data exchange between devices. The commonly used devices such as Bluetooth headsets, Bluetooth printers, Bluetooth bracelets, and Bluetooth mice are all devices that provide certain (or more) specific functions to the outside world based on Bluetooth communication technology. Therefore, Bluetooth itself does not provide services (application functions), it is just a data (information) transmission method (or channel), and the functions provided by the device are provided by various programs in the device. Provided, this program function is called service. Both the Bluetooth headset and the wired headset provide the function of audio playback, the difference lies in the way of communication.

Bluetooth Service

Components of a Bluetooth Service

A device that uses Bluetooth to provide external services needs to have corresponding service functions, such as a Bluetooth headset, which needs to provide the function of audio playback. This specific function is the Bluetooth service. This service is divided into three parts: Service, Characteristic, and Property:

 

Service

Service can be understood as a room. When the room is empty, it is nothing and cannot provide any service functions. Therefore, there needs to be at least one or more furniture in the room. Different furniture has different functions. This is the Characteristic. Different Service should have different numbers (UUID) to distinguish different services. Just like we have different rooms such as bedroom, kitchen, study, etc. In order to unify, we define their own numbers for these rooms with different functions. We assume that the bedroom number is 0001. No matter which company builds the bedroom, it must use 0001 To indicate that this is the bedroom, when the guest needs to rest, he only needs to find the room numbered 0001. That way, whether the room is named in English, French, or German, we know it's the bedroom.

 

Characteristic

Characteristic is attached to Service, just like the bed in the bedroom, the bedroom does not allow us to sleep and rest, it is the bed that really allows us to sleep and rest. In the bedroom, in addition to the bed, we can usually put the dresser, wardrobe and other related furniture, each piece of furniture can provide different functions related to it. Similarly, we need to assign a number to each piece of furniture, which is the UUID of the characteristic. We know that each type of furniture will have one or more different sub-functions, and this sub-function is the property contained in the characteristic.

 

Property

The usual properties are as follows:

Read: Read property, the property with this property is readable, that is to say, this property allows the mobile phone to read some information. The mobile phone can send an instruction to read a certain information with the read attribute UUID.


Notify: Notification property, the feature with this property can send notifications, that is to say, the characteristic with this property can actively send information to the mobile phone.


Write: Write property, the feature with this property can receive write data. The mobile phone sends data to the blue module through this property. After the Write is completed, this property will send a feedback of the writing completion result to the mobile phone, and then the mobile phone can write the next packet or process subsequent services. After writing a packet of data, this property needs to wait for the application layer to return the writing result, the speed is relatively slow.


Write Without Response: just write, do not need to return the result of the write, the feature of this property is that it does not need the application layer to return, it is completely completed by the protocol layer, and the speed is fast, but when the writing speed exceeds the protocol processing speed, packets will be lost.

 

What is UUID

When talking about Bluetooth services, we mentioned UUID many times. This UUID (Universally Unique Identifier) is used to identify Bluetooth services and communication feature access attributes. Different Bluetooth services and attributes use different access methods, just like people communicate in language, the same language can communicate normally (find the correct UUID to use the correct function).

bluetooth uuid

UUID is a number, a unique number corresponding to different services, used to distinguish different services and individuals with service characteristics. Services and features have their own UUID. It is very similar to the port number in network applications, for example, 80 is the port of the HTTP protocol, which provides HTTP services. In order to clarify the standard Bluetooth service, the Bluetooth SIG defines the UUID to share a basic UUID: 0x0000xxxx-0000-1000-8000-00805F9B34FB. 128 bits in total, to further simplify the base UUID, each Bluetooth SIG-defined attribute has a unique 16-bit UUID in place of the 'x' part of the base UUID above. Using 16-bit UUID is easy to remember and operate. For example, SIG defines the 16-bit UUID of "Device Information" as 0x180A. No matter what kind of Bluetooth device, as long as you provide the service function of Device Information, you must use the UUID number of "0x180A". In this way, when the application needs to read the device information of the Bluetooth device, it only needs to find the service with the corresponding UUID number of 0x180A, and then it can be obtained.

 

Different Bluetooth services define "feature fields" for data access, allowing to define different feature attributes of read, write, and notification to realize read and write operations of corresponding channels, and "feature fields" also use UUID to uniquely identify, such as The SIG defines the "Manufacture Name String" implementation "Read" property under the "Device Information" service, and its 16-bit UUID is 0x2A29.

It can be seen that the Bluetooth service UUID and service feature fields play a very important role in the Bluetooth service interaction process, and the SIG standard allows users to customize services, using 128 bits to complete Bluetooth services, and 128-bit feature field definitions.

 

Bluetooth is a wireless communication technology;

Bluetooth devices use Bluetooth communication technology to achieve specific functions. There needs to be a Bluetooth service in a Bluetooth device, which includes services, features, and attributes. Services and features have a unique corresponding UUID, and each feature has attributes such as read, write, and notification. When we actually use the Bluetooth service, we actually operate on the characteristics of different attributes. The use process is: complete the connection with the device through Bluetooth communication, find the corresponding service, locate a certain feature under the service, and complete the specific operation according to the attribute of the feature.

 

The Technology Alliance has defined many standard service UUIDs. For example, the serial port service should use 00001101-0000-1000-8000-00805F9B34FB as the standard UUID. At the same time, manufacturers are also allowed to define their own UUIDs to meet the realization of functions outside the defined services.

 

Many manufacturers' Bluetooth serial modules (and some printing services) do not really use the specified standard UUID numbers, but use their own defined UUIDs.

Copyright © 2021 Shenzhen Huayang Xinke Electronics Co., Ltd. All rights reserved