2. You can find the surrounding Bluetooth devices. When you find the Bluetooth device you want to connect, stop the discovery and connect automatically. Alternatively, if it is determined that the mobile phone and the Bluetooth device have been successfully paired, you can also use the getBundedDevice command to obtain the successfully paired Bluetooth device, and then search among the successfully paired Bluetooth devices to realize the connection. These two methods will be better, usually with a time difference of 3 to 4 seconds.
In this way, after the pairing connection is successful, you can try iostream to realize data sending and receiving.