Before the order

Android BLE series will end with this chapter. In the first three chapters, I have read the official website and blog again and again, summarized my hands-on practice, and finally demonstrated and further consolidated my BLE knowledge in the form of demo. This demo is written after the Android VERSION of nRF. It has simple but relatively complete functions, including scanning, connection communication, broadcasting, Gatt Service, and Bluetooth message interpretation.

All the knowledge involved in this demo is summarized and described in the first three chapters, which will not be described in this chapter.

A, scanning

Scan a nearby Bluetooth device and click to display the basic information that comes with its broadcast.

Click RAW to view the complete broadcast message and packet details.

Second, the radio

Print the broadcast and the operation after the connection. The specific broadcast content can be adjusted in the code. Of course, you can also use the previous scan to view the broadcast content!

If you want to figure out the communication of broadcast, it is best to learn bluetooth message, then it is good to imitate iBeacon to send beacon data.

Three, connection

Connect to carry peripheral. After the connection is successful, read and write the features and description of the peripheral to carry out BLE communication.

Four, the last

Finally, you can install the demo on two phones, one for BLE broadcasting, and the other for connecting and reading the broadcast phone.

Source: pan.baidu.com/s/167I3wCDb… Extraction code: 5A0A

Android BLE series:

Android Bluetooth BLE (I) — Scan

Android Bluetooth BLE (2) — Communication

Android Bluetooth BLE (3) — Broadcast

Android Bluetooth BLE (4) — Practical