# Bluetooth connection process

This article describes the process of integrating Bluetooth functionality into an application. You can click on the respective API documentation links to view detailed instructions.

1. Initiate the Bluetooth module ([openBluetoothAdapter](https://open.feishu.cn/document/uYjL24iN/ugzNxYjL4cTM24CO3EjN)).

2. Initiate event listening.

* Listen on Bluetooth adapter status changes ([onBluetoothAdapterStateChange](https://open.feishu.cn/document/uYjL24iN/uADOxYjLwgTM24CM4EjN)).

* Listen on Bluetooth discovery events ([onBluetoothDeviceFound](https://open.feishu.cn/document/uYjL24iN/ukzNxYjL5cTM24SO3EjN)).

* Listen on Bluetooth connection status changes ([onBLEConnectionStateChange](https://open.feishu.cn/document/uYjL24iN/uUTOxYjL1kTM24SN5EjN)).

3. Search for devices ([startBluetoothDevicesDiscovery](https://open.feishu.cn/document/uYjL24iN/uUzNxYjL1cTM24SN3EjN)).

4. Connect to the discovered device ([connectBLEDevice](https://open.feishu.cn/document/uYjL24iN/ucDOxYjL3gTM24yN4EjN)).

5. Stop searching for devices ([stopBluetoothDevicesDiscovery](https://open.feishu.cn/document/uYjL24iN/uczNxYjL3cTM24yN3EjN)).

6. Traverse services and characteristics of Bluetooth peripheral devices.

* Get services ([getBLEDeviceServices](https://open.feishu.cn/document/uYjL24iN/uATOxYjLwkTM24CM5EjN)).

* Get characteristics ([getBLEDeviceCharacteristics](https://open.feishu.cn/document/uYjL24iN/ukDOxYjL5gTM24SO4EjN)).

7. Listen on characteristic value changes ([onBLECharacteristicValueChange](https://open.feishu.cn/document/uYjL24iN/uQTOxYjL0kTM24CN5EjN)).

8. Set the characteristic notification mode ([notifyBLECharacteristicValueChange](https://open.feishu.cn/document/uYjL24iN/uETOxYjLxkTM24SM5EjN)).

9. Read/write data.

* Write characteristic values of a device ([writeBLECharacteristicValue](https://open.feishu.cn/document/uYjL24iN/ucTOxYjL3kTM24yN5EjN)).

* Read characteristic values of a device ([readBLECharacteristicValue](https://open.feishu.cn/document/uYjL24iN/uYTOxYjL2kTM24iN5EjN)).

10. Disconnect the device ([disconnectBLEDevice](https://open.feishu.cn/document/uYjL24iN/ugDOxYjL4gTM24CO4EjN)).

11. Disable the Bluetooth adapter ([closeBluetoothAdapter](https://open.feishu.cn/document/uYjL24iN/uYDOxYjL2gTM24iN4EjN)).
