diff --git a/zh-cn/application-dev/reference/apis-connectivity-kit/js-apis-bluetooth-a2dp-sys.md b/zh-cn/application-dev/reference/apis-connectivity-kit/js-apis-bluetooth-a2dp-sys.md index 47b26d4079b336a84424c8d3f1c46f9294e83573..cddbfa48a3e60ab7128f88fe43927c30821efe42 100644 --- a/zh-cn/application-dev/reference/apis-connectivity-kit/js-apis-bluetooth-a2dp-sys.md +++ b/zh-cn/application-dev/reference/apis-connectivity-kit/js-apis-bluetooth-a2dp-sys.md @@ -534,7 +534,7 @@ getCurrentCodecInfo(deviceId: string): CodecInfo | 类型 | 说明 | | ----------------------------- | ---------- | -| [CodecInfo](js-apis-bluetooth-a2dp#codecinfo11)| 当前编码器信息。 | +| [CodecInfo](js-apis-bluetooth-a2dp.md#codecinfo11)| 当前编码器信息。 | **错误码**: @@ -562,6 +562,56 @@ try { } ``` +### getCurrentFullCodecInfo19+ + +getCurrentFullCodecInfo(deviceId: string): CodecInfoList[] + +获取当前设备支持的全量编码器能力集合。 + +**系统接口**:此接口为系统接口。 + +**需要权限**:ohos.permission.ACCESS_BLUETOOTH + +**系统能力**:SystemCapability.Communication.Bluetooth.Core + +**参数:** + +| 参数名 | 类型 | 必填 | 说明 | +| ------ | ------ | ---- | ------- | +| deviceId | string | 是 | 对端设备地址,例如:"XX:XX:XX:XX:XX:XX"。 | + +**返回值:** + +| 类型 | 说明 | +| ----------------------------- | ---------- | +| [CodecInfoList](js-apis-bluetooth-a2dp.md#codecinfolist19)[]| 当前设备支持的编码器能力集合。 | + +**错误码**: + +以下错误码的详细介绍请参见[通用错误码说明文档](../errorcode-universal.md)和[蓝牙服务子系统错误码](errorcode-bluetoothManager.md)。 + +| 错误码ID | 错误信息 | +| -------- | ---------------------------- | +|201 | Permission denied. | +|202 | Non-system applications are not allowed to use system APIs. | +|801 | Capability not supported. | +|2900001 | Service stopped. | +|2900003 | Bluetooth disabled. | +|2900099 | Operation failed. | +|2902008 | Current device is not an active device. | + +**示例:** + +```js +import { BusinessError } from '@kit.BasicServicesKit'; +try { + let a2dpSrc = a2dp.createA2dpSrcProfile(); + let codecInfoList : a2dp.CodecInfoList[] = a2dpSrc.getCurrentFullCodecInfo('XX:XX:XX:XX:XX:XX'); +} catch (err) { + console.error('errCode: ' + (err as BusinessError).code + ', errMessage: ' + (err as BusinessError).message); +} +``` + ### setCurrentCodecInfo11+ setCurrentCodecInfo(deviceId: string, codecInfo: CodecInfo): void