diff --git a/api/@ohos.bluetooth.ble.d.ts b/api/@ohos.bluetooth.ble.d.ts index 7bd6f01bd1d2022f89aff37c46692e0c20f74fb1..6d4a1b40a9840fc4095d9aa398eae5846fe64740 100644 --- a/api/@ohos.bluetooth.ble.d.ts +++ b/api/@ohos.bluetooth.ble.d.ts @@ -179,6 +179,24 @@ declare namespace ble { */ function getConnectedBLEDevices(): Array; + /** + * Obtains the list of devices in the connected status. + * + * @permission ohos.permission.ACCESS_BLUETOOTH + * @param { BleProfile } profile - The profile in the BLE protocol. + * It is used to obtain the connected devices corresponding to the profile. + * @returns { Array } Returns the list of device address. + * @throws { BusinessError } 201 - Permission denied. + * @throws { BusinessError } 801 - Capability not supported. + * @throws { BusinessError } 2900001 - Service stopped. + * @throws { BusinessError } 2900003 - Bluetooth disabled. + * @throws { BusinessError } 2900099 - Operation failed. + * @syscap SystemCapability.Communication.Bluetooth.Core + * @since 21 + * @arkts 1.1&1.2 + */ + function getConnectedBLEDevices(profile: BleProfile): Array; + /** * Starts scanning for specified BLE devices with filters. * @@ -6845,6 +6863,41 @@ declare namespace ble { ON_BATCH = 3, } + /** + * The Profile of the BLE protocol. + * + * @enum { number } + * @syscap SystemCapability.Communication.Bluetooth.Core + * @since 21 + * @arkts 1.1&1.2 + */ + enum BleProfile { + /** + * Indicates the profile type of the gatt, including gatt client and gatt server. + * + * @syscap SystemCapability.Communication.Bluetooth.Core + * @since 21 + * @arkts 1.1&1.2 + */ + GATT = 1, + /** + * Indicates the profile type of the gatt client. + * + * @syscap SystemCapability.Communication.Bluetooth.Core + * @since 21 + * @arkts 1.1&1.2 + */ + GATT_CLIENT = 2, + /** + * Indicates the profile type of the gatt server. + * + * @syscap SystemCapability.Communication.Bluetooth.Core + * @since 21 + * @arkts 1.1&1.2 + */ + GATT_SERVER = 3 + } + /** * The enum of gatt disconnection reasons. *