The **a2dp** module provides APIs for using the Bluetooth Advanced Audio Distribution Profile (A2DP), which defines how to stream high quality audio from one device to another over a Bluetooth connection.
> **NOTE**
>
> The initial APIs of this module are supported since API version 10. Newly added APIs will be marked with a superscript to indicate their earliest API version.
Provides APIs for using the A2DP. Before using any API of **A2dpSourceProfile**, you need to create an instance of this class by using **createA2dpSrcProfile()**.
The **access** module provides APIs for enabling and disabling Bluetooth and obtaining the Bluetooth status.
> **NOTE**
>
> The initial APIs of this module are supported since API version 10. Newly added APIs will be marked with a superscript to indicate their earliest API version.
| type | string | Yes | Event type. The value is **stateChange**, which indicates a Bluetooth state change event. |
| callback | Callback<[BluetoothState](#bluetoothstate)> | Yes | Callback invoked to return the Bluetooth state. You need to implement this callback.|
**Error codes**
For details about the error codes, see [Bluetooth Error Codes](../errorcodes/errorcode-bluetoothManager.md).
|ID | Error Message |
| -------- | ------------------ |
|2900099 | Operation failed. |
**Example**
```js
functiononReceiveEvent(data){
console.info('bluetooth state = '+JSON.stringify(data));
| type | string | Yes | Event type. The value is **stateChange**, which indicates a Bluetooth state change event. |
| callback | Callback<[BluetoothState](#bluetoothstate)> | No | Callback for the Bluetooth state change event. If this parameter is not set, this API unsubscribes from all callbacks corresponding to **type**.|
**Error codes**
For details about the error codes, see [Bluetooth Error Codes](../errorcodes/errorcode-bluetoothManager.md).
| ID| Error Message|
| -------- | ---------------------------- |
|2900099 | Operation failed. |
**Example**
```js
functiononReceiveEvent(data){
console.info('bluetooth state = '+JSON.stringify(data));
The **baseProfile** module provides APIs for using basic Bluetooth profiles.
> **NOTE**
>
> The initial APIs of this module are supported since API version 10. Newly added APIs will be marked with a superscript to indicate their earliest API version.
| CONNECTION_STRATEGY_UNSUPPORTED | 0 | Default connection strategy to use when the device is not paired.<br>This is a system API.|
| CONNECTION_STRATEGY_ALLOWED | 1 | Connection strategy to use when the device is allowed to accept or initiate pairing.<br>This is a system API.|
| CONNECTION_STRATEGY_FORBIDDEN | 2 | Connection strategy to use when the device is not allowed to accept or initiate pairing.<br>This is a system API. |
| callback | AsyncCallback<void> | Yes | Callback invoked to return the result. If the operation is successful, **err** is **undefined**. Otherwise, **err** is an error object.|
**Error codes**
For details about the error codes, see [Bluetooth Error Codes](../errorcodes/errorcode-bluetoothManager.md).
| deviceId | string | Yes | Address of the device to pair, for example, XX:XX:XX:XX:XX:XX. |
| callback | AsyncCallback<[ConnectionStrategy](#connectionstrategy)> | Yes | Callback invoked to return the result. If the operation is successful, **err** is **undefined**. Otherwise, **err** is an error object.|
**Error codes**
For details about the error codes, see [Bluetooth Error Codes](../errorcodes/errorcode-bluetoothManager.md).
The **constant** module provides definitions of the constants used in Bluetooth.
> **NOTE**
>
> The initial APIs of this module are supported since API version 10. Newly added APIs will be marked with a superscript to indicate their earliest API version.