The default Bluetooth protocol stack in the Linux operating system is BlueZ.
1. Introduction
There are two ways to apply BlueZ:
(1) with the aid of BlueZ tools (such as: BLUETOOTHCTL), can be achieved: scanning, discovery equipment, pairing, connection and other commonly used operations. Pros: No need to write code, simple. Cons: Dynamically scan Bluetooth devices, add Bluetooth devices to a list, display on the screen, users choose to connect with a Bluetooth device, and receive notifications, write features. The above requirements, with the shell command there are a lot of limitations.
(2) Write code through the D-bus API to implement Bluetooth applications. Cons: D-bus API Getting Started learning threshold is relatively high (little reference resources). Advantages: More complex applications can be achieved.
2. Bluez DBUS API Reference Resources
Resources Worth referencing:
(1) BluezV5.42 DBUS C API for BLE? (link): A discussion of StackOverflow Web site D-bus API posts.
(2) Library to access GATT information from BLE (Bluetooth low Energy) devices (link): d-bus instance code.
(3) BlueZ source code (link)
The following is a reference resource for Chinese (there are 2 articles on D-bus)
(4) BlueZ5.45 D-bus bus GATT API analysis (link)
(5) BlueZ5 (link)
Currently only found so much, follow-up if there are better resources, then add.
3. Bluetooth Specification document
You must refer to the official documentation for Bluetooth learning.
Bluetooth 4.1 specification (core_v4.1.pdf)
Bluetooth 4.2 specification (core_v4.2.pdf)