1. The App scans nearby devices when Bluetooth and related permissions are enabled. Then, the App parses the broadcast packages of devices, and you can select a device to connect.
2. The App connects to the device and prepares to build a communication channel.
3. Encrypted communication is performed between the App and the device based on the pairing key. If encryption and decryption are supported, perform identity authentication. After the identity is authenticated, the App and the device are connected and paired.
4. Then, the App and the device can communicate with each other based on the communication protocol.