>): void;
/**
* Manages GATT server. Before calling an Gatt server method, you must use {@link createGattServer} to create an GattServer instance.
*
* @typedef GattServer
* @syscap SystemCapability.Communication.Bluetooth.Core
* @since 10
*/
/**
* Manages GATT server. Before calling an Gatt server method, you must use {@link createGattServer} to create an GattServer instance.
*
* @typedef GattServer
* @syscap SystemCapability.Communication.Bluetooth.Core
* @atomicservice
* @since 12
*/
/**
* Manages GATT server. Before calling an Gatt server method, you must use {@link createGattServer} to create an GattServer instance.
*
* @typedef GattServer
* @syscap SystemCapability.Communication.Bluetooth.Core
* @crossplatform
* @atomicservice
* @since 13
*/
interface GattServer {
/**
* Adds a specified service to be hosted.
* The added service and its characteristics are provided by the local device.
*
* @permission ohos.permission.ACCESS_BLUETOOTH
* @param { GattService } service - Indicates the service to add.
* @throws { BusinessError } 201 - Permission denied.
* @throws { BusinessError } 401 - Invalid parameter. Possible causes: 1. Mandatory parameters are left unspecified.
*
2. Incorrect parameter types. 3. Parameter verification failed.
* @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 10
*/
/**
* Adds a specified service to be hosted.
*
The added service and its characteristics are provided by the local device.
*
* @permission ohos.permission.ACCESS_BLUETOOTH
* @param { GattService } service - Indicates the service to add.
* @throws { BusinessError } 201 - Permission denied.
* @throws { BusinessError } 401 - Invalid parameter. Possible causes: 1. Mandatory parameters are left unspecified.
*
2. Incorrect parameter types. 3. Parameter verification failed.
* @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
* @atomicservice
* @since 12
*/
/**
* Adds a specified service to be hosted.
*
The added service and its characteristics are provided by the local device.
*
* @permission ohos.permission.ACCESS_BLUETOOTH
* @param { GattService } service - Indicates the service to add.
* @throws { BusinessError } 201 - Permission denied.
* @throws { BusinessError } 401 - Invalid parameter. Possible causes: 1. Mandatory parameters are left unspecified.
*
2. Incorrect parameter types. 3. Parameter verification failed.
* @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
* @crossplatform
* @atomicservice
* @since 13
*/
addService(service: GattService): void;
/**
* Removes a specified service from the list of GATT services provided by this device.
*
* @permission ohos.permission.ACCESS_BLUETOOTH
* @param { string } serviceUuid - Indicates the UUID of the service to remove.
* @throws { BusinessError } 201 - Permission denied.
* @throws { BusinessError } 401 - Invalid parameter. Possible causes: 1. Mandatory parameters are left unspecified.
*
2. Incorrect parameter types. 3. Parameter verification failed.
* @throws { BusinessError } 801 - Capability not supported.
* @throws { BusinessError } 2900001 - Service stopped.
* @throws { BusinessError } 2900003 - Bluetooth disabled.
* @throws { BusinessError } 2900004 - Profile not supported.
* @throws { BusinessError } 2900099 - Operation failed.
* @syscap SystemCapability.Communication.Bluetooth.Core
* @since 10
*/
/**
* Removes a specified service from the list of GATT services provided by this device.
*
* @permission ohos.permission.ACCESS_BLUETOOTH
* @param { string } serviceUuid - Indicates the UUID of the service to remove.
* @throws { BusinessError } 201 - Permission denied.
* @throws { BusinessError } 401 - Invalid parameter. Possible causes: 1. Mandatory parameters are left unspecified.
*
2. Incorrect parameter types. 3. Parameter verification failed.
* @throws { BusinessError } 801 - Capability not supported.
* @throws { BusinessError } 2900001 - Service stopped.
* @throws { BusinessError } 2900003 - Bluetooth disabled.
* @throws { BusinessError } 2900004 - Profile not supported.
* @throws { BusinessError } 2900099 - Operation failed.
* @syscap SystemCapability.Communication.Bluetooth.Core
* @atomicservice
* @since 12
*/
/**
* Removes a specified service from the list of GATT services provided by this device.
*
* @permission ohos.permission.ACCESS_BLUETOOTH
* @param { string } serviceUuid - Indicates the UUID of the service to remove.
* @throws { BusinessError } 201 - Permission denied.
* @throws { BusinessError } 401 - Invalid parameter. Possible causes: 1. Mandatory parameters are left unspecified.
*
2. Incorrect parameter types. 3. Parameter verification failed.
* @throws { BusinessError } 801 - Capability not supported.
* @throws { BusinessError } 2900001 - Service stopped.
* @throws { BusinessError } 2900003 - Bluetooth disabled.
* @throws { BusinessError } 2900004 - Profile not supported.
* @throws { BusinessError } 2900099 - Operation failed.
* @syscap SystemCapability.Communication.Bluetooth.Core
* @crossplatform
* @atomicservice
* @since 13
*/
removeService(serviceUuid: string): void;
/**
* Closes this {@code GattServer} object and unregisters its callbacks.
*
* @permission ohos.permission.ACCESS_BLUETOOTH
* @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 10
*/
/**
* Closes this {@code GattServer} object and unregisters its callbacks.
*
* @permission ohos.permission.ACCESS_BLUETOOTH
* @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
* @atomicservice
* @since 12
*/
/**
* Closes this {@code GattServer} object and unregisters its callbacks.
*
* @permission ohos.permission.ACCESS_BLUETOOTH
* @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
* @crossplatform
* @atomicservice
* @since 13
*/
close(): void;
/**
* Sends a notification of a change in a specified local characteristic with a asynchronous callback.
*
This method should be called for every BLE peripheral device that has requested notifications.
*
* @permission ohos.permission.ACCESS_BLUETOOTH
* @param { string } deviceId - Indicates device ID. For example, "11:22:33:AA:BB:FF".
* @param { NotifyCharacteristic } notifyCharacteristic - Indicates the local characteristic that has changed.
* @param { AsyncCallback } callback - Callback used to return the result.
* @throws { BusinessError } 201 - Permission denied.
* @throws { BusinessError } 401 - Invalid parameter. Possible causes: 1. Mandatory parameters are left unspecified.
*
2. Incorrect parameter types. 3. Parameter verification failed.
* @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 10
*/
/**
* Sends a notification of a change in a specified local characteristic with a asynchronous callback.
* This method should be called for every BLE peripheral device that has requested notifications.
*
* @permission ohos.permission.ACCESS_BLUETOOTH
* @param { string } deviceId - Indicates device ID. For example, "11:22:33:AA:BB:FF".
* @param { NotifyCharacteristic } notifyCharacteristic - Indicates the local characteristic that has changed.
* @param { AsyncCallback } callback - Callback used to return the result.
* @throws { BusinessError } 201 - Permission denied.
* @throws { BusinessError } 401 - Invalid parameter. Possible causes: 1. Mandatory parameters are left unspecified.
*
2. Incorrect parameter types. 3. Parameter verification failed.
* @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
* @atomicservice
* @since 12
*/
/**
* Sends a notification of a change in a specified local characteristic with a asynchronous callback.
* This method should be called for every BLE peripheral device that has requested notifications.
*
* @permission ohos.permission.ACCESS_BLUETOOTH
* @param { string } deviceId - Indicates device ID. For example, "11:22:33:AA:BB:FF".
* @param { NotifyCharacteristic } notifyCharacteristic - Indicates the local characteristic that has changed.
* @param { AsyncCallback } callback - Callback used to return the result.
* @throws { BusinessError } 201 - Permission denied.
* @throws { BusinessError } 401 - Invalid parameter. Possible causes: 1. Mandatory parameters are left unspecified.
*
2. Incorrect parameter types. 3. Parameter verification failed.
* @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
* @crossplatform
* @atomicservice
* @since 13
*/
notifyCharacteristicChanged(
deviceId: string,
notifyCharacteristic: NotifyCharacteristic,
callback: AsyncCallback
): void;
/**
* Sends a notification of a change in a specified local characteristic with a asynchronous callback.
* This method should be called for every BLE peripheral device that has requested notifications.
*
* @permission ohos.permission.ACCESS_BLUETOOTH
* @param { string } deviceId - Indicates device ID. For example, "11:22:33:AA:BB:FF".
* @param { NotifyCharacteristic } notifyCharacteristic - Indicates the local characteristic that has changed.
* @returns { Promise } Promise used to return the result.
* @throws { BusinessError } 201 - Permission denied.
* @throws { BusinessError } 401 - Invalid parameter. Possible causes: 1. Mandatory parameters are left unspecified.
*
2. Incorrect parameter types. 3. Parameter verification failed.
* @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 10
*/
/**
* Sends a notification of a change in a specified local characteristic with a asynchronous callback.
* This method should be called for every BLE peripheral device that has requested notifications.
*
* @permission ohos.permission.ACCESS_BLUETOOTH
* @param { string } deviceId - Indicates device ID. For example, "11:22:33:AA:BB:FF".
* @param { NotifyCharacteristic } notifyCharacteristic - Indicates the local characteristic that has changed.
* @returns { Promise } Promise used to return the result.
* @throws { BusinessError } 201 - Permission denied.
* @throws { BusinessError } 401 - Invalid parameter. Possible causes: 1. Mandatory parameters are left unspecified.
*
2. Incorrect parameter types. 3. Parameter verification failed.
* @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
* @atomicservice
* @since 12
*/
/**
* Sends a notification of a change in a specified local characteristic with a asynchronous callback.
* This method should be called for every BLE peripheral device that has requested notifications.
*
* @permission ohos.permission.ACCESS_BLUETOOTH
* @param { string } deviceId - Indicates device ID. For example, "11:22:33:AA:BB:FF".
* @param { NotifyCharacteristic } notifyCharacteristic - Indicates the local characteristic that has changed.
* @returns { Promise } Promise used to return the result.
* @throws { BusinessError } 201 - Permission denied.
* @throws { BusinessError } 401 - Invalid parameter. Possible causes: 1. Mandatory parameters are left unspecified.
*
2. Incorrect parameter types. 3. Parameter verification failed.
* @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
* @crossplatform
* @atomicservice
* @since 13
*/
notifyCharacteristicChanged(deviceId: string, notifyCharacteristic: NotifyCharacteristic): Promise;
/**
* Sends a response to a specified read or write request to a given BLE peripheral device.
*
* @permission ohos.permission.ACCESS_BLUETOOTH
* @param { ServerResponse } serverResponse - Indicates the response parameters {@link ServerResponse}.
* @throws { BusinessError } 201 - Permission denied.
* @throws { BusinessError } 401 - Invalid parameter. Possible causes: 1. Mandatory parameters are left unspecified.
*
2. Incorrect parameter types. 3. Parameter verification failed.
* @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 10
*/
/**
* Sends a response to a specified read or write request to a given BLE peripheral device.
*
* @permission ohos.permission.ACCESS_BLUETOOTH
* @param { ServerResponse } serverResponse - Indicates the response parameters {@link ServerResponse}.
* @throws { BusinessError } 201 - Permission denied.
* @throws { BusinessError } 401 - Invalid parameter. Possible causes: 1. Mandatory parameters are left unspecified.
*
2. Incorrect parameter types. 3. Parameter verification failed.
* @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
* @atomicservice
* @since 12
*/
/**
* Sends a response to a specified read or write request to a given BLE peripheral device.
*
* @permission ohos.permission.ACCESS_BLUETOOTH
* @param { ServerResponse } serverResponse - Indicates the response parameters {@link ServerResponse}.
* @throws { BusinessError } 201 - Permission denied.
* @throws { BusinessError } 401 - Invalid parameter. Possible causes: 1. Mandatory parameters are left unspecified.
*
2. Incorrect parameter types. 3. Parameter verification failed.
* @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
* @crossplatform
* @atomicservice
* @since 13
*/
sendResponse(serverResponse: ServerResponse): void;
/**
* Subscribe characteristic read event.
*
* @permission ohos.permission.ACCESS_BLUETOOTH
* @param { 'characteristicRead' } type - Type of the characteristic read event to listen for.
* @param { Callback } callback - Callback used to listen for the characteristic read event.
* @throws { BusinessError } 201 - Permission denied.
* @throws { BusinessError } 401 - Invalid parameter. Possible causes: 1. Mandatory parameters are left unspecified.
*
2. Incorrect parameter types. 3. Parameter verification failed.
* @throws { BusinessError } 801 - Capability not supported.
* @syscap SystemCapability.Communication.Bluetooth.Core
* @since 10
*/
/**
* Subscribe characteristic read event.
*
* @permission ohos.permission.ACCESS_BLUETOOTH
* @param { 'characteristicRead' } type - Type of the characteristic read event to listen for.
* @param { Callback } callback - Callback used to listen for the characteristic read event.
* @throws { BusinessError } 201 - Permission denied.
* @throws { BusinessError } 401 - Invalid parameter. Possible causes: 1. Mandatory parameters are left unspecified.
*
2. Incorrect parameter types. 3. Parameter verification failed.
* @throws { BusinessError } 801 - Capability not supported.
* @syscap SystemCapability.Communication.Bluetooth.Core
* @atomicservice
* @since 12
*/
/**
* Subscribe characteristic read event.
*
* @permission ohos.permission.ACCESS_BLUETOOTH
* @param { 'characteristicRead' } type - Type of the characteristic read event to listen for.
* @param { Callback } callback - Callback used to listen for the characteristic read event.
* @throws { BusinessError } 201 - Permission denied.
* @throws { BusinessError } 401 - Invalid parameter. Possible causes: 1. Mandatory parameters are left unspecified.
*
2. Incorrect parameter types. 3. Parameter verification failed.
* @throws { BusinessError } 801 - Capability not supported.
* @syscap SystemCapability.Communication.Bluetooth.Core
* @crossplatform
* @atomicservice
* @since 13
*/
on(type: 'characteristicRead', callback: Callback): void;
/**
* Unsubscribe characteristic read event.
*
* @permission ohos.permission.ACCESS_BLUETOOTH
* @param { 'characteristicRead' } type - Type of the characteristic read event to listen for.
* @param { Callback } callback - Callback used to listen for the characteristic read event.
* @throws { BusinessError } 201 - Permission denied.
* @throws { BusinessError } 401 - Invalid parameter. Possible causes: 1. Mandatory parameters are left unspecified.
*
2. Incorrect parameter types. 3. Parameter verification failed.
* @throws { BusinessError } 801 - Capability not supported.
* @syscap SystemCapability.Communication.Bluetooth.Core
* @since 10
*/
/**
* Unsubscribe characteristic read event.
*
* @permission ohos.permission.ACCESS_BLUETOOTH
* @param { 'characteristicRead' } type - Type of the characteristic read event to listen for.
* @param { Callback } callback - Callback used to listen for the characteristic read event.
* @throws { BusinessError } 201 - Permission denied.
* @throws { BusinessError } 401 - Invalid parameter. Possible causes: 1. Mandatory parameters are left unspecified.
*
2. Incorrect parameter types. 3. Parameter verification failed.
* @throws { BusinessError } 801 - Capability not supported.
* @syscap SystemCapability.Communication.Bluetooth.Core
* @atomicservice
* @since 12
*/
/**
* Unsubscribe characteristic read event.
*
* @permission ohos.permission.ACCESS_BLUETOOTH
* @param { 'characteristicRead' } type - Type of the characteristic read event to listen for.
* @param { Callback } callback - Callback used to listen for the characteristic read event.
* @throws { BusinessError } 201 - Permission denied.
* @throws { BusinessError } 401 - Invalid parameter. Possible causes: 1. Mandatory parameters are left unspecified.
*
2. Incorrect parameter types. 3. Parameter verification failed.
* @throws { BusinessError } 801 - Capability not supported.
* @syscap SystemCapability.Communication.Bluetooth.Core
* @crossplatform
* @atomicservice
* @since 13
*/
off(type: 'characteristicRead', callback?: Callback): void;
/**
* Subscribe characteristic write event.
*
* @permission ohos.permission.ACCESS_BLUETOOTH
* @param { 'characteristicWrite' } type - Type of the characteristic write event to listen for.
* @param { Callback } callback - Callback used to listen for the characteristic write event.
* @throws { BusinessError } 201 - Permission denied.
* @throws { BusinessError } 401 - Invalid parameter. Possible causes: 1. Mandatory parameters are left unspecified.
*
2. Incorrect parameter types. 3. Parameter verification failed.
* @throws { BusinessError } 801 - Capability not supported.
* @syscap SystemCapability.Communication.Bluetooth.Core
* @since 10
*/
/**
* Subscribe characteristic write event.
*
* @permission ohos.permission.ACCESS_BLUETOOTH
* @param { 'characteristicWrite' } type - Type of the characteristic write event to listen for.
* @param { Callback } callback - Callback used to listen for the characteristic write event.
* @throws { BusinessError } 201 - Permission denied.
* @throws { BusinessError } 401 - Invalid parameter. Possible causes: 1. Mandatory parameters are left unspecified.
*
2. Incorrect parameter types. 3. Parameter verification failed.
* @throws { BusinessError } 801 - Capability not supported.
* @syscap SystemCapability.Communication.Bluetooth.Core
* @atomicservice
* @since 12
*/
/**
* Subscribe characteristic write event.
*
* @permission ohos.permission.ACCESS_BLUETOOTH
* @param { 'characteristicWrite' } type - Type of the characteristic write event to listen for.
* @param { Callback } callback - Callback used to listen for the characteristic write event.
* @throws { BusinessError } 201 - Permission denied.
* @throws { BusinessError } 401 - Invalid parameter. Possible causes: 1. Mandatory parameters are left unspecified.
*
2. Incorrect parameter types. 3. Parameter verification failed.
* @throws { BusinessError } 801 - Capability not supported.
* @syscap SystemCapability.Communication.Bluetooth.Core
* @crossplatform
* @atomicservice
* @since 13
*/
on(type: 'characteristicWrite', callback: Callback): void;
/**
* Unsubscribe characteristic write event.
*
* @permission ohos.permission.ACCESS_BLUETOOTH
* @param { 'characteristicWrite' } type - Type of the characteristic write event to listen for.
* @param { Callback } callback - Callback used to listen for the characteristic write event.
* @throws { BusinessError } 201 - Permission denied.
* @throws { BusinessError } 401 - Invalid parameter. Possible causes: 1. Mandatory parameters are left unspecified.
*
2. Incorrect parameter types. 3. Parameter verification failed.
* @throws { BusinessError } 801 - Capability not supported.
* @syscap SystemCapability.Communication.Bluetooth.Core
* @since 10
*/
/**
* Unsubscribe characteristic write event.
*
* @permission ohos.permission.ACCESS_BLUETOOTH
* @param { 'characteristicWrite' } type - Type of the characteristic write event to listen for.
* @param { Callback } callback - Callback used to listen for the characteristic write event.
* @throws { BusinessError } 201 - Permission denied.
* @throws { BusinessError } 401 - Invalid parameter. Possible causes: 1. Mandatory parameters are left unspecified.
*
2. Incorrect parameter types. 3. Parameter verification failed.
* @throws { BusinessError } 801 - Capability not supported.
* @syscap SystemCapability.Communication.Bluetooth.Core
* @atomicservice
* @since 12
*/
/**
* Unsubscribe characteristic write event.
*
* @permission ohos.permission.ACCESS_BLUETOOTH
* @param { 'characteristicWrite' } type - Type of the characteristic write event to listen for.
* @param { Callback } callback - Callback used to listen for the characteristic write event.
* @throws { BusinessError } 201 - Permission denied.
* @throws { BusinessError } 401 - Invalid parameter. Possible causes: 1. Mandatory parameters are left unspecified.
*
2. Incorrect parameter types. 3. Parameter verification failed.
* @throws { BusinessError } 801 - Capability not supported.
* @syscap SystemCapability.Communication.Bluetooth.Core
* @crossplatform
* @atomicservice
* @since 13
*/
off(type: 'characteristicWrite', callback?: Callback): void;
/**
* Subscribe descriptor read event.
*
* @permission ohos.permission.ACCESS_BLUETOOTH
* @param { 'descriptorRead' } type - Type of the descriptor read event to listen for.
* @param { Callback } callback - Callback used to listen for the descriptor read event.
* @throws { BusinessError } 201 - Permission denied.
* @throws { BusinessError } 401 - Invalid parameter. Possible causes: 1. Mandatory parameters are left unspecified.
*
2. Incorrect parameter types. 3. Parameter verification failed.
* @throws { BusinessError } 801 - Capability not supported.
* @syscap SystemCapability.Communication.Bluetooth.Core
* @since 10
*/
/**
* Subscribe descriptor read event.
*
* @permission ohos.permission.ACCESS_BLUETOOTH
* @param { 'descriptorRead' } type - Type of the descriptor read event to listen for.
* @param { Callback } callback - Callback used to listen for the descriptor read event.
* @throws { BusinessError } 201 - Permission denied.
* @throws { BusinessError } 401 - Invalid parameter. Possible causes: 1. Mandatory parameters are left unspecified.
*
2. Incorrect parameter types. 3. Parameter verification failed.
* @throws { BusinessError } 801 - Capability not supported.
* @syscap SystemCapability.Communication.Bluetooth.Core
* @atomicservice
* @since 12
*/
/**
* Subscribe descriptor read event.
*
* @permission ohos.permission.ACCESS_BLUETOOTH
* @param { 'descriptorRead' } type - Type of the descriptor read event to listen for.
* @param { Callback } callback - Callback used to listen for the descriptor read event.
* @throws { BusinessError } 201 - Permission denied.
* @throws { BusinessError } 401 - Invalid parameter. Possible causes: 1. Mandatory parameters are left unspecified.
*
2. Incorrect parameter types. 3. Parameter verification failed.
* @throws { BusinessError } 801 - Capability not supported.
* @syscap SystemCapability.Communication.Bluetooth.Core
* @crossplatform
* @atomicservice
* @since 13
*/
on(type: 'descriptorRead', callback: Callback): void;
/**
* Unsubscribe descriptor read event.
*
* @permission ohos.permission.ACCESS_BLUETOOTH
* @param { 'descriptorRead' } type - Type of the descriptor read event to listen for.
* @param { Callback } callback - Callback used to listen for the descriptor read event.
* @throws { BusinessError } 201 - Permission denied.
* @throws { BusinessError } 401 - Invalid parameter. Possible causes: 1. Mandatory parameters are left unspecified.
*
2. Incorrect parameter types. 3. Parameter verification failed.
* @throws { BusinessError } 801 - Capability not supported.
* @syscap SystemCapability.Communication.Bluetooth.Core
* @since 10
*/
/**
* Unsubscribe descriptor read event.
*
* @permission ohos.permission.ACCESS_BLUETOOTH
* @param { 'descriptorRead' } type - Type of the descriptor read event to listen for.
* @param { Callback } callback - Callback used to listen for the descriptor read event.
* @throws { BusinessError } 201 - Permission denied.
* @throws { BusinessError } 401 - Invalid parameter. Possible causes: 1. Mandatory parameters are left unspecified.
*
2. Incorrect parameter types. 3. Parameter verification failed.
* @throws { BusinessError } 801 - Capability not supported.
* @syscap SystemCapability.Communication.Bluetooth.Core
* @atomicservice
* @since 12
*/
/**
* Unsubscribe descriptor read event.
*
* @permission ohos.permission.ACCESS_BLUETOOTH
* @param { 'descriptorRead' } type - Type of the descriptor read event to listen for.
* @param { Callback } callback - Callback used to listen for the descriptor read event.
* @throws { BusinessError } 201 - Permission denied.
* @throws { BusinessError } 401 - Invalid parameter. Possible causes: 1. Mandatory parameters are left unspecified.
*
2. Incorrect parameter types. 3. Parameter verification failed.
* @throws { BusinessError } 801 - Capability not supported.
* @syscap SystemCapability.Communication.Bluetooth.Core
* @crossplatform
* @atomicservice
* @since 13
*/
off(type: 'descriptorRead', callback?: Callback): void;
/**
* Subscribe descriptor write event.
*
* @permission ohos.permission.ACCESS_BLUETOOTH
* @param { 'descriptorWrite' } type - Type of the descriptor write event to listen for.
* @param { Callback } callback - Callback used to listen for the descriptor write event.
* @throws { BusinessError } 201 - Permission denied.
* @throws { BusinessError } 401 - Invalid parameter. Possible causes: 1. Mandatory parameters are left unspecified.
*
2. Incorrect parameter types. 3. Parameter verification failed.
* @throws { BusinessError } 801 - Capability not supported.
* @syscap SystemCapability.Communication.Bluetooth.Core
* @since 10
*/
/**
* Subscribe descriptor write event.
*
* @permission ohos.permission.ACCESS_BLUETOOTH
* @param { 'descriptorWrite' } type - Type of the descriptor write event to listen for.
* @param { Callback } callback - Callback used to listen for the descriptor write event.
* @throws { BusinessError } 201 - Permission denied.
* @throws { BusinessError } 401 - Invalid parameter. Possible causes: 1. Mandatory parameters are left unspecified.
*
2. Incorrect parameter types. 3. Parameter verification failed.
* @throws { BusinessError } 801 - Capability not supported.
* @syscap SystemCapability.Communication.Bluetooth.Core
* @atomicservice
* @since 12
*/
/**
* Subscribe descriptor write event.
*
* @permission ohos.permission.ACCESS_BLUETOOTH
* @param { 'descriptorWrite' } type - Type of the descriptor write event to listen for.
* @param { Callback } callback - Callback used to listen for the descriptor write event.
* @throws { BusinessError } 201 - Permission denied.
* @throws { BusinessError } 401 - Invalid parameter. Possible causes: 1. Mandatory parameters are left unspecified.
*
2. Incorrect parameter types. 3. Parameter verification failed.
* @throws { BusinessError } 801 - Capability not supported.
* @syscap SystemCapability.Communication.Bluetooth.Core
* @crossplatform
* @atomicservice
* @since 13
*/
on(type: 'descriptorWrite', callback: Callback): void;
/**
* Unsubscribe descriptor write event.
*
* @permission ohos.permission.ACCESS_BLUETOOTH
* @param { 'descriptorWrite' } type - Type of the descriptor write event to listen for.
* @param { Callback } callback - Callback used to listen for the descriptor write event.
* @throws { BusinessError } 201 - Permission denied.
* @throws { BusinessError } 401 - Invalid parameter. Possible causes: 1. Mandatory parameters are left unspecified.
*
2. Incorrect parameter types. 3. Parameter verification failed.
* @throws { BusinessError } 801 - Capability not supported.
* @syscap SystemCapability.Communication.Bluetooth.Core
* @since 10
*/
/**
* Unsubscribe descriptor write event.
*
* @permission ohos.permission.ACCESS_BLUETOOTH
* @param { 'descriptorWrite' } type - Type of the descriptor write event to listen for.
* @param { Callback } callback - Callback used to listen for the descriptor write event.
* @throws { BusinessError } 201 - Permission denied.
* @throws { BusinessError } 401 - Invalid parameter. Possible causes: 1. Mandatory parameters are left unspecified.
*
2. Incorrect parameter types. 3. Parameter verification failed.
* @throws { BusinessError } 801 - Capability not supported.
* @syscap SystemCapability.Communication.Bluetooth.Core
* @atomicservice
* @since 12
*/
/**
* Unsubscribe descriptor write event.
*
* @permission ohos.permission.ACCESS_BLUETOOTH
* @param { 'descriptorWrite' } type - Type of the descriptor write event to listen for.
* @param { Callback } callback - Callback used to listen for the descriptor write event.
* @throws { BusinessError } 201 - Permission denied.
* @throws { BusinessError } 401 - Invalid parameter. Possible causes: 1. Mandatory parameters are left unspecified.
*
2. Incorrect parameter types. 3. Parameter verification failed.
* @throws { BusinessError } 801 - Capability not supported.
* @syscap SystemCapability.Communication.Bluetooth.Core
* @crossplatform
* @atomicservice
* @since 13
*/
off(type: 'descriptorWrite', callback?: Callback): void;
/**
* Subscribe server connection state changed event.
*
* @permission ohos.permission.ACCESS_BLUETOOTH
* @param { 'connectionStateChange' } type - Type of the connection state changed event to listen for.
* @param { Callback } callback - Callback used to listen for the connection state changed event.
* @throws { BusinessError } 201 - Permission denied.
* @throws { BusinessError } 401 - Invalid parameter. Possible causes: 1. Mandatory parameters are left unspecified.
*
2. Incorrect parameter types. 3. Parameter verification failed.
* @throws { BusinessError } 801 - Capability not supported.
* @syscap SystemCapability.Communication.Bluetooth.Core
* @since 10
*/
/**
* Subscribe server connection state changed event.
*
* @permission ohos.permission.ACCESS_BLUETOOTH
* @param { 'connectionStateChange' } type - Type of the connection state changed event to listen for.
* @param { Callback } callback - Callback used to listen for the connection state changed event.
* @throws { BusinessError } 201 - Permission denied.
* @throws { BusinessError } 401 - Invalid parameter. Possible causes: 1. Mandatory parameters are left unspecified.
*
2. Incorrect parameter types. 3. Parameter verification failed.
* @throws { BusinessError } 801 - Capability not supported.
* @syscap SystemCapability.Communication.Bluetooth.Core
* @atomicservice
* @since 12
*/
/**
* Subscribe server connection state changed event.
*
* @permission ohos.permission.ACCESS_BLUETOOTH
* @param { 'connectionStateChange' } type - Type of the connection state changed event to listen for.
* @param { Callback } callback - Callback used to listen for the connection state changed event.
* @throws { BusinessError } 201 - Permission denied.
* @throws { BusinessError } 401 - Invalid parameter. Possible causes: 1. Mandatory parameters are left unspecified.
*
2. Incorrect parameter types. 3. Parameter verification failed.
* @throws { BusinessError } 801 - Capability not supported.
* @syscap SystemCapability.Communication.Bluetooth.Core
* @crossplatform
* @atomicservice
* @since 13
*/
on(type: 'connectionStateChange', callback: Callback): void;
/**
* Unsubscribe server connection state changed event.
*
* @permission ohos.permission.ACCESS_BLUETOOTH
* @param { 'connectionStateChange' } type - Type of the connection state changed event to listen for.
* @param { Callback } callback - Callback used to listen for the connection state changed event.
* @throws { BusinessError } 201 - Permission denied.
* @throws { BusinessError } 401 - Invalid parameter. Possible causes: 1. Mandatory parameters are left unspecified.
*
2. Incorrect parameter types. 3. Parameter verification failed.
* @throws { BusinessError } 801 - Capability not supported.
* @syscap SystemCapability.Communication.Bluetooth.Core
* @since 10
*/
/**
* Unsubscribe server connection state changed event.
*
* @permission ohos.permission.ACCESS_BLUETOOTH
* @param { 'connectionStateChange' } type - Type of the connection state changed event to listen for.
* @param { Callback } callback - Callback used to listen for the connection state changed event.
* @throws { BusinessError } 201 - Permission denied.
* @throws { BusinessError } 401 - Invalid parameter. Possible causes: 1. Mandatory parameters are left unspecified.
*
2. Incorrect parameter types. 3. Parameter verification failed.
* @throws { BusinessError } 801 - Capability not supported.
* @syscap SystemCapability.Communication.Bluetooth.Core
* @atomicservice
* @since 12
*/
/**
* Unsubscribe server connection state changed event.
*
* @permission ohos.permission.ACCESS_BLUETOOTH
* @param { 'connectionStateChange' } type - Type of the connection state changed event to listen for.
* @param { Callback } callback - Callback used to listen for the connection state changed event.
* @throws { BusinessError } 201 - Permission denied.
* @throws { BusinessError } 401 - Invalid parameter. Possible causes: 1. Mandatory parameters are left unspecified.
*
2. Incorrect parameter types. 3. Parameter verification failed.
* @throws { BusinessError } 801 - Capability not supported.
* @syscap SystemCapability.Communication.Bluetooth.Core
* @crossplatform
* @atomicservice
* @since 13
*/
off(type: 'connectionStateChange', callback?: Callback): void;
/**
* Subscribe mtu changed event.
*
* @permission ohos.permission.ACCESS_BLUETOOTH
* @param { 'BLEMtuChange' } type - Type of the mtu changed event to listen for.
* @param { Callback } callback - Callback used to listen for the mtu changed event.
* @throws { BusinessError } 201 - Permission denied.
* @throws { BusinessError } 401 - Invalid parameter. Possible causes: 1. Mandatory parameters are left unspecified.
*
2. Incorrect parameter types. 3. Parameter verification failed.
* @throws { BusinessError } 801 - Capability not supported.
* @syscap SystemCapability.Communication.Bluetooth.Core
* @since 10
*/
/**
* Subscribe mtu changed event.
*
* @permission ohos.permission.ACCESS_BLUETOOTH
* @param { 'BLEMtuChange' } type - Type of the mtu changed event to listen for.
* @param { Callback } callback - Callback used to listen for the mtu changed event.
* @throws { BusinessError } 201 - Permission denied.
* @throws { BusinessError } 401 - Invalid parameter. Possible causes: 1. Mandatory parameters are left unspecified.
*
2. Incorrect parameter types. 3. Parameter verification failed.
* @throws { BusinessError } 801 - Capability not supported.
* @syscap SystemCapability.Communication.Bluetooth.Core
* @crossplatform
* @since 13
*/
on(type: 'BLEMtuChange', callback: Callback): void;
/**
* Unsubscribe mtu changed event.
*
* @permission ohos.permission.ACCESS_BLUETOOTH
* @param { 'BLEMtuChange' } type - Type of the mtu changed event to listen for.
* @param { Callback } callback - Callback used to listen for the mtu changed event.
* @throws { BusinessError } 201 - Permission denied.
* @throws { BusinessError } 401 - Invalid parameter. Possible causes: 1. Mandatory parameters are left unspecified.
*
2. Incorrect parameter types. 3. Parameter verification failed.
* @throws { BusinessError } 801 - Capability not supported.
* @syscap SystemCapability.Communication.Bluetooth.Core
* @since 10
*/
/**
* Unsubscribe mtu changed event.
*
* @permission ohos.permission.ACCESS_BLUETOOTH
* @param { 'BLEMtuChange' } type - Type of the mtu changed event to listen for.
* @param { Callback } callback - Callback used to listen for the mtu changed event.
* @throws { BusinessError } 201 - Permission denied.
* @throws { BusinessError } 401 - Invalid parameter. Possible causes: 1. Mandatory parameters are left unspecified.
*
2. Incorrect parameter types. 3. Parameter verification failed.
* @throws { BusinessError } 801 - Capability not supported.
* @syscap SystemCapability.Communication.Bluetooth.Core
* @crossplatform
* @since 13
*/
off(type: 'BLEMtuChange', callback?: Callback): void;
}
/**
* Manages GATT client. Before calling an Gatt client method, you must use {@link createGattClientDevice} to create an GattClientDevice instance.
*
* @typedef GattClientDevice
* @syscap SystemCapability.Communication.Bluetooth.Core
* @since 10
*/
/**
* Manages GATT client. Before calling an Gatt client method, you must use {@link createGattClientDevice} to create an GattClientDevice instance.
*
* @typedef GattClientDevice
* @syscap SystemCapability.Communication.Bluetooth.Core
* @atomicservice
* @since 12
*/
/**
* Manages GATT client. Before calling an Gatt client method, you must use {@link createGattClientDevice} to create an GattClientDevice instance.
*
* @typedef GattClientDevice
* @syscap SystemCapability.Communication.Bluetooth.Core
* @crossplatform
* @atomicservice
* @since 13
*/
interface GattClientDevice {
/**
* Connects to a BLE peripheral device.
* The 'BLEConnectionStateChange' event is subscribed to return the connection state.
*
* @permission ohos.permission.ACCESS_BLUETOOTH
* @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 10
*/
/**
* Connects to a BLE peripheral device.
*
The 'BLEConnectionStateChange' event is subscribed to return the connection state.
*
* @permission ohos.permission.ACCESS_BLUETOOTH
* @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
* @atomicservice
* @since 12
*/
/**
* Connects to a BLE peripheral device.
*
The 'BLEConnectionStateChange' event is subscribed to return the connection state.
*
* @permission ohos.permission.ACCESS_BLUETOOTH
* @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
* @crossplatform
* @atomicservice
* @since 13
*/
connect(): void;
/**
* Disconnects from or stops an ongoing connection to a BLE peripheral device.
*
* @permission ohos.permission.ACCESS_BLUETOOTH
* @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 10
*/
/**
* Disconnects from or stops an ongoing connection to a BLE peripheral device.
*
* @permission ohos.permission.ACCESS_BLUETOOTH
* @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
* @atomicservice
* @since 12
*/
/**
* Disconnects from or stops an ongoing connection to a BLE peripheral device.
*
* @permission ohos.permission.ACCESS_BLUETOOTH
* @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
* @crossplatform
* @atomicservice
* @since 13
*/
disconnect(): void;
/**
* Disables a BLE peripheral device.
*
This method unregisters the device and clears the registered callbacks and handles.
*
* @permission ohos.permission.ACCESS_BLUETOOTH
* @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 10
*/
/**
* Disables a BLE peripheral device.
*
This method unregisters the device and clears the registered callbacks and handles.
*
* @permission ohos.permission.ACCESS_BLUETOOTH
* @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
* @atomicservice
* @since 12
*/
/**
* Disables a BLE peripheral device.
*
This method unregisters the device and clears the registered callbacks and handles.
*
* @permission ohos.permission.ACCESS_BLUETOOTH
* @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
* @crossplatform
* @atomicservice
* @since 13
*/
close(): void;
/**
* Obtains the name of BLE peripheral device.
*
* @permission ohos.permission.ACCESS_BLUETOOTH
* @param { AsyncCallback } callback - Callback used to obtain the device name.
* @throws { BusinessError } 201 - Permission denied.
* @throws { BusinessError } 401 - Invalid parameter. Possible causes: 1. Mandatory parameters are left unspecified.
*
2. Incorrect parameter types.
* @throws { BusinessError } 801 - Capability not supported.
* @throws { BusinessError } 2900001 - Service stopped.
* @throws { BusinessError } 2900099 - Operation failed.
* @syscap SystemCapability.Communication.Bluetooth.Core
* @since 10
*/
/**
* Obtains the name of BLE peripheral device.
*
* @permission ohos.permission.ACCESS_BLUETOOTH
* @param { AsyncCallback } callback - Callback used to obtain the device name.
* @throws { BusinessError } 201 - Permission denied.
* @throws { BusinessError } 401 - Invalid parameter. Possible causes: 1. Mandatory parameters are left unspecified.
*
2. Incorrect parameter types.
* @throws { BusinessError } 801 - Capability not supported.
* @throws { BusinessError } 2900001 - Service stopped.
* @throws { BusinessError } 2900099 - Operation failed.
* @syscap SystemCapability.Communication.Bluetooth.Core
* @atomicservice
* @since 12
*/
/**
* Obtains the name of BLE peripheral device.
*
* @permission ohos.permission.ACCESS_BLUETOOTH
* @param { AsyncCallback } callback - Callback used to obtain the device name.
* @throws { BusinessError } 201 - Permission denied.
* @throws { BusinessError } 401 - Invalid parameter. Possible causes: 1. Mandatory parameters are left unspecified.
*
2. Incorrect parameter types.
* @throws { BusinessError } 801 - Capability not supported.
* @throws { BusinessError } 2900001 - Service stopped.
* @throws { BusinessError } 2900099 - Operation failed.
* @syscap SystemCapability.Communication.Bluetooth.Core
* @crossplatform
* @atomicservice
* @since 13
*/
getDeviceName(callback: AsyncCallback): void;
/**
* Obtains the name of BLE peripheral device.
*
* @permission ohos.permission.ACCESS_BLUETOOTH
* @returns { Promise } Returns a string representation of the name if obtained;
* @throws { BusinessError } 201 - Permission denied.
* @throws { BusinessError } 401 - Invalid parameter.Possible causes: 1. Mandatory parameters are left unspecified.
*
2. Incorrect parameter types.
* @throws { BusinessError } 801 - Capability not supported.
* @throws { BusinessError } 2900001 - Service stopped.
* @throws { BusinessError } 2900099 - Operation failed.
* @syscap SystemCapability.Communication.Bluetooth.Core
* @since 10
*/
/**
* Obtains the name of BLE peripheral device.
*
* @permission ohos.permission.ACCESS_BLUETOOTH
* @returns { Promise } Returns a string representation of the name if obtained;
* @throws { BusinessError } 201 - Permission denied.
* @throws { BusinessError } 401 - Invalid parameter.Possible causes: 1. Mandatory parameters are left unspecified.
*
2. Incorrect parameter types.
* @throws { BusinessError } 801 - Capability not supported.
* @throws { BusinessError } 2900001 - Service stopped.
* @throws { BusinessError } 2900099 - Operation failed.
* @syscap SystemCapability.Communication.Bluetooth.Core
* @atomicservice
* @since 12
*/
/**
* Obtains the name of BLE peripheral device.
*
* @permission ohos.permission.ACCESS_BLUETOOTH
* @returns { Promise } Returns a string representation of the name if obtained;
* @throws { BusinessError } 201 - Permission denied.
* @throws { BusinessError } 401 - Invalid parameter.Possible causes: 1. Mandatory parameters are left unspecified.
*
2. Incorrect parameter types.
* @throws { BusinessError } 801 - Capability not supported.
* @throws { BusinessError } 2900001 - Service stopped.
* @throws { BusinessError } 2900099 - Operation failed.
* @syscap SystemCapability.Communication.Bluetooth.Core
* @crossplatform
* @atomicservice
* @since 13
*/
getDeviceName(): Promise;
/**
* Starts discovering services.
*
* @permission ohos.permission.ACCESS_BLUETOOTH
* @param { AsyncCallback> } callback - Callback used to catch the services.
* @throws { BusinessError } 201 - Permission denied.
* @throws { BusinessError } 401 - Invalid parameter. Possible causes: 1. Mandatory parameters are left unspecified.
*
2. Incorrect parameter types.
* @throws { BusinessError } 801 - Capability not supported.
* @throws { BusinessError } 2900001 - Service stopped.
* @throws { BusinessError } 2900099 - Operation failed.
* @syscap SystemCapability.Communication.Bluetooth.Core
* @since 10
*/
/**
* Starts discovering services.
*
* @permission ohos.permission.ACCESS_BLUETOOTH
* @param { AsyncCallback> } callback - Callback used to catch the services.
* @throws { BusinessError } 201 - Permission denied.
* @throws { BusinessError } 401 - Invalid parameter. Possible causes: 1. Mandatory parameters are left unspecified.
*
2. Incorrect parameter types.
* @throws { BusinessError } 801 - Capability not supported.
* @throws { BusinessError } 2900001 - Service stopped.
* @throws { BusinessError } 2900099 - Operation failed.
* @syscap SystemCapability.Communication.Bluetooth.Core
* @atomicservice
* @since 12
*/
/**
* Starts discovering services.
*
* @permission ohos.permission.ACCESS_BLUETOOTH
* @param { AsyncCallback> } callback - Callback used to catch the services.
* @throws { BusinessError } 201 - Permission denied.
* @throws { BusinessError } 401 - Invalid parameter. Possible causes: 1. Mandatory parameters are left unspecified.
*
2. Incorrect parameter types.
* @throws { BusinessError } 801 - Capability not supported.
* @throws { BusinessError } 2900001 - Service stopped.
* @throws { BusinessError } 2900099 - Operation failed.
* @syscap SystemCapability.Communication.Bluetooth.Core
* @crossplatform
* @atomicservice
* @since 13
*/
getServices(callback: AsyncCallback>): void;
/**
* Starts discovering services.
*
* @permission ohos.permission.ACCESS_BLUETOOTH
* @returns { Promise> } Returns the list of services {@link GattService} of the BLE peripheral device.
* @throws { BusinessError } 201 - Permission denied.
* @throws { BusinessError } 401 - Invalid parameter. Possible causes: 1. Mandatory parameters are left unspecified.
*
2. Incorrect parameter types. 3. Parameter verification failed.
* @throws { BusinessError } 801 - Capability not supported.
* @throws { BusinessError } 2900001 - Service stopped.
* @throws { BusinessError } 2900099 - Operation failed.
* @syscap SystemCapability.Communication.Bluetooth.Core
* @since 10
*/
/**
* Starts discovering services.
*
* @permission ohos.permission.ACCESS_BLUETOOTH
* @returns { Promise> } Returns the list of services {@link GattService} of the BLE peripheral device.
* @throws { BusinessError } 201 - Permission denied.
* @throws { BusinessError } 401 - Invalid parameter. Possible causes: 1. Mandatory parameters are left unspecified.
*
2. Incorrect parameter types. 3. Parameter verification failed.
* @throws { BusinessError } 801 - Capability not supported.
* @throws { BusinessError } 2900001 - Service stopped.
* @throws { BusinessError } 2900099 - Operation failed.
* @syscap SystemCapability.Communication.Bluetooth.Core
* @atomicservice
* @since 12
*/
/**
* Starts discovering services.
*
* @permission ohos.permission.ACCESS_BLUETOOTH
* @returns { Promise> } Returns the list of services {@link GattService} of the BLE peripheral device.
* @throws { BusinessError } 201 - Permission denied.
* @throws { BusinessError } 401 - Invalid parameter. Possible causes: 1. Mandatory parameters are left unspecified.
*
2. Incorrect parameter types. 3. Parameter verification failed.
* @throws { BusinessError } 801 - Capability not supported.
* @throws { BusinessError } 2900001 - Service stopped.
* @throws { BusinessError } 2900099 - Operation failed.
* @syscap SystemCapability.Communication.Bluetooth.Core
* @crossplatform
* @atomicservice
* @since 13
*/
getServices(): Promise>;
/**
* Reads the characteristic of a BLE peripheral device.
*
* @permission ohos.permission.ACCESS_BLUETOOTH
* @param { BLECharacteristic } characteristic - Indicates the characteristic to read.
* @param { AsyncCallback } callback - Callback invoked to return the characteristic value read.
* @throws { BusinessError } 201 - Permission denied.
* @throws { BusinessError } 401 - Invalid parameter. Possible causes: 1. Mandatory parameters are left unspecified.
*
2. Incorrect parameter types. 3. Parameter verification failed.
* @throws { BusinessError } 801 - Capability not supported.
* @throws { BusinessError } 2900001 - Service stopped.
* @throws { BusinessError } 2901000 - Read forbidden.
* @throws { BusinessError } 2900099 - Operation failed.
* @syscap SystemCapability.Communication.Bluetooth.Core
* @since 10
*/
/**
* Reads the characteristic of a BLE peripheral device.
*
* @permission ohos.permission.ACCESS_BLUETOOTH
* @param { BLECharacteristic } characteristic - Indicates the characteristic to read.
* @param { AsyncCallback } callback - Callback invoked to return the characteristic value read.
* @throws { BusinessError } 201 - Permission denied.
* @throws { BusinessError } 401 - Invalid parameter. Possible causes: 1. Mandatory parameters are left unspecified.
*
2. Incorrect parameter types. 3. Parameter verification failed.
* @throws { BusinessError } 801 - Capability not supported.
* @throws { BusinessError } 2900001 - Service stopped.
* @throws { BusinessError } 2901000 - Read forbidden.
* @throws { BusinessError } 2900099 - Operation failed.
* @syscap SystemCapability.Communication.Bluetooth.Core
* @atomicservice
* @since 12
*/
/**
* Reads the characteristic of a BLE peripheral device.
*
* @permission ohos.permission.ACCESS_BLUETOOTH
* @param { BLECharacteristic } characteristic - Indicates the characteristic to read.
* @param { AsyncCallback } callback - Callback invoked to return the characteristic value read.
* @throws { BusinessError } 201 - Permission denied.
* @throws { BusinessError } 401 - Invalid parameter. Possible causes: 1. Mandatory parameters are left unspecified.
*
2. Incorrect parameter types. 3. Parameter verification failed.
* @throws { BusinessError } 801 - Capability not supported.
* @throws { BusinessError } 2900001 - Service stopped.
* @throws { BusinessError } 2901000 - Read forbidden.
* @throws { BusinessError } 2900099 - Operation failed.
* @syscap SystemCapability.Communication.Bluetooth.Core
* @crossplatform
* @atomicservice
* @since 13
*/
readCharacteristicValue(characteristic: BLECharacteristic, callback: AsyncCallback): void;
/**
* Reads the characteristic of a BLE peripheral device.
*
* @permission ohos.permission.ACCESS_BLUETOOTH
* @param { BLECharacteristic } characteristic - Indicates the characteristic to read.
* @returns { Promise } - Promise used to return the characteristic value read.
* @throws { BusinessError } 201 - Permission denied.
* @throws { BusinessError } 401 - Invalid parameter. Possible causes: 1. Mandatory parameters are left unspecified.
*
2. Incorrect parameter types. 3. Parameter verification failed.
* @throws { BusinessError } 801 - Capability not supported.
* @throws { BusinessError } 2900001 - Service stopped.
* @throws { BusinessError } 2901000 - Read forbidden.
* @throws { BusinessError } 2900099 - Operation failed.
* @syscap SystemCapability.Communication.Bluetooth.Core
* @since 10
*/
/**
* Reads the characteristic of a BLE peripheral device.
*
* @permission ohos.permission.ACCESS_BLUETOOTH
* @param { BLECharacteristic } characteristic - Indicates the characteristic to read.
* @returns { Promise } - Promise used to return the characteristic value read.
* @throws { BusinessError } 201 - Permission denied.
* @throws { BusinessError } 401 - Invalid parameter. Possible causes: 1. Mandatory parameters are left unspecified.
*
2. Incorrect parameter types. 3. Parameter verification failed.
* @throws { BusinessError } 801 - Capability not supported.
* @throws { BusinessError } 2900001 - Service stopped.
* @throws { BusinessError } 2901000 - Read forbidden.
* @throws { BusinessError } 2900099 - Operation failed.
* @syscap SystemCapability.Communication.Bluetooth.Core
* @atomicservice
* @since 12
*/
/**
* Reads the characteristic of a BLE peripheral device.
*
* @permission ohos.permission.ACCESS_BLUETOOTH
* @param { BLECharacteristic } characteristic - Indicates the characteristic to read.
* @returns { Promise } - Promise used to return the characteristic value read.
* @throws { BusinessError } 201 - Permission denied.
* @throws { BusinessError } 401 - Invalid parameter. Possible causes: 1. Mandatory parameters are left unspecified.
*
2. Incorrect parameter types. 3. Parameter verification failed.
* @throws { BusinessError } 801 - Capability not supported.
* @throws { BusinessError } 2900001 - Service stopped.
* @throws { BusinessError } 2901000 - Read forbidden.
* @throws { BusinessError } 2900099 - Operation failed.
* @syscap SystemCapability.Communication.Bluetooth.Core
* @crossplatform
* @atomicservice
* @since 13
*/
readCharacteristicValue(characteristic: BLECharacteristic): Promise;
/**
* Reads the descriptor of a BLE peripheral device.
*
* @permission ohos.permission.ACCESS_BLUETOOTH
* @param { BLEDescriptor } descriptor - Indicates the descriptor to read.
* @param { AsyncCallback } callback - Callback invoked to return the descriptor read.
* @throws { BusinessError } 201 - Permission denied.
* @throws { BusinessError } 401 - Invalid parameter. Possible causes: 1. Mandatory parameters are left unspecified.
*
2. Incorrect parameter types. 3. Parameter verification failed.
* @throws { BusinessError } 801 - Capability not supported.
* @throws { BusinessError } 2900001 - Service stopped.
* @throws { BusinessError } 2901000 - Read forbidden.
* @throws { BusinessError } 2900099 - Operation failed.
* @syscap SystemCapability.Communication.Bluetooth.Core
* @since 10
*/
/**
* Reads the descriptor of a BLE peripheral device.
*
* @permission ohos.permission.ACCESS_BLUETOOTH
* @param { BLEDescriptor } descriptor - Indicates the descriptor to read.
* @param { AsyncCallback } callback - Callback invoked to return the descriptor read.
* @throws { BusinessError } 201 - Permission denied.
* @throws { BusinessError } 401 - Invalid parameter. Possible causes: 1. Mandatory parameters are left unspecified.
*
2. Incorrect parameter types. 3. Parameter verification failed.
* @throws { BusinessError } 801 - Capability not supported.
* @throws { BusinessError } 2900001 - Service stopped.
* @throws { BusinessError } 2901000 - Read forbidden.
* @throws { BusinessError } 2900099 - Operation failed.
* @syscap SystemCapability.Communication.Bluetooth.Core
* @atomicservice
* @since 12
*/
/**
* Reads the descriptor of a BLE peripheral device.
*
* @permission ohos.permission.ACCESS_BLUETOOTH
* @param { BLEDescriptor } descriptor - Indicates the descriptor to read.
* @param { AsyncCallback } callback - Callback invoked to return the descriptor read.
* @throws { BusinessError } 201 - Permission denied.
* @throws { BusinessError } 401 - Invalid parameter. Possible causes: 1. Mandatory parameters are left unspecified.
*
2. Incorrect parameter types. 3. Parameter verification failed.
* @throws { BusinessError } 801 - Capability not supported.
* @throws { BusinessError } 2900001 - Service stopped.
* @throws { BusinessError } 2901000 - Read forbidden.
* @throws { BusinessError } 2900099 - Operation failed.
* @syscap SystemCapability.Communication.Bluetooth.Core
* @crossplatform
* @atomicservice
* @since 13
*/
readDescriptorValue(descriptor: BLEDescriptor, callback: AsyncCallback): void;
/**
* Reads the descriptor of a BLE peripheral device.
*
* @permission ohos.permission.ACCESS_BLUETOOTH
* @param { BLEDescriptor } descriptor - Indicates the descriptor to read.
* @returns { Promise } - Promise used to return the descriptor read.
* @throws { BusinessError } 201 - Permission denied.
* @throws { BusinessError } 401 - Invalid parameter. Possible causes: 1. Mandatory parameters are left unspecified.
*
2. Incorrect parameter types. 3. Parameter verification failed.
* @throws { BusinessError } 801 - Capability not supported.
* @throws { BusinessError } 2900001 - Service stopped.
* @throws { BusinessError } 2901000 - Read forbidden.
* @throws { BusinessError } 2900099 - Operation failed.
* @syscap SystemCapability.Communication.Bluetooth.Core
* @since 10
*/
/**
* Reads the descriptor of a BLE peripheral device.
*
* @permission ohos.permission.ACCESS_BLUETOOTH
* @param { BLEDescriptor } descriptor - Indicates the descriptor to read.
* @returns { Promise } - Promise used to return the descriptor read.
* @throws { BusinessError } 201 - Permission denied.
* @throws { BusinessError } 401 - Invalid parameter. Possible causes: 1. Mandatory parameters are left unspecified.
*
2. Incorrect parameter types. 3. Parameter verification failed.
* @throws { BusinessError } 801 - Capability not supported.
* @throws { BusinessError } 2900001 - Service stopped.
* @throws { BusinessError } 2901000 - Read forbidden.
* @throws { BusinessError } 2900099 - Operation failed.
* @syscap SystemCapability.Communication.Bluetooth.Core
* @atomicservice
* @since 12
*/
/**
* Reads the descriptor of a BLE peripheral device.
*
* @permission ohos.permission.ACCESS_BLUETOOTH
* @param { BLEDescriptor } descriptor - Indicates the descriptor to read.
* @returns { Promise } - Promise used to return the descriptor read.
* @throws { BusinessError } 201 - Permission denied.
* @throws { BusinessError } 401 - Invalid parameter. Possible causes: 1. Mandatory parameters are left unspecified.
*
2. Incorrect parameter types. 3. Parameter verification failed.
* @throws { BusinessError } 801 - Capability not supported.
* @throws { BusinessError } 2900001 - Service stopped.
* @throws { BusinessError } 2901000 - Read forbidden.
* @throws { BusinessError } 2900099 - Operation failed.
* @syscap SystemCapability.Communication.Bluetooth.Core
* @crossplatform
* @atomicservice
* @since 13
*/
readDescriptorValue(descriptor: BLEDescriptor): Promise;
/**
* Writes the characteristic of a BLE peripheral device.
*
* @permission ohos.permission.ACCESS_BLUETOOTH
* @param { BLECharacteristic } characteristic - Indicates the characteristic to write.
* @param { GattWriteType } writeType - Write type of the characteristic.
* @param { AsyncCallback } callback - Callback used to return the result.
* @throws { BusinessError } 201 - Permission denied.
* @throws { BusinessError } 401 - Invalid parameter. Possible causes: 1. Mandatory parameters are left unspecified.
*
2. Incorrect parameter types. 3. Parameter verification failed.
* @throws { BusinessError } 801 - Capability not supported.
* @throws { BusinessError } 2900001 - Service stopped.
* @throws { BusinessError } 2901001 - Write forbidden.
* @throws { BusinessError } 2900099 - Operation failed.
* @syscap SystemCapability.Communication.Bluetooth.Core
* @since 10
*/
/**
* Writes the characteristic of a BLE peripheral device.
*
* @permission ohos.permission.ACCESS_BLUETOOTH
* @param { BLECharacteristic } characteristic - Indicates the characteristic to write.
* @param { GattWriteType } writeType - Write type of the characteristic.
* @param { AsyncCallback } callback - Callback used to return the result.
* @throws { BusinessError } 201 - Permission denied.
* @throws { BusinessError } 401 - Invalid parameter. Possible causes: 1. Mandatory parameters are left unspecified.
*
2. Incorrect parameter types. 3. Parameter verification failed.
* @throws { BusinessError } 801 - Capability not supported.
* @throws { BusinessError } 2900001 - Service stopped.
* @throws { BusinessError } 2901001 - Write forbidden.
* @throws { BusinessError } 2900099 - Operation failed.
* @syscap SystemCapability.Communication.Bluetooth.Core
* @atomicservice
* @since 12
*/
/**
* Writes the characteristic of a BLE peripheral device.
*
* @permission ohos.permission.ACCESS_BLUETOOTH
* @param { BLECharacteristic } characteristic - Indicates the characteristic to write.
* @param { GattWriteType } writeType - Write type of the characteristic.
* @param { AsyncCallback } callback - Callback used to return the result.
* @throws { BusinessError } 201 - Permission denied.
* @throws { BusinessError } 401 - Invalid parameter. Possible causes: 1. Mandatory parameters are left unspecified.
*
2. Incorrect parameter types. 3. Parameter verification failed.
* @throws { BusinessError } 801 - Capability not supported.
* @throws { BusinessError } 2900001 - Service stopped.
* @throws { BusinessError } 2901001 - Write forbidden.
* @throws { BusinessError } 2900099 - Operation failed.
* @syscap SystemCapability.Communication.Bluetooth.Core
* @crossplatform
* @atomicservice
* @since 13
*/
writeCharacteristicValue(
characteristic: BLECharacteristic,
writeType: GattWriteType,
callback: AsyncCallback
): void;
/**
* Writes the characteristic of a BLE peripheral device.
*
* @permission ohos.permission.ACCESS_BLUETOOTH
* @param { BLECharacteristic } characteristic - Indicates the characteristic to write.
* @param { GattWriteType } writeType - Write type of the characteristic.
* @returns { Promise } Promise used to return the result.
* @throws { BusinessError } 201 - Permission denied.
* @throws { BusinessError } 401 - Invalid parameter. Possible causes: 1. Mandatory parameters are left unspecified.
*
2. Incorrect parameter types. 3. Parameter verification failed.
* @throws { BusinessError } 801 - Capability not supported.
* @throws { BusinessError } 2900001 - Service stopped.
* @throws { BusinessError } 2901001 - Write forbidden.
* @throws { BusinessError } 2900099 - Operation failed.
* @syscap SystemCapability.Communication.Bluetooth.Core
* @since 10
*/
/**
* Writes the characteristic of a BLE peripheral device.
*
* @permission ohos.permission.ACCESS_BLUETOOTH
* @param { BLECharacteristic } characteristic - Indicates the characteristic to write.
* @param { GattWriteType } writeType - Write type of the characteristic.
* @returns { Promise } Promise used to return the result.
* @throws { BusinessError } 201 - Permission denied.
* @throws { BusinessError } 401 - Invalid parameter. Possible causes: 1. Mandatory parameters are left unspecified.
*
2. Incorrect parameter types. 3. Parameter verification failed.
* @throws { BusinessError } 801 - Capability not supported.
* @throws { BusinessError } 2900001 - Service stopped.
* @throws { BusinessError } 2901001 - Write forbidden.
* @throws { BusinessError } 2900099 - Operation failed.
* @syscap SystemCapability.Communication.Bluetooth.Core
* @atomicservice
* @since 12
*/
/**
* Writes the characteristic of a BLE peripheral device.
*
* @permission ohos.permission.ACCESS_BLUETOOTH
* @param { BLECharacteristic } characteristic - Indicates the characteristic to write.
* @param { GattWriteType } writeType - Write type of the characteristic.
* @returns { Promise } Promise used to return the result.
* @throws { BusinessError } 201 - Permission denied.
* @throws { BusinessError } 401 - Invalid parameter. Possible causes: 1. Mandatory parameters are left unspecified.
*
2. Incorrect parameter types. 3. Parameter verification failed.
* @throws { BusinessError } 801 - Capability not supported.
* @throws { BusinessError } 2900001 - Service stopped.
* @throws { BusinessError } 2901001 - Write forbidden.
* @throws { BusinessError } 2900099 - Operation failed.
* @syscap SystemCapability.Communication.Bluetooth.Core
* @crossplatform
* @atomicservice
* @since 13
*/
writeCharacteristicValue(characteristic: BLECharacteristic, writeType: GattWriteType): Promise;
/**
* Writes the descriptor of a BLE peripheral device.
*
* @permission ohos.permission.ACCESS_BLUETOOTH
* @param { BLEDescriptor } descriptor - Indicates the descriptor to write.
* @param { AsyncCallback } callback - Callback used to return the result.
* @throws { BusinessError } 201 - Permission denied.
* @throws { BusinessError } 401 - Invalid parameter. Possible causes: 1. Mandatory parameters are left unspecified.
*
2. Incorrect parameter types. 3. Parameter verification failed.
* @throws { BusinessError } 801 - Capability not supported.
* @throws { BusinessError } 2900001 - Service stopped.
* @throws { BusinessError } 2901001 - Write forbidden.
* @throws { BusinessError } 2900099 - Operation failed.
* @syscap SystemCapability.Communication.Bluetooth.Core
* @since 10
*/
/**
* Writes the descriptor of a BLE peripheral device.
*
* @permission ohos.permission.ACCESS_BLUETOOTH
* @param { BLEDescriptor } descriptor - Indicates the descriptor to write.
* @param { AsyncCallback } callback - Callback used to return the result.
* @throws { BusinessError } 201 - Permission denied.
* @throws { BusinessError } 401 - Invalid parameter. Possible causes: 1. Mandatory parameters are left unspecified.
*
2. Incorrect parameter types. 3. Parameter verification failed.
* @throws { BusinessError } 801 - Capability not supported.
* @throws { BusinessError } 2900001 - Service stopped.
* @throws { BusinessError } 2901001 - Write forbidden.
* @throws { BusinessError } 2900099 - Operation failed.
* @syscap SystemCapability.Communication.Bluetooth.Core
* @atomicservice
* @since 12
*/
/**
* Writes the descriptor of a BLE peripheral device.
*
* @permission ohos.permission.ACCESS_BLUETOOTH
* @param { BLEDescriptor } descriptor - Indicates the descriptor to write.
* @param { AsyncCallback } callback - Callback used to return the result.
* @throws { BusinessError } 201 - Permission denied.
* @throws { BusinessError } 401 - Invalid parameter. Possible causes: 1. Mandatory parameters are left unspecified.
*
2. Incorrect parameter types. 3. Parameter verification failed.
* @throws { BusinessError } 801 - Capability not supported.
* @throws { BusinessError } 2900001 - Service stopped.
* @throws { BusinessError } 2901001 - Write forbidden.
* @throws { BusinessError } 2900099 - Operation failed.
* @syscap SystemCapability.Communication.Bluetooth.Core
* @crossplatform
* @atomicservice
* @since 13
*/
writeDescriptorValue(descriptor: BLEDescriptor, callback: AsyncCallback): void;
/**
* Writes the descriptor of a BLE peripheral device.
*
* @permission ohos.permission.ACCESS_BLUETOOTH
* @param { BLEDescriptor } descriptor - Indicates the descriptor to write.
* @returns { Promise } Promise used to return the result.
* @throws { BusinessError } 201 - Permission denied.
* @throws { BusinessError } 401 - Invalid parameter. Possible causes: 1. Mandatory parameters are left unspecified.
*
2. Incorrect parameter types. 3. Parameter verification failed.
* @throws { BusinessError } 801 - Capability not supported.
* @throws { BusinessError } 2900001 - Service stopped.
* @throws { BusinessError } 2901001 - Write forbidden.
* @throws { BusinessError } 2900099 - Operation failed.
* @syscap SystemCapability.Communication.Bluetooth.Core
* @since 10
*/
/**
* Writes the descriptor of a BLE peripheral device.
*
* @permission ohos.permission.ACCESS_BLUETOOTH
* @param { BLEDescriptor } descriptor - Indicates the descriptor to write.
* @returns { Promise } Promise used to return the result.
* @throws { BusinessError } 201 - Permission denied.
* @throws { BusinessError } 401 - Invalid parameter. Possible causes: 1. Mandatory parameters are left unspecified.
*
2. Incorrect parameter types. 3. Parameter verification failed.
* @throws { BusinessError } 801 - Capability not supported.
* @throws { BusinessError } 2900001 - Service stopped.
* @throws { BusinessError } 2901001 - Write forbidden.
* @throws { BusinessError } 2900099 - Operation failed.
* @syscap SystemCapability.Communication.Bluetooth.Core
* @atomicservice
* @since 12
*/
/**
* Writes the descriptor of a BLE peripheral device.
*
* @permission ohos.permission.ACCESS_BLUETOOTH
* @param { BLEDescriptor } descriptor - Indicates the descriptor to write.
* @returns { Promise } Promise used to return the result.
* @throws { BusinessError } 201 - Permission denied.
* @throws { BusinessError } 401 - Invalid parameter. Possible causes: 1. Mandatory parameters are left unspecified.
*
2. Incorrect parameter types. 3. Parameter verification failed.
* @throws { BusinessError } 801 - Capability not supported.
* @throws { BusinessError } 2900001 - Service stopped.
* @throws { BusinessError } 2901001 - Write forbidden.
* @throws { BusinessError } 2900099 - Operation failed.
* @syscap SystemCapability.Communication.Bluetooth.Core
* @crossplatform
* @atomicservice
* @since 13
*/
writeDescriptorValue(descriptor: BLEDescriptor): Promise;
/**
* Get the RSSI value of this BLE peripheral device.
*
* @permission ohos.permission.ACCESS_BLUETOOTH
* @param { AsyncCallback } callback - Callback invoked to return the RSSI, in dBm.
* @throws { BusinessError } 201 - Permission denied.
* @throws { BusinessError } 401 - Invalid parameter. Possible causes: 1. Mandatory parameters are left unspecified.
*
2. Incorrect parameter types. 3. Parameter verification failed.
* @throws { BusinessError } 801 - Capability not supported.
* @throws { BusinessError } 2900099 - Operation failed.
* @syscap SystemCapability.Communication.Bluetooth.Core
* @since 10
*/
/**
* Get the RSSI value of this BLE peripheral device.
*
* @permission ohos.permission.ACCESS_BLUETOOTH
* @param { AsyncCallback } callback - Callback invoked to return the RSSI, in dBm.
* @throws { BusinessError } 201 - Permission denied.
* @throws { BusinessError } 401 - Invalid parameter. Possible causes: 1. Mandatory parameters are left unspecified.
*
2. Incorrect parameter types. 3. Parameter verification failed.
* @throws { BusinessError } 801 - Capability not supported.
* @throws { BusinessError } 2900099 - Operation failed.
* @syscap SystemCapability.Communication.Bluetooth.Core
* @atomicservice
* @since 12
*/
getRssiValue(callback: AsyncCallback): void;
/**
* Get the RSSI value of this BLE peripheral device.
*
* @permission ohos.permission.ACCESS_BLUETOOTH
* @returns { Promise } Returns the RSSI value.
* @throws { BusinessError } 201 - Permission denied.
* @throws { BusinessError } 401 - Invalid parameter. Possible causes: 1. Mandatory parameters are left unspecified.
*
2. Incorrect parameter types.
* @throws { BusinessError } 801 - Capability not supported.
* @throws { BusinessError } 2900099 - Operation failed.
* @syscap SystemCapability.Communication.Bluetooth.Core
* @since 10
*/
/**
* Get the RSSI value of this BLE peripheral device.
*
* @permission ohos.permission.ACCESS_BLUETOOTH
* @returns { Promise } Returns the RSSI value.
* @throws { BusinessError } 201 - Permission denied.
* @throws { BusinessError } 401 - Invalid parameter. Possible causes: 1. Mandatory parameters are left unspecified.
*
2. Incorrect parameter types.
* @throws { BusinessError } 801 - Capability not supported.
* @throws { BusinessError } 2900099 - Operation failed.
* @syscap SystemCapability.Communication.Bluetooth.Core
* @atomicservice
* @since 12
*/
getRssiValue(): Promise;
/**
* Set the mtu size of a BLE peripheral device.
*
* @permission ohos.permission.ACCESS_BLUETOOTH
* @param { number } mtu - The maximum transmission unit.
* @throws { BusinessError } 201 - Permission denied.
* @throws { BusinessError } 401 - Invalid parameter. Possible causes: 1. Mandatory parameters are left unspecified.
*
2. Incorrect parameter types. 3. Parameter verification failed.
* @throws { BusinessError } 801 - Capability not supported.
* @throws { BusinessError } 2900001 - Service stopped.
* @throws { BusinessError } 2900099 - Operation failed.
* @syscap SystemCapability.Communication.Bluetooth.Core
* @since 10
*/
/**
* Set the mtu size of a BLE peripheral device.
*
* @permission ohos.permission.ACCESS_BLUETOOTH
* @param { number } mtu - The maximum transmission unit.
* @throws { BusinessError } 201 - Permission denied.
* @throws { BusinessError } 401 - Invalid parameter. Possible causes: 1. Mandatory parameters are left unspecified.
*
2. Incorrect parameter types. 3. Parameter verification failed.
* @throws { BusinessError } 801 - Capability not supported.
* @throws { BusinessError } 2900001 - Service stopped.
* @throws { BusinessError } 2900099 - Operation failed.
* @syscap SystemCapability.Communication.Bluetooth.Core
* @atomicservice
* @since 12
*/
/**
* Set the mtu size of a BLE peripheral device.
*
* @permission ohos.permission.ACCESS_BLUETOOTH
* @param { number } mtu - The maximum transmission unit.
* @throws { BusinessError } 201 - Permission denied.
* @throws { BusinessError } 401 - Invalid parameter. Possible causes: 1. Mandatory parameters are left unspecified.
*
2. Incorrect parameter types. 3. Parameter verification failed.
* @throws { BusinessError } 801 - Capability not supported.
* @throws { BusinessError } 2900001 - Service stopped.
* @throws { BusinessError } 2900099 - Operation failed.
* @syscap SystemCapability.Communication.Bluetooth.Core
* @crossplatform
* @atomicservice
* @since 13
*/
setBLEMtuSize(mtu: number): void;
/**
* Enables or disables notification of a characteristic when value changed.
*
* @permission ohos.permission.ACCESS_BLUETOOTH
* @param { BLECharacteristic } characteristic - Indicates the characteristic to indicate.
* @param { boolean } enable - Specifies whether to enable indication of the characteristic. The value {@code true} indicates
* that notification is enabled, and the value {@code false} indicates that indication is disabled.
* @param { AsyncCallback } callback - the callback of setCharacteristicChangeNotification.
* @throws { BusinessError } 201 - Permission denied.
* @throws { BusinessError } 401 - Invalid parameter. Possible causes: 1. Mandatory parameters are left unspecified.
*
2. Incorrect parameter types. 3. Parameter verification failed.
* @throws { BusinessError } 801 - Capability not supported.
* @throws { BusinessError } 2900001 - Service stopped.
* @throws { BusinessError } 2900099 - Operation failed.
* @syscap SystemCapability.Communication.Bluetooth.Core
* @since 10
*/
/**
* Enables or disables notification of a characteristic when value changed.
*
* @permission ohos.permission.ACCESS_BLUETOOTH
* @param { BLECharacteristic } characteristic - Indicates the characteristic to indicate.
* @param { boolean } enable - Specifies whether to enable indication of the characteristic. The value {@code true} indicates
* that notification is enabled, and the value {@code false} indicates that indication is disabled.
* @param { AsyncCallback } callback - the callback of setCharacteristicChangeNotification.
* @throws { BusinessError } 201 - Permission denied.
* @throws { BusinessError } 401 - Invalid parameter. Possible causes: 1. Mandatory parameters are left unspecified.
*
2. Incorrect parameter types. 3. Parameter verification failed.
* @throws { BusinessError } 801 - Capability not supported.
* @throws { BusinessError } 2900001 - Service stopped.
* @throws { BusinessError } 2900099 - Operation failed.
* @syscap SystemCapability.Communication.Bluetooth.Core
* @atomicservice
* @since 12
*/
setCharacteristicChangeNotification(
characteristic: BLECharacteristic,
enable: boolean,
callback: AsyncCallback
): void;
/**
* Enables or disables indication of a characteristic when value changed.
*
* @permission ohos.permission.ACCESS_BLUETOOTH
* @param { BLECharacteristic } characteristic - Indicates the characteristic to indicate.
* @param { boolean } enable - Specifies whether to enable indication of the characteristic. The value {@code true} indicates
* that indication is enabled, and the value {@code false} indicates that indication is disabled.
* @returns { Promise } Returns the promise object.
* @throws { BusinessError } 201 - Permission denied.
* @throws { BusinessError } 401 - Invalid parameter. Possible causes: 1. Mandatory parameters are left unspecified.
*
2. Incorrect parameter types. 3. Parameter verification failed.
* @throws { BusinessError } 801 - Capability not supported.
* @throws { BusinessError } 2900001 - Service stopped.
* @throws { BusinessError } 2900099 - Operation failed.
* @syscap SystemCapability.Communication.Bluetooth.Core
* @since 10
*/
/**
* Enables or disables indication of a characteristic when value changed.
*
* @permission ohos.permission.ACCESS_BLUETOOTH
* @param { BLECharacteristic } characteristic - Indicates the characteristic to indicate.
* @param { boolean } enable - Specifies whether to enable indication of the characteristic. The value {@code true} indicates
* that indication is enabled, and the value {@code false} indicates that indication is disabled.
* @returns { Promise } Returns the promise object.
* @throws { BusinessError } 201 - Permission denied.
* @throws { BusinessError } 401 - Invalid parameter. Possible causes: 1. Mandatory parameters are left unspecified.
*
2. Incorrect parameter types. 3. Parameter verification failed.
* @throws { BusinessError } 801 - Capability not supported.
* @throws { BusinessError } 2900001 - Service stopped.
* @throws { BusinessError } 2900099 - Operation failed.
* @syscap SystemCapability.Communication.Bluetooth.Core
* @atomicservice
* @since 12
*/
setCharacteristicChangeNotification(characteristic: BLECharacteristic, enable: boolean): Promise;
/**
* Enables or disables indication of a characteristic when value changed.
*
* @permission ohos.permission.ACCESS_BLUETOOTH
* @param { BLECharacteristic } characteristic - Indicates the characteristic to indicate.
* @param { boolean } enable - Specifies whether to enable indication of the characteristic. The value {@code true} indicates
* that indication is enabled, and the value {@code false} indicates that indication is disabled.
* @param { AsyncCallback } callback - the callback of setCharacteristicChangeIndication.
* @throws { BusinessError } 201 - Permission denied.
* @throws { BusinessError } 401 - Invalid parameter. Possible causes: 1. Mandatory parameters are left unspecified.
*
2. Incorrect parameter types. 3. Parameter verification failed.
* @throws { BusinessError } 801 - Capability not supported.
* @throws { BusinessError } 2900001 - Service stopped.
* @throws { BusinessError } 2900099 - Operation failed.
* @syscap SystemCapability.Communication.Bluetooth.Core
* @since 10
*/
/**
* Enables or disables indication of a characteristic when value changed.
*
* @permission ohos.permission.ACCESS_BLUETOOTH
* @param { BLECharacteristic } characteristic - Indicates the characteristic to indicate.
* @param { boolean } enable - Specifies whether to enable indication of the characteristic. The value {@code true} indicates
* that indication is enabled, and the value {@code false} indicates that indication is disabled.
* @param { AsyncCallback } callback - the callback of setCharacteristicChangeIndication.
* @throws { BusinessError } 201 - Permission denied.
* @throws { BusinessError } 401 - Invalid parameter. Possible causes: 1. Mandatory parameters are left unspecified.
*
2. Incorrect parameter types. 3. Parameter verification failed.
* @throws { BusinessError } 801 - Capability not supported.
* @throws { BusinessError } 2900001 - Service stopped.
* @throws { BusinessError } 2900099 - Operation failed.
* @syscap SystemCapability.Communication.Bluetooth.Core
* @atomicservice
* @since 12
*/
setCharacteristicChangeIndication(
characteristic: BLECharacteristic,
enable: boolean,
callback: AsyncCallback
): void;
/**
* Enables or disables indication of a characteristic when value changed.
*
* @permission ohos.permission.ACCESS_BLUETOOTH
* @param { BLECharacteristic } characteristic - Indicates the characteristic to indicate.
* @param { boolean } enable - Specifies whether to enable indication of the characteristic. The value {@code true} indicates
* that indication is enabled, and the value {@code false} indicates that indication is disabled.
* @returns { Promise } Returns the promise object.
* @throws { BusinessError } 201 - Permission denied.
* @throws { BusinessError } 401 - Invalid parameter. Possible causes: 1. Mandatory parameters are left unspecified.
*
2. Incorrect parameter types. 3. Parameter verification failed.
* @throws { BusinessError } 801 - Capability not supported.
* @throws { BusinessError } 2900001 - Service stopped.
* @throws { BusinessError } 2900099 - Operation failed.
* @syscap SystemCapability.Communication.Bluetooth.Core
* @since 10
*/
/**
* Enables or disables indication of a characteristic when value changed.
*
* @permission ohos.permission.ACCESS_BLUETOOTH
* @param { BLECharacteristic } characteristic - Indicates the characteristic to indicate.
* @param { boolean } enable - Specifies whether to enable indication of the characteristic. The value {@code true} indicates
* that indication is enabled, and the value {@code false} indicates that indication is disabled.
* @returns { Promise } Returns the promise object.
* @throws { BusinessError } 201 - Permission denied.
* @throws { BusinessError } 401 - Invalid parameter. Possible causes: 1. Mandatory parameters are left unspecified.
*
2. Incorrect parameter types. 3. Parameter verification failed.
* @throws { BusinessError } 801 - Capability not supported.
* @throws { BusinessError } 2900001 - Service stopped.
* @throws { BusinessError } 2900099 - Operation failed.
* @syscap SystemCapability.Communication.Bluetooth.Core
* @atomicservice
* @since 12
*/
setCharacteristicChangeIndication(characteristic: BLECharacteristic, enable: boolean): Promise;
/**
* Subscribe characteristic value changed event.
*
* @permission ohos.permission.ACCESS_BLUETOOTH
* @param { 'BLECharacteristicChange' } type - Type of the characteristic value changed event to listen for.
* @param { Callback } callback - Callback used to listen for the characteristic value changed event.
* @throws { BusinessError } 201 - Permission denied.
* @throws { BusinessError } 401 - Invalid parameter. Possible causes: 1. Mandatory parameters are left unspecified.
*
2. Incorrect parameter types. 3. Parameter verification failed.
* @throws { BusinessError } 801 - Capability not supported.
* @syscap SystemCapability.Communication.Bluetooth.Core
* @since 10
*/
/**
* Subscribe characteristic value changed event.
*
* @permission ohos.permission.ACCESS_BLUETOOTH
* @param { 'BLECharacteristicChange' } type - Type of the characteristic value changed event to listen for.
* @param { Callback } callback - Callback used to listen for the characteristic value changed event.
* @throws { BusinessError } 201 - Permission denied.
* @throws { BusinessError } 401 - Invalid parameter. Possible causes: 1. Mandatory parameters are left unspecified.
*
2. Incorrect parameter types. 3. Parameter verification failed.
* @throws { BusinessError } 801 - Capability not supported.
* @syscap SystemCapability.Communication.Bluetooth.Core
* @atomicservice
* @since 12
*/
on(type: 'BLECharacteristicChange', callback: Callback): void;
/**
* Unsubscribe characteristic value changed event.
*
* @permission ohos.permission.ACCESS_BLUETOOTH
* @param { 'BLECharacteristicChange' } type - Type of the characteristic value changed event to listen for.
* @param { Callback } callback - Callback used to listen for the characteristic value changed event.
* @throws { BusinessError } 201 - Permission denied.
* @throws { BusinessError } 401 - Invalid parameter. Possible causes: 1. Mandatory parameters are left unspecified.
*
2. Incorrect parameter types. 3. Parameter verification failed.
* @throws { BusinessError } 801 - Capability not supported.
* @syscap SystemCapability.Communication.Bluetooth.Core
* @since 10
*/
/**
* Unsubscribe characteristic value changed event.
*
* @permission ohos.permission.ACCESS_BLUETOOTH
* @param { 'BLECharacteristicChange' } type - Type of the characteristic value changed event to listen for.
* @param { Callback } callback - Callback used to listen for the characteristic value changed event.
* @throws { BusinessError } 201 - Permission denied.
* @throws { BusinessError } 401 - Invalid parameter. Possible causes: 1. Mandatory parameters are left unspecified.
*
2. Incorrect parameter types. 3. Parameter verification failed.
* @throws { BusinessError } 801 - Capability not supported.
* @syscap SystemCapability.Communication.Bluetooth.Core
* @atomicservice
* @since 12
*/
off(type: 'BLECharacteristicChange', callback?: Callback): void;
/**
* Subscribe client connection state changed event.
*
* @permission ohos.permission.ACCESS_BLUETOOTH
* @param { 'BLEConnectionStateChange' } type - Type of the connection state changed event to listen for.
* @param { Callback } callback - Callback used to listen for the connection state changed event.
* @throws { BusinessError } 201 - Permission denied.
* @throws { BusinessError } 401 - Invalid parameter. Possible causes: 1. Mandatory parameters are left unspecified.
*
2. Incorrect parameter types. 3. Parameter verification failed.
* @throws { BusinessError } 801 - Capability not supported.
* @syscap SystemCapability.Communication.Bluetooth.Core
* @since 10
*/
/**
* Subscribe client connection state changed event.
*
* @permission ohos.permission.ACCESS_BLUETOOTH
* @param { 'BLEConnectionStateChange' } type - Type of the connection state changed event to listen for.
* @param { Callback } callback - Callback used to listen for the connection state changed event.
* @throws { BusinessError } 201 - Permission denied.
* @throws { BusinessError } 401 - Invalid parameter. Possible causes: 1. Mandatory parameters are left unspecified.
*
2. Incorrect parameter types. 3. Parameter verification failed.
* @throws { BusinessError } 801 - Capability not supported.
* @syscap SystemCapability.Communication.Bluetooth.Core
* @atomicservice
* @since 12
*/
/**
* Subscribe client connection state changed event.
*
* @permission ohos.permission.ACCESS_BLUETOOTH
* @param { 'BLEConnectionStateChange' } type - Type of the connection state changed event to listen for.
* @param { Callback } callback - Callback used to listen for the connection state changed event.
* @throws { BusinessError } 201 - Permission denied.
* @throws { BusinessError } 401 - Invalid parameter. Possible causes: 1. Mandatory parameters are left unspecified.
*
2. Incorrect parameter types. 3. Parameter verification failed.
* @throws { BusinessError } 801 - Capability not supported.
* @syscap SystemCapability.Communication.Bluetooth.Core
* @crossplatform
* @atomicservice
* @since 13
*/
on(type: 'BLEConnectionStateChange', callback: Callback): void;
/**
* Unsubscribe client connection state changed event.
*
* @permission ohos.permission.ACCESS_BLUETOOTH
* @param { 'BLEConnectionStateChange' } type - Type of the connection state changed event to listen for.
* @param { Callback } callback - Callback used to listen for the connection state changed event.
* @throws { BusinessError } 201 - Permission denied.
* @throws { BusinessError } 401 - Invalid parameter. Possible causes: 1. Mandatory parameters are left unspecified.
*
2. Incorrect parameter types. 3. Parameter verification failed.
* @throws { BusinessError } 801 - Capability not supported.
* @syscap SystemCapability.Communication.Bluetooth.Core
* @since 10
*/
/**
* Unsubscribe client connection state changed event.
*
* @permission ohos.permission.ACCESS_BLUETOOTH
* @param { 'BLEConnectionStateChange' } type - Type of the connection state changed event to listen for.
* @param { Callback } callback - Callback used to listen for the connection state changed event.
* @throws { BusinessError } 201 - Permission denied.
* @throws { BusinessError } 401 - Invalid parameter. Possible causes: 1. Mandatory parameters are left unspecified.
*
2. Incorrect parameter types. 3. Parameter verification failed.
* @throws { BusinessError } 801 - Capability not supported.
* @syscap SystemCapability.Communication.Bluetooth.Core
* @atomicservice
* @since 12
*/
/**
* Unsubscribe client connection state changed event.
*
* @permission ohos.permission.ACCESS_BLUETOOTH
* @param { 'BLEConnectionStateChange' } type - Type of the connection state changed event to listen for.
* @param { Callback } callback - Callback used to listen for the connection state changed event.
* @throws { BusinessError } 201 - Permission denied.
* @throws { BusinessError } 401 - Invalid parameter. Possible causes: 1. Mandatory parameters are left unspecified.
*
2. Incorrect parameter types. 3. Parameter verification failed.
* @throws { BusinessError } 801 - Capability not supported.
* @syscap SystemCapability.Communication.Bluetooth.Core
* @crossplatform
* @atomicservice
* @since 13
*/
off(type: 'BLEConnectionStateChange', callback?: Callback): void;
/**
* Subscribe mtu changed event.
*
* @permission ohos.permission.ACCESS_BLUETOOTH
* @param { 'BLEMtuChange' } type - Type of the mtu changed event to listen for.
* @param { Callback } callback - Callback used to listen for the mtu changed event.
* @throws { BusinessError } 201 - Permission denied.
* @throws { BusinessError } 401 - Invalid parameter. Possible causes: 1. Mandatory parameters are left unspecified.
*
2. Incorrect parameter types. 3. Parameter verification failed.
* @throws { BusinessError } 801 - Capability not supported.
* @syscap SystemCapability.Communication.Bluetooth.Core
* @since 10
*/
/**
* Subscribe mtu changed event.
*
* @permission ohos.permission.ACCESS_BLUETOOTH
* @param { 'BLEMtuChange' } type - Type of the mtu changed event to listen for.
* @param { Callback } callback - Callback used to listen for the mtu changed event.
* @throws { BusinessError } 201 - Permission denied.
* @throws { BusinessError } 401 - Invalid parameter. Possible causes: 1. Mandatory parameters are left unspecified.
*
2. Incorrect parameter types. 3. Parameter verification failed.
* @throws { BusinessError } 801 - Capability not supported.
* @syscap SystemCapability.Communication.Bluetooth.Core
* @atomicservice
* @since 12
*/
/**
* Subscribe mtu changed event.
*
* @permission ohos.permission.ACCESS_BLUETOOTH
* @param { 'BLEMtuChange' } type - Type of the mtu changed event to listen for.
* @param { Callback } callback - Callback used to listen for the mtu changed event.
* @throws { BusinessError } 201 - Permission denied.
* @throws { BusinessError } 401 - Invalid parameter. Possible causes: 1. Mandatory parameters are left unspecified.
*
2. Incorrect parameter types. 3. Parameter verification failed.
* @throws { BusinessError } 801 - Capability not supported.
* @syscap SystemCapability.Communication.Bluetooth.Core
* @crossplatform
* @atomicservice
* @since 13
*/
on(type: 'BLEMtuChange', callback: Callback): void;
/**
* Unsubscribe mtu changed event.
*
* @permission ohos.permission.ACCESS_BLUETOOTH
* @param { 'BLEMtuChange' } type - Type of the mtu changed event to listen for.
* @param { Callback } callback - Callback used to listen for the mtu changed event.
* @throws { BusinessError } 201 - Permission denied.
* @throws { BusinessError } 401 - Invalid parameter. Possible causes: 1. Mandatory parameters are left unspecified.
*
2. Incorrect parameter types. 3. Parameter verification failed.
* @throws { BusinessError } 801 - Capability not supported.
* @syscap SystemCapability.Communication.Bluetooth.Core
* @since 10
*/
/**
* Unsubscribe mtu changed event.
*
* @permission ohos.permission.ACCESS_BLUETOOTH
* @param { 'BLEMtuChange' } type - Type of the mtu changed event to listen for.
* @param { Callback } callback - Callback used to listen for the mtu changed event.
* @throws { BusinessError } 201 - Permission denied.
* @throws { BusinessError } 401 - Invalid parameter. Possible causes: 1. Mandatory parameters are left unspecified.
*
2. Incorrect parameter types. 3. Parameter verification failed.
* @throws { BusinessError } 801 - Capability not supported.
* @syscap SystemCapability.Communication.Bluetooth.Core
* @atomicservice
* @since 12
*/
/**
* Unsubscribe mtu changed event.
*
* @permission ohos.permission.ACCESS_BLUETOOTH
* @param { 'BLEMtuChange' } type - Type of the mtu changed event to listen for.
* @param { Callback } callback - Callback used to listen for the mtu changed event.
* @throws { BusinessError } 201 - Permission denied.
* @throws { BusinessError } 401 - Invalid parameter. Possible causes: 1. Mandatory parameters are left unspecified.
*
2. Incorrect parameter types. 3. Parameter verification failed.
* @throws { BusinessError } 801 - Capability not supported.
* @syscap SystemCapability.Communication.Bluetooth.Core
* @crossplatform
* @atomicservice
* @since 13
*/
off(type: 'BLEMtuChange', callback?: Callback): void;
}
/**
* Describes the Gatt service.
*
* @typedef GattService
* @syscap SystemCapability.Communication.Bluetooth.Core
* @since 10
*/
/**
* Describes the Gatt service.
*
* @typedef GattService
* @syscap SystemCapability.Communication.Bluetooth.Core
* @atomicservice
* @since 12
*/
/**
* Describes the Gatt service.
*
* @typedef GattService
* @syscap SystemCapability.Communication.Bluetooth.Core
* @crossplatform
* @atomicservice
* @since 13
*/
interface GattService {
/**
* The UUID of a GattService instance
*
* @type { string }
* @syscap SystemCapability.Communication.Bluetooth.Core
* @since 10
*/
/**
* The UUID of a GattService instance
*
* @type { string }
* @syscap SystemCapability.Communication.Bluetooth.Core
* @atomicservice
* @since 12
*/
/**
* The UUID of a GattService instance
*
* @type { string }
* @syscap SystemCapability.Communication.Bluetooth.Core
* @crossplatform
* @atomicservice
* @since 13
*/
serviceUuid: string;
/**
* Indicates whether the GattService instance is primary or secondary.
*
* @type { boolean }
* @syscap SystemCapability.Communication.Bluetooth.Core
* @since 10
*/
/**
* Indicates whether the GattService instance is primary or secondary.
*
* @type { boolean }
* @syscap SystemCapability.Communication.Bluetooth.Core
* @atomicservice
* @since 12
*/
/**
* Indicates whether the GattService instance is primary or secondary.
*
* @type { boolean }
* @syscap SystemCapability.Communication.Bluetooth.Core
* @crossplatform
* @atomicservice
* @since 13
*/
isPrimary: boolean;
/**
* The {@link BLECharacteristic} list belongs to this GattService instance
*
* @type { Array }
* @syscap SystemCapability.Communication.Bluetooth.Core
* @since 10
*/
/**
* The {@link BLECharacteristic} list belongs to this GattService instance
*
* @type { Array }
* @syscap SystemCapability.Communication.Bluetooth.Core
* @atomicservice
* @since 12
*/
/**
* The {@link BLECharacteristic} list belongs to this GattService instance
*
* @type { Array }
* @syscap SystemCapability.Communication.Bluetooth.Core
* @crossplatform
* @atomicservice
* @since 13
*/
characteristics: Array;
/**
* The list of GATT services contained in the service
*
* @type { ?Array }
* @syscap SystemCapability.Communication.Bluetooth.Core
* @since 10
*/
/**
* The list of GATT services contained in the service
*
* @type { ?Array }
* @syscap SystemCapability.Communication.Bluetooth.Core
* @atomicservice
* @since 12
*/
includeServices?: Array;
}
/**
* Describes the Gatt characteristic.
*
* @typedef BLECharacteristic
* @syscap SystemCapability.Communication.Bluetooth.Core
* @since 10
*/
/**
* Describes the Gatt characteristic.
*
* @typedef BLECharacteristic
* @syscap SystemCapability.Communication.Bluetooth.Core
* @atomicservice
* @since 12
*/
/**
* Describes the Gatt characteristic.
*
* @typedef BLECharacteristic
* @syscap SystemCapability.Communication.Bluetooth.Core
* @crossplatform
* @atomicservice
* @since 13
*/
interface BLECharacteristic {
/**
* The UUID of the {@link GattService} instance to which the characteristic belongs
*
* @type { string }
* @syscap SystemCapability.Communication.Bluetooth.Core
* @since 10
*/
/**
* The UUID of the {@link GattService} instance to which the characteristic belongs
*
* @type { string }
* @syscap SystemCapability.Communication.Bluetooth.Core
* @atomicservice
* @since 12
*/
/**
* The UUID of the {@link GattService} instance to which the characteristic belongs
*
* @type { string }
* @syscap SystemCapability.Communication.Bluetooth.Core
* @crossplatform
* @atomicservice
* @since 13
*/
serviceUuid: string;
/**
* The UUID of a BLECharacteristic instance
*
* @type { string }
* @syscap SystemCapability.Communication.Bluetooth.Core
* @since 10
*/
/**
* The UUID of a BLECharacteristic instance
*
* @type { string }
* @syscap SystemCapability.Communication.Bluetooth.Core
* @atomicservice
* @since 12
*/
/**
* The UUID of a BLECharacteristic instance
*
* @type { string }
* @syscap SystemCapability.Communication.Bluetooth.Core
* @crossplatform
* @atomicservice
* @since 13
*/
characteristicUuid: string;
/**
* The value of a BLECharacteristic instance
*
* @type { ArrayBuffer }
* @syscap SystemCapability.Communication.Bluetooth.Core
* @since 10
*/
/**
* The value of a BLECharacteristic instance
*
* @type { ArrayBuffer }
* @syscap SystemCapability.Communication.Bluetooth.Core
* @atomicservice
* @since 12
*/
/**
* The value of a BLECharacteristic instance
*
* @type { ArrayBuffer }
* @syscap SystemCapability.Communication.Bluetooth.Core
* @crossplatform
* @atomicservice
* @since 13
*/
characteristicValue: ArrayBuffer;
/**
* The list of {@link BLEDescriptor} contained in the characteristic
*
* @type { Array }
* @syscap SystemCapability.Communication.Bluetooth.Core
* @since 10
*/
/**
* The list of {@link BLEDescriptor} contained in the characteristic
*
* @type { Array }
* @syscap SystemCapability.Communication.Bluetooth.Core
* @atomicservice
* @since 12
*/
/**
* The list of {@link BLEDescriptor} contained in the characteristic
*
* @type { Array }
* @syscap SystemCapability.Communication.Bluetooth.Core
* @crossplatform
* @atomicservice
* @since 13
*/
descriptors: Array;
/**
* The properties of a BLECharacteristic instance
*
* @type { ?GattProperties }
* @syscap SystemCapability.Communication.Bluetooth.Core
* @since 10
*/
/**
* The properties of a BLECharacteristic instance
*
* @type { ?GattProperties }
* @syscap SystemCapability.Communication.Bluetooth.Core
* @atomicservice
* @since 12
*/
/**
* The properties of a BLECharacteristic instance
*
* @type { ?GattProperties }
* @syscap SystemCapability.Communication.Bluetooth.Core
* @crossplatform
* @atomicservice
* @since 13
*/
properties?: GattProperties;
}
/**
* Describes the Gatt descriptor.
*
* @typedef BLEDescriptor
* @syscap SystemCapability.Communication.Bluetooth.Core
* @since 10
*/
/**
* Describes the Gatt descriptor.
*
* @typedef BLEDescriptor
* @syscap SystemCapability.Communication.Bluetooth.Core
* @atomicservice
* @since 12
*/
/**
* Describes the Gatt descriptor.
*
* @typedef BLEDescriptor
* @syscap SystemCapability.Communication.Bluetooth.Core
* @crossplatform
* @atomicservice
* @since 13
*/
interface BLEDescriptor {
/**
* The UUID of the {@link GattService} instance to which the descriptor belongs
*
* @type { string }
* @syscap SystemCapability.Communication.Bluetooth.Core
* @since 10
*/
/**
* The UUID of the {@link GattService} instance to which the descriptor belongs
*
* @type { string }
* @syscap SystemCapability.Communication.Bluetooth.Core
* @atomicservice
* @since 12
*/
/**
* The UUID of the {@link GattService} instance to which the descriptor belongs
*
* @type { string }
* @syscap SystemCapability.Communication.Bluetooth.Core
* @crossplatform
* @atomicservice
* @since 13
*/
serviceUuid: string;
/**
* The UUID of the {@link BLECharacteristic} instance to which the descriptor belongs
*
* @type { string }
* @syscap SystemCapability.Communication.Bluetooth.Core
* @since 10
*/
/**
* The UUID of the {@link BLECharacteristic} instance to which the descriptor belongs
*
* @type { string }
* @syscap SystemCapability.Communication.Bluetooth.Core
* @atomicservice
* @since 12
*/
/**
* The UUID of the {@link BLECharacteristic} instance to which the descriptor belongs
*
* @type { string }
* @syscap SystemCapability.Communication.Bluetooth.Core
* @crossplatform
* @atomicservice
* @since 13
*/
characteristicUuid: string;
/**
* The UUID of the BLEDescriptor instance
*
* @type { string }
* @syscap SystemCapability.Communication.Bluetooth.Core
* @since 10
*/
/**
* The UUID of the BLEDescriptor instance
*
* @type { string }
* @syscap SystemCapability.Communication.Bluetooth.Core
* @atomicservice
* @since 12
*/
/**
* The UUID of the BLEDescriptor instance
*
* @type { string }
* @syscap SystemCapability.Communication.Bluetooth.Core
* @crossplatform
* @atomicservice
* @since 13
*/
descriptorUuid: string;
/**
* The value of the BLEDescriptor instance
*
* @type { ArrayBuffer }
* @syscap SystemCapability.Communication.Bluetooth.Core
* @since 10
*/
/**
* The value of the BLEDescriptor instance
*
* @type { ArrayBuffer }
* @syscap SystemCapability.Communication.Bluetooth.Core
* @atomicservice
* @since 12
*/
/**
* The value of the BLEDescriptor instance
*
* @type { ArrayBuffer }
* @syscap SystemCapability.Communication.Bluetooth.Core
* @crossplatform
* @atomicservice
* @since 13
*/
descriptorValue: ArrayBuffer;
}
/**
* Describes the value of the indication or notification sent by the Gatt server.
*
* @typedef NotifyCharacteristic
* @syscap SystemCapability.Communication.Bluetooth.Core
* @since 10
*/
/**
* Describes the value of the indication or notification sent by the Gatt server.
*
* @typedef NotifyCharacteristic
* @syscap SystemCapability.Communication.Bluetooth.Core
* @atomicservice
* @since 12
*/
/**
* Describes the value of the indication or notification sent by the Gatt server.
*
* @typedef NotifyCharacteristic
* @syscap SystemCapability.Communication.Bluetooth.Core
* @crossplatform
* @atomicservice
* @since 13
*/
interface NotifyCharacteristic {
/**
* The UUID of the {@link GattService} instance to which the characteristic belongs
*
* @type { string }
* @syscap SystemCapability.Communication.Bluetooth.Core
* @since 10
*/
/**
* The UUID of the {@link GattService} instance to which the characteristic belongs
*
* @type { string }
* @syscap SystemCapability.Communication.Bluetooth.Core
* @atomicservice
* @since 12
*/
/**
* The UUID of the {@link GattService} instance to which the characteristic belongs
*
* @type { string }
* @syscap SystemCapability.Communication.Bluetooth.Core
* @crossplatform
* @atomicservice
* @since 13
*/
serviceUuid: string;
/**
* The UUID of a NotifyCharacteristic instance
*
* @type { string }
* @syscap SystemCapability.Communication.Bluetooth.Core
* @since 10
*/
/**
* The UUID of a NotifyCharacteristic instance
*
* @type { string }
* @syscap SystemCapability.Communication.Bluetooth.Core
* @atomicservice
* @since 12
*/
/**
* The UUID of a NotifyCharacteristic instance
*
* @type { string }
* @syscap SystemCapability.Communication.Bluetooth.Core
* @crossplatform
* @atomicservice
* @since 13
*/
characteristicUuid: string;
/**
* The value of a NotifyCharacteristic instance
*
* @type { ArrayBuffer }
* @syscap SystemCapability.Communication.Bluetooth.Core
* @since 10
*/
/**
* The value of a NotifyCharacteristic instance
*
* @type { ArrayBuffer }
* @syscap SystemCapability.Communication.Bluetooth.Core
* @atomicservice
* @since 12
*/
/**
* The value of a NotifyCharacteristic instance
*
* @type { ArrayBuffer }
* @syscap SystemCapability.Communication.Bluetooth.Core
* @crossplatform
* @atomicservice
* @since 13
*/
characteristicValue: ArrayBuffer;
/**
* Specifies whether to request confirmation from the BLE peripheral device (indication) or
* send a notification. Value {@code true} indicates the former and {@code false} indicates the latter.
*
* @type { boolean }
* @syscap SystemCapability.Communication.Bluetooth.Core
* @since 10
*/
/**
* Specifies whether to request confirmation from the BLE peripheral device (indication) or
* send a notification. Value {@code true} indicates the former and {@code false} indicates the latter.
*
* @type { boolean }
* @syscap SystemCapability.Communication.Bluetooth.Core
* @atomicservice
* @since 12
*/
confirm: boolean;
}
/**
* Describes the parameters of the Gatt client's characteristic read request.
*
* @typedef CharacteristicReadRequest
* @syscap SystemCapability.Communication.Bluetooth.Core
* @since 10
*/
/**
* Describes the parameters of the Gatt client's characteristic read request.
*
* @typedef CharacteristicReadRequest
* @syscap SystemCapability.Communication.Bluetooth.Core
* @atomicservice
* @since 12
*/
/**
* Describes the parameters of the Gatt client's characteristic read request.
*
* @typedef CharacteristicReadRequest
* @syscap SystemCapability.Communication.Bluetooth.Core
* @crossplatform
* @atomicservice
* @since 13
*/
interface CharacteristicReadRequest {
/**
* Indicates the address of the client that initiates the read request
*
* @type { string }
* @syscap SystemCapability.Communication.Bluetooth.Core
* @since 10
*/
/**
* Indicates the address of the client that initiates the read request
*
* @type { string }
* @syscap SystemCapability.Communication.Bluetooth.Core
* @atomicservice
* @since 12
*/
/**
* Indicates the address of the client that initiates the read request
*
* @type { string }
* @syscap SystemCapability.Communication.Bluetooth.Core
* @crossplatform
* @atomicservice
* @since 13
*/
deviceId: string;
/**
* The Id of the read request
*
* @type { number }
* @syscap SystemCapability.Communication.Bluetooth.Core
* @since 10
*/
/**
* The Id of the read request
*
* @type { number }
* @syscap SystemCapability.Communication.Bluetooth.Core
* @atomicservice
* @since 12
*/
/**
* The Id of the read request
*
* @type { number }
* @syscap SystemCapability.Communication.Bluetooth.Core
* @crossplatform
* @atomicservice
* @since 13
*/
transId: number;
/**
* Indicates the byte offset of the start position for reading characteristic value
*
* @type { number }
* @syscap SystemCapability.Communication.Bluetooth.Core
* @since 10
*/
/**
* Indicates the byte offset of the start position for reading characteristic value
*
* @type { number }
* @syscap SystemCapability.Communication.Bluetooth.Core
* @atomicservice
* @since 12
*/
offset: number;
/**
* The UUID of a CharacteristicReadRequest instance
*
* @type { string }
* @syscap SystemCapability.Communication.Bluetooth.Core
* @since 10
*/
/**
* The UUID of a CharacteristicReadRequest instance
*
* @type { string }
* @syscap SystemCapability.Communication.Bluetooth.Core
* @atomicservice
* @since 12
*/
/**
* The UUID of a CharacteristicReadRequest instance
*
* @type { string }
* @syscap SystemCapability.Communication.Bluetooth.Core
* @crossplatform
* @atomicservice
* @since 13
*/
characteristicUuid: string;
/**
* The UUID of the service to which the characteristic belongs
*
* @type { string }
* @syscap SystemCapability.Communication.Bluetooth.Core
* @since 10
*/
/**
* The UUID of the service to which the characteristic belongs
*
* @type { string }
* @syscap SystemCapability.Communication.Bluetooth.Core
* @atomicservice
* @since 12
*/
/**
* The UUID of the service to which the characteristic belongs
*
* @type { string }
* @syscap SystemCapability.Communication.Bluetooth.Core
* @crossplatform
* @atomicservice
* @since 13
*/
serviceUuid: string;
}
/**
* Describes the parameters of the of the Gatt client's characteristic write request.
*
* @typedef CharacteristicWriteRequest
* @syscap SystemCapability.Communication.Bluetooth.Core
* @since 10
*/
/**
* Describes the parameters of the of the Gatt client's characteristic write request.
*
* @typedef CharacteristicWriteRequest
* @syscap SystemCapability.Communication.Bluetooth.Core
* @atomicservice
* @since 12
*/
/**
* Describes the parameters of the of the Gatt client's characteristic write request.
*
* @typedef CharacteristicWriteRequest
* @syscap SystemCapability.Communication.Bluetooth.Core
* @crossplatform
* @atomicservice
* @since 13
*/
interface CharacteristicWriteRequest {
/**
* Indicates the address of the client that initiates the write request
*
* @type { string }
* @syscap SystemCapability.Communication.Bluetooth.Core
* @since 10
*/
/**
* Indicates the address of the client that initiates the write request
*
* @type { string }
* @syscap SystemCapability.Communication.Bluetooth.Core
* @atomicservice
* @since 12
*/
/**
* Indicates the address of the client that initiates the write request
*
* @type { string }
* @syscap SystemCapability.Communication.Bluetooth.Core
* @crossplatform
* @atomicservice
* @since 13
*/
deviceId: string;
/**
* The Id of the write request
*
* @type { number }
* @syscap SystemCapability.Communication.Bluetooth.Core
* @since 10
*/
/**
* The Id of the write request
*
* @type { number }
* @syscap SystemCapability.Communication.Bluetooth.Core
* @atomicservice
* @since 12
*/
/**
* The Id of the write request
*
* @type { number }
* @syscap SystemCapability.Communication.Bluetooth.Core
* @crossplatform
* @atomicservice
* @since 13
*/
transId: number;
/**
* Indicates the byte offset of the start position for writing characteristic value
*
* @type { number }
* @syscap SystemCapability.Communication.Bluetooth.Core
* @since 10
*/
/**
* Indicates the byte offset of the start position for writing characteristic value
*
* @type { number }
* @syscap SystemCapability.Communication.Bluetooth.Core
* @atomicservice
* @since 12
*/
offset: number;
/**
* Whether this request should be pending for later operation
*
* @type { boolean }
* @syscap SystemCapability.Communication.Bluetooth.Core
* @since 10
*/
/**
* Whether this request should be pending for later operation
*
* @type { boolean }
* @syscap SystemCapability.Communication.Bluetooth.Core
* @atomicservice
* @since 12
*/
isPrepared: boolean;
/**
* Whether the remote client need a response
*
* @type { boolean }
* @syscap SystemCapability.Communication.Bluetooth.Core
* @since 10
*/
/**
* Whether the remote client need a response
*
* @type { boolean }
* @syscap SystemCapability.Communication.Bluetooth.Core
* @atomicservice
* @since 12
*/
needRsp: boolean;
/**
* Indicates the value to be written
*
* @type { ArrayBuffer }
* @syscap SystemCapability.Communication.Bluetooth.Core
* @since 10
*/
/**
* Indicates the value to be written
*
* @type { ArrayBuffer }
* @syscap SystemCapability.Communication.Bluetooth.Core
* @atomicservice
* @since 12
*/
/**
* Indicates the value to be written
*
* @type { ArrayBuffer }
* @syscap SystemCapability.Communication.Bluetooth.Core
* @crossplatform
* @atomicservice
* @since 13
*/
value: ArrayBuffer;
/**
* The UUID of a CharacteristicWriteRequest instance
*
* @type { string }
* @syscap SystemCapability.Communication.Bluetooth.Core
* @since 10
*/
/**
* The UUID of a CharacteristicWriteRequest instance
*
* @type { string }
* @syscap SystemCapability.Communication.Bluetooth.Core
* @atomicservice
* @since 12
*/
/**
* The UUID of a CharacteristicWriteRequest instance
*
* @type { string }
* @syscap SystemCapability.Communication.Bluetooth.Core
* @crossplatform
* @atomicservice
* @since 13
*/
characteristicUuid: string;
/**
* The UUID of the service to which the characteristic belongs
*
* @type { string }
* @syscap SystemCapability.Communication.Bluetooth.Core
* @since 10
*/
/**
* The UUID of the service to which the characteristic belongs
*
* @type { string }
* @syscap SystemCapability.Communication.Bluetooth.Core
* @atomicservice
* @since 12
*/
/**
* The UUID of the service to which the characteristic belongs
*
* @type { string }
* @syscap SystemCapability.Communication.Bluetooth.Core
* @crossplatform
* @atomicservice
* @since 13
*/
serviceUuid: string;
}
/**
* Describes the parameters of the Gatt client's descriptor read request.
*
* @typedef DescriptorReadRequest
* @syscap SystemCapability.Communication.Bluetooth.Core
* @since 10
*/
/**
* Describes the parameters of the Gatt client's descriptor read request.
*
* @typedef DescriptorReadRequest
* @syscap SystemCapability.Communication.Bluetooth.Core
* @atomicservice
* @since 12
*/
/**
* Describes the parameters of the Gatt client's descriptor read request.
*
* @typedef DescriptorReadRequest
* @syscap SystemCapability.Communication.Bluetooth.Core
* @crossplatform
* @atomicservice
* @since 13
*/
interface DescriptorReadRequest {
/**
* Indicates the address of the client that initiates the read request
*
* @type { string }
* @syscap SystemCapability.Communication.Bluetooth.Core
* @since 10
*/
/**
* Indicates the address of the client that initiates the read request
*
* @type { string }
* @syscap SystemCapability.Communication.Bluetooth.Core
* @atomicservice
* @since 12
*/
/**
* Indicates the address of the client that initiates the read request
*
* @type { string }
* @syscap SystemCapability.Communication.Bluetooth.Core
* @crossplatform
* @atomicservice
* @since 13
*/
deviceId: string;
/**
* The Id of the read request
*
* @type { number }
* @syscap SystemCapability.Communication.Bluetooth.Core
* @since 10
*/
/**
* The Id of the read request
*
* @type { number }
* @syscap SystemCapability.Communication.Bluetooth.Core
* @atomicservice
* @since 12
*/
/**
* The Id of the read request
*
* @type { number }
* @syscap SystemCapability.Communication.Bluetooth.Core
* @crossplatform
* @atomicservice
* @since 13
*/
transId: number;
/**
* Indicates the byte offset of the start position for reading characteristic value
*
* @type { number }
* @syscap SystemCapability.Communication.Bluetooth.Core
* @since 10
*/
/**
* Indicates the byte offset of the start position for reading characteristic value
*
* @type { number }
* @syscap SystemCapability.Communication.Bluetooth.Core
* @atomicservice
* @since 12
*/
offset: number;
/**
* The UUID of a DescriptorReadRequest instance
*
* @type { string }
* @syscap SystemCapability.Communication.Bluetooth.Core
* @since 10
*/
/**
* The UUID of a DescriptorReadRequest instance
*
* @type { string }
* @syscap SystemCapability.Communication.Bluetooth.Core
* @atomicservice
* @since 12
*/
/**
* The UUID of a DescriptorReadRequest instance
*
* @type { string }
* @syscap SystemCapability.Communication.Bluetooth.Core
* @crossplatform
* @atomicservice
* @since 13
*/
descriptorUuid: string;
/**
* The UUID of the characteristic to which the descriptor belongs
*
* @type { string }
* @syscap SystemCapability.Communication.Bluetooth.Core
* @since 10
*/
/**
* The UUID of the characteristic to which the descriptor belongs
*
* @type { string }
* @syscap SystemCapability.Communication.Bluetooth.Core
* @atomicservice
* @since 12
*/
/**
* The UUID of the characteristic to which the descriptor belongs
*
* @type { string }
* @syscap SystemCapability.Communication.Bluetooth.Core
* @crossplatform
* @atomicservice
* @since 13
*/
characteristicUuid: string;
/**
* The UUID of the service to which the descriptor belongs
*
* @type { string }
* @syscap SystemCapability.Communication.Bluetooth.Core
* @since 10
*/
/**
* The UUID of the service to which the descriptor belongs
*
* @type { string }
* @syscap SystemCapability.Communication.Bluetooth.Core
* @atomicservice
* @since 12
*/
/**
* The UUID of the service to which the descriptor belongs
*
* @type { string }
* @syscap SystemCapability.Communication.Bluetooth.Core
* @crossplatform
* @atomicservice
* @since 13
*/
serviceUuid: string;
}
/**
* Describes the parameters of the Gatt client's characteristic write request.
*
* @typedef DescriptorWriteRequest
* @syscap SystemCapability.Communication.Bluetooth.Core
* @since 10
*/
/**
* Describes the parameters of the Gatt client's characteristic write request.
*
* @typedef DescriptorWriteRequest
* @syscap SystemCapability.Communication.Bluetooth.Core
* @atomicservice
* @since 12
*/
/**
* Describes the parameters of the Gatt client's characteristic write request.
*
* @typedef DescriptorWriteRequest
* @syscap SystemCapability.Communication.Bluetooth.Core
* @crossplatform
* @atomicservice
* @since 13
*/
interface DescriptorWriteRequest {
/**
* Indicates the address of the client that initiates the write request
*
* @type { string }
* @syscap SystemCapability.Communication.Bluetooth.Core
* @since 10
*/
/**
* Indicates the address of the client that initiates the write request
*
* @type { string }
* @syscap SystemCapability.Communication.Bluetooth.Core
* @atomicservice
* @since 12
*/
/**
* Indicates the address of the client that initiates the write request
*
* @type { string }
* @syscap SystemCapability.Communication.Bluetooth.Core
* @crossplatform
* @atomicservice
* @since 13
*/
deviceId: string;
/**
* The Id of the write request
*
* @type { number }
* @syscap SystemCapability.Communication.Bluetooth.Core
* @since 10
*/
/**
* The Id of the write request
*
* @type { number }
* @syscap SystemCapability.Communication.Bluetooth.Core
* @atomicservice
* @since 12
*/
/**
* The Id of the write request
*
* @type { number }
* @syscap SystemCapability.Communication.Bluetooth.Core
* @crossplatform
* @atomicservice
* @since 13
*/
transId: number;
/**
* Indicates the byte offset of the start position for writing characteristic value
*
* @type { number }
* @syscap SystemCapability.Communication.Bluetooth.Core
* @since 10
*/
/**
* Indicates the byte offset of the start position for writing characteristic value
*
* @type { number }
* @syscap SystemCapability.Communication.Bluetooth.Core
* @atomicservice
* @since 12
*/
offset: number;
/**
* Whether this request should be pending for later operation
*
* @type { boolean }
* @syscap SystemCapability.Communication.Bluetooth.Core
* @since 10
*/
/**
* Whether this request should be pending for later operation
*
* @type { boolean }
* @syscap SystemCapability.Communication.Bluetooth.Core
* @atomicservice
* @since 12
*/
isPrepared: boolean;
/**
* Whether the remote client need a response
*
* @type { boolean }
* @syscap SystemCapability.Communication.Bluetooth.Core
* @since 10
*/
/**
* Whether the remote client need a response
*
* @type { boolean }
* @syscap SystemCapability.Communication.Bluetooth.Core
* @atomicservice
* @since 12
*/
needRsp: boolean;
/**
* Indicates the value to be written
*
* @type { ArrayBuffer }
* @syscap SystemCapability.Communication.Bluetooth.Core
* @since 10
*/
/**
* Indicates the value to be written
*
* @type { ArrayBuffer }
* @syscap SystemCapability.Communication.Bluetooth.Core
* @atomicservice
* @since 12
*/
/**
* Indicates the value to be written
*
* @type { ArrayBuffer }
* @syscap SystemCapability.Communication.Bluetooth.Core
* @crossplatform
* @atomicservice
* @since 13
*/
value: ArrayBuffer;
/**
* The UUID of a DescriptorWriteRequest instance
*
* @type { string }
* @syscap SystemCapability.Communication.Bluetooth.Core
* @since 10
*/
/**
* The UUID of a DescriptorWriteRequest instance
*
* @type { string }
* @syscap SystemCapability.Communication.Bluetooth.Core
* @atomicservice
* @since 12
*/
/**
* The UUID of a DescriptorWriteRequest instance
*
* @type { string }
* @syscap SystemCapability.Communication.Bluetooth.Core
* @crossplatform
* @atomicservice
* @since 13
*/
descriptorUuid: string;
/**
* The UUID of the characteristic to which the descriptor belongs
*
* @type { string }
* @syscap SystemCapability.Communication.Bluetooth.Core
* @since 10
*/
/**
* The UUID of the characteristic to which the descriptor belongs
*
* @type { string }
* @syscap SystemCapability.Communication.Bluetooth.Core
* @atomicservice
* @since 12
*/
/**
* The UUID of the characteristic to which the descriptor belongs
*
* @type { string }
* @syscap SystemCapability.Communication.Bluetooth.Core
* @crossplatform
* @atomicservice
* @since 13
*/
characteristicUuid: string;
/**
* The UUID of the service to which the descriptor belongs
*
* @type { string }
* @syscap SystemCapability.Communication.Bluetooth.Core
* @since 10
*/
/**
* The UUID of the service to which the descriptor belongs
*
* @type { string }
* @syscap SystemCapability.Communication.Bluetooth.Core
* @atomicservice
* @since 12
*/
/**
* The UUID of the service to which the descriptor belongs
*
* @type { string }
* @syscap SystemCapability.Communication.Bluetooth.Core
* @crossplatform
* @atomicservice
* @since 13
*/
serviceUuid: string;
}
/**
* Describes the parameters of a response send by the server to a specified read or write request.
*
* @typedef ServerResponse
* @syscap SystemCapability.Communication.Bluetooth.Core
* @since 10
*/
/**
* Describes the parameters of a response send by the server to a specified read or write request.
*
* @typedef ServerResponse
* @syscap SystemCapability.Communication.Bluetooth.Core
* @atomicservice
* @since 12
*/
/**
* Describes the parameters of a response send by the server to a specified read or write request.
*
* @typedef ServerResponse
* @syscap SystemCapability.Communication.Bluetooth.Core
* @crossplatform
* @atomicservice
* @since 13
*/
interface ServerResponse {
/**
* Indicates the address of the client to which to send the response
*
* @type { string }
* @syscap SystemCapability.Communication.Bluetooth.Core
* @since 10
*/
/**
* Indicates the address of the client to which to send the response
*
* @type { string }
* @syscap SystemCapability.Communication.Bluetooth.Core
* @atomicservice
* @since 12
*/
/**
* Indicates the address of the client to which to send the response
*
* @type { string }
* @syscap SystemCapability.Communication.Bluetooth.Core
* @crossplatform
* @atomicservice
* @since 13
*/
deviceId: string;
/**
* The Id of the write request
*
* @type { number }
* @syscap SystemCapability.Communication.Bluetooth.Core
* @since 10
*/
/**
* The Id of the write request
*
* @type { number }
* @syscap SystemCapability.Communication.Bluetooth.Core
* @atomicservice
* @since 12
*/
/**
* The Id of the write request
*
* @type { number }
* @syscap SystemCapability.Communication.Bluetooth.Core
* @crossplatform
* @atomicservice
* @since 13
*/
transId: number;
/**
* Indicates the status of the read or write request, set this parameter to '0' in normal cases
*
* @type { number }
* @syscap SystemCapability.Communication.Bluetooth.Core
* @since 10
*/
/**
* Indicates the status of the read or write request, set this parameter to '0' in normal cases
*
* @type { number }
* @syscap SystemCapability.Communication.Bluetooth.Core
* @atomicservice
* @since 12
*/
/**
* Indicates the status of the read or write request, set this parameter to '0' in normal cases
*
* @type { number }
* @syscap SystemCapability.Communication.Bluetooth.Core
* @crossplatform
* @atomicservice
* @since 13
*/
status: number;
/**
* Indicates the byte offset of the start position for reading or writing operation
*
* @type { number }
* @syscap SystemCapability.Communication.Bluetooth.Core
* @since 10
*/
/**
* Indicates the byte offset of the start position for reading or writing operation
*
* @type { number }
* @syscap SystemCapability.Communication.Bluetooth.Core
* @atomicservice
* @since 12
*/
offset: number;
/**
* Indicates the value to be sent
*
* @type { ArrayBuffer }
* @syscap SystemCapability.Communication.Bluetooth.Core
* @since 10
*/
/**
* Indicates the value to be sent
*
* @type { ArrayBuffer }
* @syscap SystemCapability.Communication.Bluetooth.Core
* @atomicservice
* @since 12
*/
/**
* Indicates the value to be sent
*
* @type { ArrayBuffer }
* @syscap SystemCapability.Communication.Bluetooth.Core
* @crossplatform
* @atomicservice
* @since 13
*/
value: ArrayBuffer;
}
/**
* Describes the Gatt profile connection state.
*
* @typedef BLEConnectionChangeState
* @syscap SystemCapability.Communication.Bluetooth.Core
* @since 10
*/
/**
* Describes the Gatt profile connection state.
*
* @typedef BLEConnectionChangeState
* @syscap SystemCapability.Communication.Bluetooth.Core
* @atomicservice
* @since 12
*/
/**
* Describes the Gatt profile connection state.
*
* @typedef BLEConnectionChangeState
* @syscap SystemCapability.Communication.Bluetooth.Core
* @crossplatform
* @atomicservice
* @since 13
*/
interface BLEConnectionChangeState {
/**
* Indicates the peer device address
*
* @type { string }
* @syscap SystemCapability.Communication.Bluetooth.Core
* @since 10
*/
/**
* Indicates the peer device address
*
* @type { string }
* @syscap SystemCapability.Communication.Bluetooth.Core
* @atomicservice
* @since 12
*/
/**
* Indicates the peer device address
*
* @type { string }
* @syscap SystemCapability.Communication.Bluetooth.Core
* @crossplatform
* @atomicservice
* @since 13
*/
deviceId: string;
/**
* Connection state of the Gatt profile
*
* @type { ProfileConnectionState }
* @syscap SystemCapability.Communication.Bluetooth.Core
* @since 10
*/
/**
* Connection state of the Gatt profile
*
* @type { ProfileConnectionState }
* @syscap SystemCapability.Communication.Bluetooth.Core
* @atomicservice
* @since 12
*/
/**
* Connection state of the Gatt profile
*
* @type { ProfileConnectionState }
* @syscap SystemCapability.Communication.Bluetooth.Core
* @crossplatform
* @atomicservice
* @since 13
*/
state: ProfileConnectionState;
}
/**
* Describes the contents of the scan results.
*
* @typedef ScanResult
* @syscap SystemCapability.Communication.Bluetooth.Core
* @since 10
*/
/**
* Describes the contents of the scan results.
*
* @typedef ScanResult
* @syscap SystemCapability.Communication.Bluetooth.Core
* @atomicservice
* @since 12
*/
/**
* Describes the contents of the scan results.
*
* @typedef ScanResult
* @syscap SystemCapability.Communication.Bluetooth.Core
* @crossplatform
* @atomicservice
* @since 13
*/
interface ScanResult {
/**
* Address of the scanned device
*
* @type { string }
* @syscap SystemCapability.Communication.Bluetooth.Core
* @since 10
*/
/**
* Address of the scanned device
*
* @type { string }
* @syscap SystemCapability.Communication.Bluetooth.Core
* @atomicservice
* @since 12
*/
/**
* Address of the scanned device
*
* @type { string }
* @syscap SystemCapability.Communication.Bluetooth.Core
* @crossplatform
* @atomicservice
* @since 13
*/
deviceId: string;
/**
* RSSI of the remote device
*
* @type { number }
* @syscap SystemCapability.Communication.Bluetooth.Core
* @since 10
*/
/**
* RSSI of the remote device
*
* @type { number }
* @syscap SystemCapability.Communication.Bluetooth.Core
* @atomicservice
* @since 12
*/
/**
* RSSI of the remote device
*
* @type { number }
* @syscap SystemCapability.Communication.Bluetooth.Core
* @crossplatform
* @atomicservice
* @since 13
*/
rssi: number;
/**
* The raw data of broadcast packet
*
* @type { ArrayBuffer }
* @syscap SystemCapability.Communication.Bluetooth.Core
* @since 10
*/
/**
* The raw data of broadcast packet
*
* @type { ArrayBuffer }
* @syscap SystemCapability.Communication.Bluetooth.Core
* @atomicservice
* @since 12
*/
/**
* The raw data of broadcast packet
*
* @type { ArrayBuffer }
* @syscap SystemCapability.Communication.Bluetooth.Core
* @crossplatform
* @atomicservice
* @since 13
*/
data: ArrayBuffer;
/**
* The local name of the BLE device
*
* @type { string }
* @syscap SystemCapability.Communication.Bluetooth.Core
* @since 10
*/
/**
* The local name of the BLE device
*
* @type { string }
* @syscap SystemCapability.Communication.Bluetooth.Core
* @atomicservice
* @since 12
*/
/**
* The local name of the BLE device
*
* @type { string }
* @syscap SystemCapability.Communication.Bluetooth.Core
* @crossplatform
* @atomicservice
* @since 13
*/
deviceName: string;
/**
* Connectable of the remote device
*
* @type { boolean }
* @syscap SystemCapability.Communication.Bluetooth.Core
* @since 10
*/
/**
* Connectable of the remote device
*
* @type { boolean }
* @syscap SystemCapability.Communication.Bluetooth.Core
* @atomicservice
* @since 12
*/
/**
* Connectable of the remote device
*
* @type { boolean }
* @syscap SystemCapability.Communication.Bluetooth.Core
* @crossplatform
* @atomicservice
* @since 13
*/
connectable: boolean;
}
/**
* Describes the settings for BLE advertising.
*
* @typedef AdvertiseSetting
* @syscap SystemCapability.Communication.Bluetooth.Core
* @since 10
*/
/**
* Describes the settings for BLE advertising.
*
* @typedef AdvertiseSetting
* @syscap SystemCapability.Communication.Bluetooth.Core
* @atomicservice
* @since 12
*/
/**
* Describes the settings for BLE advertising.
*
* @typedef AdvertiseSetting
* @syscap SystemCapability.Communication.Bluetooth.Core
* @crossplatform
* @atomicservice
* @since 13
*/
interface AdvertiseSetting {
/**
* Minimum slot value for the advertising interval, which is {@code 32} (20 ms)
* Maximum slot value for the advertising interval, which is {@code 16777215} (10485.759375s)
* Default slot value for the advertising interval, which is {@code 1600} (1s)
*
* @type { ?number }
* @syscap SystemCapability.Communication.Bluetooth.Core
* @since 10
*/
/**
* Minimum slot value for the advertising interval, which is {@code 32} (20 ms)
* Maximum slot value for the advertising interval, which is {@code 16777215} (10485.759375s)
* Default slot value for the advertising interval, which is {@code 1600} (1s)
*
* @type { ?number }
* @syscap SystemCapability.Communication.Bluetooth.Core
* @atomicservice
* @since 12
*/
interval?: number;
/**
* Minimum transmission power level for advertising, which is {@code -127}
* Maximum transmission power level for advertising, which is {@code 1}
* Default transmission power level for advertising, which is {@code -7}
*
* @type { ?number }
* @syscap SystemCapability.Communication.Bluetooth.Core
* @since 10
*/
/**
* Minimum transmission power level for advertising, which is {@code -127}
* Maximum transmission power level for advertising, which is {@code 1}
* Default transmission power level for advertising, which is {@code -7}
*
* @type { ?number }
* @syscap SystemCapability.Communication.Bluetooth.Core
* @atomicservice
* @since 12
*/
txPower?: number;
/**
* Indicates whether the BLE is connectable, default is {@code true}
*
* @type { ?boolean }
* @syscap SystemCapability.Communication.Bluetooth.Core
* @since 10
*/
/**
* Indicates whether the BLE is connectable, default is {@code true}
*
* @type { ?boolean }
* @syscap SystemCapability.Communication.Bluetooth.Core
* @atomicservice
* @since 12
*/
/**
* Indicates whether the BLE is connectable, default is {@code true}
*
* @type { ?boolean }
* @syscap SystemCapability.Communication.Bluetooth.Core
* @crossplatform
* @atomicservice
* @since 13
*/
connectable?: boolean;
}
/**
* Describes the advertising data.
*
* @typedef AdvertiseData
* @syscap SystemCapability.Communication.Bluetooth.Core
* @since 10
*/
/**
* Describes the advertising data.
*
* @typedef AdvertiseData
* @syscap SystemCapability.Communication.Bluetooth.Core
* @atomicservice
* @since 12
*/
/**
* Describes the advertising data.
*
* @typedef AdvertiseData
* @syscap SystemCapability.Communication.Bluetooth.Core
* @crossplatform
* @atomicservice
* @since 13
*/
interface AdvertiseData {
/**
* The specified service UUID list to this advertisement
*
* @type { Array }
* @syscap SystemCapability.Communication.Bluetooth.Core
* @since 10
*/
/**
* The specified service UUID list to this advertisement
*
* @type { Array }
* @syscap SystemCapability.Communication.Bluetooth.Core
* @atomicservice
* @since 12
*/
/**
* The specified service UUID list to this advertisement
*
* @type { Array }
* @syscap SystemCapability.Communication.Bluetooth.Core
* @crossplatform
* @atomicservice
* @since 13
*/
serviceUuids: Array;
/**
* The specified manufacturer data list to this advertisement
*
* @type { Array }
* @syscap SystemCapability.Communication.Bluetooth.Core
* @since 10
*/
/**
* The specified manufacturer data list to this advertisement
*
* @type { Array }
* @syscap SystemCapability.Communication.Bluetooth.Core
* @atomicservice
* @since 12
*/
/**
* The specified manufacturer data list to this advertisement
*
* @type { Array }
* @syscap SystemCapability.Communication.Bluetooth.Core
* @crossplatform
* @atomicservice
* @since 13
*/
manufactureData: Array;
/**
* The specified service data list to this advertisement
*
* @type { Array }
* @syscap SystemCapability.Communication.Bluetooth.Core
* @since 10
*/
/**
* The specified service data list to this advertisement
*
* @type { Array }
* @syscap SystemCapability.Communication.Bluetooth.Core
* @atomicservice
* @since 12
*/
/**
* The specified service data list to this advertisement
*
* @type { Array }
* @syscap SystemCapability.Communication.Bluetooth.Core
* @crossplatform
* @atomicservice
* @since 13
*/
serviceData: Array;
/**
* Indicates whether the device name will be included in the advertisement packet.
*
* @type { ?boolean }
* @syscap SystemCapability.Communication.Bluetooth.Core
* @since 10
*/
/**
* Indicates whether the device name will be included in the advertisement packet.
*
* @type { ?boolean }
* @syscap SystemCapability.Communication.Bluetooth.Core
* @atomicservice
* @since 12
*/
/**
* Indicates whether the device name will be included in the advertisement packet.
*
* @type { ?boolean }
* @syscap SystemCapability.Communication.Bluetooth.Core
* @crossplatform
* @atomicservice
* @since 13
*/
includeDeviceName?: boolean;
}
/**
* Describes the advertising parameters.
*
* @typedef AdvertisingParams
* @syscap SystemCapability.Communication.Bluetooth.Core
* @since 11
*/
/**
* Describes the advertising parameters.
*
* @typedef AdvertisingParams
* @syscap SystemCapability.Communication.Bluetooth.Core
* @crossplatform
* @since 13
*/
interface AdvertisingParams {
/**
* Indicates the advertising settings.
*
* @type { AdvertiseSetting }
* @syscap SystemCapability.Communication.Bluetooth.Core
* @since 11
*/
/**
* Indicates the advertising settings.
*
* @type { AdvertiseSetting }
* @syscap SystemCapability.Communication.Bluetooth.Core
* @crossplatform
* @since 13
*/
advertisingSettings: AdvertiseSetting;
/**
* Indicates the advertising data.
*
* @type { AdvertiseData }
* @syscap SystemCapability.Communication.Bluetooth.Core
* @since 11
*/
/**
* Indicates the advertising data.
*
* @type { AdvertiseData }
* @syscap SystemCapability.Communication.Bluetooth.Core
* @crossplatform
* @since 13
*/
advertisingData: AdvertiseData;
/**
* Indicates the advertising response.
*
* @type { ?AdvertiseData }
* @syscap SystemCapability.Communication.Bluetooth.Core
* @since 11
*/
/**
* Indicates the advertising response.
*
* @type { ?AdvertiseData }
* @syscap SystemCapability.Communication.Bluetooth.Core
* @crossplatform
* @since 13
*/
advertisingResponse?: AdvertiseData;
/**
* Indicates the duration for advertising continuously.
* The duration, in 10ms unit. Valid range is from 1 (10ms) to 65535 (655,350 ms).
* If this parameter is not specified or is set to 0, advertisement is continuously sent.
*
* @type { ?number }
* @syscap SystemCapability.Communication.Bluetooth.Core
* @since 11
*/
duration?: number;
}
/**
* Parameter for dynamically enable advertising.
*
* @typedef AdvertisingEnableParams
* @syscap SystemCapability.Communication.Bluetooth.Core
* @since 11
*/
interface AdvertisingEnableParams {
/**
* Indicates the ID of current advertising.
*
* @type { number }
* @syscap SystemCapability.Communication.Bluetooth.Core
* @since 11
*/
advertisingId: number;
/**
* Indicates the duration for advertising continuously.
* The duration, in 10ms unit. Valid range is from 1 (10ms) to 65535 (655,350 ms).
* If this parameter is not specified or is set to 0, advertise is continuously sent.
*
* @type { ?number }
* @syscap SystemCapability.Communication.Bluetooth.Core
* @since 11
*/
duration?: number;
}
/**
* Parameter for dynamically disable advertising.
*
* @typedef AdvertisingDisableParams
* @syscap SystemCapability.Communication.Bluetooth.Core
* @since 11
*/
interface AdvertisingDisableParams {
/**
* Indicates the ID of current advertising.
*
* @type { number }
* @syscap SystemCapability.Communication.Bluetooth.Core
* @since 11
*/
advertisingId: number;
}
/**
* Advertising state change information.
*
* @typedef AdvertisingStateChangeInfo
* @syscap SystemCapability.Communication.Bluetooth.Core
* @since 11
*/
/**
* Advertising state change information.
*
* @typedef AdvertisingStateChangeInfo
* @syscap SystemCapability.Communication.Bluetooth.Core
* @crossplatform
* @since 13
*/
interface AdvertisingStateChangeInfo {
/**
* Indicates the ID of current advertising.
*
* @type { number }
* @syscap SystemCapability.Communication.Bluetooth.Core
* @since 11
*/
/**
* Indicates the ID of current advertising.
*
* @type { number }
* @syscap SystemCapability.Communication.Bluetooth.Core
* @crossplatform
* @since 13
*/
advertisingId: number;
/**
* Indicates the advertising state.
*
* @type { AdvertisingState }
* @syscap SystemCapability.Communication.Bluetooth.Core
* @since 11
*/
/**
* Indicates the advertising state.
*
* @type { AdvertisingState }
* @syscap SystemCapability.Communication.Bluetooth.Core
* @crossplatform
* @since 13
*/
state: AdvertisingState;
}
/**
* Describes the manufacturer data.
*
* @typedef ManufactureData
* @syscap SystemCapability.Communication.Bluetooth.Core
* @since 10
*/
/**
* Describes the manufacturer data.
*
* @typedef ManufactureData
* @syscap SystemCapability.Communication.Bluetooth.Core
* @atomicservice
* @since 12
*/
/**
* Describes the manufacturer data.
*
* @typedef ManufactureData
* @syscap SystemCapability.Communication.Bluetooth.Core
* @crossplatform
* @atomicservice
* @since 13
*/
interface ManufactureData {
/**
* Indicates the manufacturer ID assigned by Bluetooth SIG
*
* @type { number }
* @syscap SystemCapability.Communication.Bluetooth.Core
* @since 10
*/
/**
* Indicates the manufacturer ID assigned by Bluetooth SIG
*
* @type { number }
* @syscap SystemCapability.Communication.Bluetooth.Core
* @atomicservice
* @since 12
*/
/**
* Indicates the manufacturer ID assigned by Bluetooth SIG
*
* @type { number }
* @syscap SystemCapability.Communication.Bluetooth.Core
* @crossplatform
* @atomicservice
* @since 13
*/
manufactureId: number;
/**
* Indicates the manufacturer data to add
*
* @type { ArrayBuffer }
* @syscap SystemCapability.Communication.Bluetooth.Core
* @since 10
*/
/**
* Indicates the manufacturer data to add
*
* @type { ArrayBuffer }
* @syscap SystemCapability.Communication.Bluetooth.Core
* @atomicservice
* @since 12
*/
/**
* Indicates the manufacturer data to add
*
* @type { ArrayBuffer }
* @syscap SystemCapability.Communication.Bluetooth.Core
* @crossplatform
* @atomicservice
* @since 13
*/
manufactureValue: ArrayBuffer;
}
/**
* Describes the service data.
*
* @typedef ServiceData
* @syscap SystemCapability.Communication.Bluetooth.Core
* @since 10
*/
/**
* Describes the service data.
*
* @typedef ServiceData
* @syscap SystemCapability.Communication.Bluetooth.Core
* @atomicservice
* @since 12
*/
/**
* Describes the service data.
*
* @typedef ServiceData
* @syscap SystemCapability.Communication.Bluetooth.Core
* @crossplatform
* @atomicservice
* @since 13
*/
interface ServiceData {
/**
* Indicates the UUID of the service data to add
*
* @type { string }
* @syscap SystemCapability.Communication.Bluetooth.Core
* @since 10
*/
/**
* Indicates the UUID of the service data to add
*
* @type { string }
* @syscap SystemCapability.Communication.Bluetooth.Core
* @atomicservice
* @since 12
*/
/**
* Indicates the UUID of the service data to add
*
* @type { string }
* @syscap SystemCapability.Communication.Bluetooth.Core
* @crossplatform
* @atomicservice
* @since 13
*/
serviceUuid: string;
/**
* Indicates the service data to add
*
* @type { ArrayBuffer }
* @syscap SystemCapability.Communication.Bluetooth.Core
* @since 10
*/
/**
* Indicates the service data to add
*
* @type { ArrayBuffer }
* @syscap SystemCapability.Communication.Bluetooth.Core
* @atomicservice
* @since 12
*/
/**
* Indicates the service data to add
*
* @type { ArrayBuffer }
* @syscap SystemCapability.Communication.Bluetooth.Core
* @crossplatform
* @atomicservice
* @since 13
*/
serviceValue: ArrayBuffer;
}
/**
* Describes the criteria for filtering scanning results can be set.
*
* @typedef ScanFilter
* @syscap SystemCapability.Communication.Bluetooth.Core
* @since 10
*/
/**
* Describes the criteria for filtering scanning results can be set.
*
* @typedef ScanFilter
* @syscap SystemCapability.Communication.Bluetooth.Core
* @atomicservice
* @since 12
*/
/**
* Describes the criteria for filtering scanning results can be set.
*
* @typedef ScanFilter
* @syscap SystemCapability.Communication.Bluetooth.Core
* @crossplatform
* @atomicservice
* @since 13
*/
interface ScanFilter {
/**
* The address of a BLE peripheral device
*
* @type { ?string }
* @syscap SystemCapability.Communication.Bluetooth.Core
* @since 10
*/
/**
* The address of a BLE peripheral device
*
* @type { ?string }
* @syscap SystemCapability.Communication.Bluetooth.Core
* @atomicservice
* @since 12
*/
/**
* The address of a BLE peripheral device
*
* @type { ?string }
* @syscap SystemCapability.Communication.Bluetooth.Core
* @crossplatform
* @atomicservice
* @since 13
*/
deviceId?: string;
/**
* The name of a BLE peripheral device
*
* @type { ?string }
* @syscap SystemCapability.Communication.Bluetooth.Core
* @since 10
*/
/**
* The name of a BLE peripheral device
*
* @type { ?string }
* @syscap SystemCapability.Communication.Bluetooth.Core
* @atomicservice
* @since 12
*/
/**
* The name of a BLE peripheral device
*
* @type { ?string }
* @syscap SystemCapability.Communication.Bluetooth.Core
* @crossplatform
* @atomicservice
* @since 13
*/
name?: string;
/**
* The service UUID of a BLE peripheral device
*
* @type { ?string }
* @syscap SystemCapability.Communication.Bluetooth.Core
* @since 10
*/
/**
* The service UUID of a BLE peripheral device
*
* @type { ?string }
* @syscap SystemCapability.Communication.Bluetooth.Core
* @atomicservice
* @since 12
*/
/**
* The service UUID of a BLE peripheral device
*
* @type { ?string }
* @syscap SystemCapability.Communication.Bluetooth.Core
* @crossplatform
* @atomicservice
* @since 13
*/
serviceUuid?: string;
/**
* Service UUID mask.
*
* @type { ?string }
* @syscap SystemCapability.Communication.Bluetooth.Core
* @since 10
*/
/**
* Service UUID mask.
*
* @type { ?string }
* @syscap SystemCapability.Communication.Bluetooth.Core
* @atomicservice
* @since 12
*/
/**
* Service UUID mask.
*
* @type { ?string }
* @syscap SystemCapability.Communication.Bluetooth.Core
* @crossplatform
* @atomicservice
* @since 13
*/
serviceUuidMask?: string;
/**
* Service solicitation UUID.
*
* @type { ?string }
* @syscap SystemCapability.Communication.Bluetooth.Core
* @since 10
*/
/**
* Service solicitation UUID.
*
* @type { ?string }
* @syscap SystemCapability.Communication.Bluetooth.Core
* @atomicservice
* @since 12
*/
/**
* Service solicitation UUID.
*
* @type { ?string }
* @syscap SystemCapability.Communication.Bluetooth.Core
* @crossplatform
* @atomicservice
* @since 13
*/
serviceSolicitationUuid?: string;
/**
* Service solicitation UUID mask.
*
* @type { ?string }
* @syscap SystemCapability.Communication.Bluetooth.Core
* @since 10
*/
/**
* Service solicitation UUID mask.
*
* @type { ?string }
* @syscap SystemCapability.Communication.Bluetooth.Core
* @atomicservice
* @since 12
*/
/**
* Service solicitation UUID mask.
*
* @type { ?string }
* @syscap SystemCapability.Communication.Bluetooth.Core
* @crossplatform
* @atomicservice
* @since 13
*/
serviceSolicitationUuidMask?: string;
/**
* Service data.
*
* @type { ?ArrayBuffer }
* @syscap SystemCapability.Communication.Bluetooth.Core
* @since 10
*/
/**
* Service data.
*
* @type { ?ArrayBuffer }
* @syscap SystemCapability.Communication.Bluetooth.Core
* @atomicservice
* @since 12
*/
/**
* Service data.
*
* @type { ?ArrayBuffer }
* @syscap SystemCapability.Communication.Bluetooth.Core
* @crossplatform
* @atomicservice
* @since 13
*/
serviceData?: ArrayBuffer;
/**
* Service data mask.
*
* @type { ?ArrayBuffer }
* @syscap SystemCapability.Communication.Bluetooth.Core
* @since 10
*/
/**
* Service data mask.
*
* @type { ?ArrayBuffer }
* @syscap SystemCapability.Communication.Bluetooth.Core
* @atomicservice
* @since 12
*/
/**
* Service data mask.
*
* @type { ?ArrayBuffer }
* @syscap SystemCapability.Communication.Bluetooth.Core
* @crossplatform
* @atomicservice
* @since 13
*/
serviceDataMask?: ArrayBuffer;
/**
* Manufacture id.
*
* @type { ?number }
* @syscap SystemCapability.Communication.Bluetooth.Core
* @since 10
*/
/**
* Manufacture id.
*
* @type { ?number }
* @syscap SystemCapability.Communication.Bluetooth.Core
* @atomicservice
* @since 12
*/
/**
* Manufacture id.
*
* @type { ?number }
* @syscap SystemCapability.Communication.Bluetooth.Core
* @crossplatform
* @atomicservice
* @since 13
*/
manufactureId?: number;
/**
* Manufacture data.
*
* @type { ?ArrayBuffer }
* @syscap SystemCapability.Communication.Bluetooth.Core
* @since 10
*/
/**
* Manufacture data.
*
* @type { ?ArrayBuffer }
* @syscap SystemCapability.Communication.Bluetooth.Core
* @atomicservice
* @since 12
*/
/**
* Manufacture data.
*
* @type { ?ArrayBuffer }
* @syscap SystemCapability.Communication.Bluetooth.Core
* @crossplatform
* @atomicservice
* @since 13
*/
manufactureData?: ArrayBuffer;
/**
* Manufacture data mask.
*
* @type { ?ArrayBuffer }
* @syscap SystemCapability.Communication.Bluetooth.Core
* @since 10
*/
/**
* Manufacture data mask.
*
* @type { ?ArrayBuffer }
* @syscap SystemCapability.Communication.Bluetooth.Core
* @atomicservice
* @since 12
*/
/**
* Manufacture data mask.
*
* @type { ?ArrayBuffer }
* @syscap SystemCapability.Communication.Bluetooth.Core
* @crossplatform
* @atomicservice
* @since 13
*/
manufactureDataMask?: ArrayBuffer;
}
/**
* Describes the parameters for scan.
*
* @typedef ScanOptions
* @syscap SystemCapability.Communication.Bluetooth.Core
* @since 10
*/
/**
* Describes the parameters for scan.
*
* @typedef ScanOptions
* @syscap SystemCapability.Communication.Bluetooth.Core
* @atomicservice
* @since 12
*/
/**
* Describes the parameters for scan.
*
* @typedef ScanOptions
* @syscap SystemCapability.Communication.Bluetooth.Core
* @crossplatform
* @atomicservice
* @since 13
*/
interface ScanOptions {
/**
* Time of delay for reporting the scan result
*
* @type { ?number }
* @syscap SystemCapability.Communication.Bluetooth.Core
* @since 10
*/
/**
* Time of delay for reporting the scan result
*
* @type { ?number }
* @syscap SystemCapability.Communication.Bluetooth.Core
* @atomicservice
* @since 12
*/
/**
* Time of delay for reporting the scan result
*
* @type { ?number }
* @syscap SystemCapability.Communication.Bluetooth.Core
* @crossplatform
* @atomicservice
* @since 13
*/
interval?: number;
/**
* Bluetooth LE scan mode
*
* @type { ?ScanDuty }
* @syscap SystemCapability.Communication.Bluetooth.Core
* @since 10
*/
/**
* Bluetooth LE scan mode
*
* @type { ?ScanDuty }
* @syscap SystemCapability.Communication.Bluetooth.Core
* @atomicservice
* @since 12
*/
/**
* Bluetooth LE scan mode
*
* @type { ?ScanDuty }
* @syscap SystemCapability.Communication.Bluetooth.Core
* @crossplatform
* @atomicservice
* @since 13
*/
dutyMode?: ScanDuty;
/**
* Match mode for Bluetooth LE scan filters hardware match
*
* @type { ?MatchMode }
* @syscap SystemCapability.Communication.Bluetooth.Core
* @since 10
*/
/**
* Match mode for Bluetooth LE scan filters hardware match
*
* @type { ?MatchMode }
* @syscap SystemCapability.Communication.Bluetooth.Core
* @atomicservice
* @since 12
*/
matchMode?: MatchMode;
/**
* Physical Layer used during scan.
*
* @type { ?PhyType }
* @syscap SystemCapability.Communication.Bluetooth.Core
* @atomicservice
* @since 12
*/
/**
* Physical Layer used during scan.
*
* @type { ?PhyType }
* @syscap SystemCapability.Communication.Bluetooth.Core
* @crossplatform
* @atomicservice
* @since 13
*/
phyType?: PhyType;
}
/**
* Describes the properties of a gatt characteristic.
*
* @typedef GattProperties
* @syscap SystemCapability.Communication.Bluetooth.Core
* @since 10
*/
/**
* Describes the properties of a gatt characteristic.
*
* @typedef GattProperties
* @syscap SystemCapability.Communication.Bluetooth.Core
* @atomicservice
* @since 12
*/
/**
* Describes the properties of a gatt characteristic.
*
* @typedef GattProperties
* @syscap SystemCapability.Communication.Bluetooth.Core
* @crossplatform
* @atomicservice
* @since 13
*/
interface GattProperties {
/**
* Support write property of the characteristic.
*
* @type { ?boolean }
* @syscap SystemCapability.Communication.Bluetooth.Core
* @since 10
*/
/**
* Support write property of the characteristic.
*
* @type { ?boolean }
* @syscap SystemCapability.Communication.Bluetooth.Core
* @atomicservice
* @since 12
*/
/**
* Support write property of the characteristic.
*
* @type { ?boolean }
* @syscap SystemCapability.Communication.Bluetooth.Core
* @crossplatform
* @atomicservice
* @since 13
*/
write?: boolean;
/**
* Support write no response property of the characteristic.
*
* @type { ?boolean }
* @syscap SystemCapability.Communication.Bluetooth.Core
* @since 10
*/
/**
* Support write no response property of the characteristic.
*
* @type { ?boolean }
* @syscap SystemCapability.Communication.Bluetooth.Core
* @atomicservice
* @since 12
*/
/**
* Support write no response property of the characteristic.
*
* @type { ?boolean }
* @syscap SystemCapability.Communication.Bluetooth.Core
* @crossplatform
* @atomicservice
* @since 13
*/
writeNoResponse?: boolean;
/**
* Support read property of the characteristic.
*
* @type { ?boolean }
* @syscap SystemCapability.Communication.Bluetooth.Core
* @since 10
*/
/**
* Support read property of the characteristic.
*
* @type { ?boolean }
* @syscap SystemCapability.Communication.Bluetooth.Core
* @atomicservice
* @since 12
*/
/**
* Support read property of the characteristic.
*
* @type { ?boolean }
* @syscap SystemCapability.Communication.Bluetooth.Core
* @crossplatform
* @atomicservice
* @since 13
*/
read?: boolean;
/**
* Support notify property of the characteristic.
*
* @type { ?boolean }
* @syscap SystemCapability.Communication.Bluetooth.Core
* @since 10
*/
/**
* Support notify property of the characteristic.
*
* @type { ?boolean }
* @syscap SystemCapability.Communication.Bluetooth.Core
* @atomicservice
* @since 12
*/
/**
* Support notify property of the characteristic.
*
* @type { ?boolean }
* @syscap SystemCapability.Communication.Bluetooth.Core
* @crossplatform
* @atomicservice
* @since 13
*/
notify?: boolean;
/**
* Support indicate property of the characteristic.
*
* @type { ?boolean }
* @syscap SystemCapability.Communication.Bluetooth.Core
* @since 10
*/
/**
* Support indicate property of the characteristic.
*
* @type { ?boolean }
* @syscap SystemCapability.Communication.Bluetooth.Core
* @atomicservice
* @since 12
*/
indicate?: boolean;
}
/**
* The enum of gatt characteristic write type
*
* @enum { number }
* @syscap SystemCapability.Communication.Bluetooth.Core
* @since 10
*/
/**
* The enum of gatt characteristic write type
*
* @enum { number }
* @syscap SystemCapability.Communication.Bluetooth.Core
* @atomicservice
* @since 12
*/
/**
* The enum of gatt characteristic write type
*
* @enum { number }
* @syscap SystemCapability.Communication.Bluetooth.Core
* @crossplatform
* @atomicservice
* @since 13
*/
enum GattWriteType {
/**
* Write characteristic with response.
*
* @syscap SystemCapability.Communication.Bluetooth.Core
* @since 10
*/
/**
* Write characteristic with response.
*
* @syscap SystemCapability.Communication.Bluetooth.Core
* @atomicservice
* @since 12
*/
/**
* Write characteristic with response.
*
* @syscap SystemCapability.Communication.Bluetooth.Core
* @crossplatform
* @atomicservice
* @since 13
*/
WRITE = 1,
/**
* Write characteristic without response.
*
* @syscap SystemCapability.Communication.Bluetooth.Core
* @since 10
*/
/**
* Write characteristic without response.
*
* @syscap SystemCapability.Communication.Bluetooth.Core
* @atomicservice
* @since 12
*/
/**
* Write characteristic without response.
*
* @syscap SystemCapability.Communication.Bluetooth.Core
* @crossplatform
* @atomicservice
* @since 13
*/
WRITE_NO_RESPONSE = 2
}
/**
* The enum of scan duty.
*
* @enum { number }
* @syscap SystemCapability.Communication.Bluetooth.Core
* @since 10
*/
/**
* The enum of scan duty.
*
* @enum { number }
* @syscap SystemCapability.Communication.Bluetooth.Core
* @atomicservice
* @since 12
*/
/**
* The enum of scan duty.
*
* @enum { number }
* @syscap SystemCapability.Communication.Bluetooth.Core
* @crossplatform
* @atomicservice
* @since 13
*/
enum ScanDuty {
/**
* low power mode
*
* @syscap SystemCapability.Communication.Bluetooth.Core
* @since 10
*/
/**
* low power mode
*
* @syscap SystemCapability.Communication.Bluetooth.Core
* @atomicservice
* @since 12
*/
/**
* low power mode
*
* @syscap SystemCapability.Communication.Bluetooth.Core
* @crossplatform
* @atomicservice
* @since 13
*/
SCAN_MODE_LOW_POWER = 0,
/**
* balanced power mode
*
* @syscap SystemCapability.Communication.Bluetooth.Core
* @since 10
*/
/**
* balanced power mode
*
* @syscap SystemCapability.Communication.Bluetooth.Core
* @atomicservice
* @since 12
*/
/**
* balanced power mode
*
* @syscap SystemCapability.Communication.Bluetooth.Core
* @crossplatform
* @atomicservice
* @since 13
*/
SCAN_MODE_BALANCED = 1,
/**
* Scan using highest duty cycle
*
* @syscap SystemCapability.Communication.Bluetooth.Core
* @since 10
*/
/**
* Scan using highest duty cycle
*
* @syscap SystemCapability.Communication.Bluetooth.Core
* @atomicservice
* @since 12
*/
/**
* Scan using highest duty cycle
*
* @syscap SystemCapability.Communication.Bluetooth.Core
* @crossplatform
* @atomicservice
* @since 13
*/
SCAN_MODE_LOW_LATENCY = 2
}
/**
* The enum of BLE match mode.
*
* @enum { number }
* @syscap SystemCapability.Communication.Bluetooth.Core
* @since 10
*/
/**
* The enum of BLE match mode.
*
* @enum { number }
* @syscap SystemCapability.Communication.Bluetooth.Core
* @atomicservice
* @since 12
*/
enum MatchMode {
/**
* aggressive mode
*
* @syscap SystemCapability.Communication.Bluetooth.Core
* @since 10
*/
/**
* aggressive mode
*
* @syscap SystemCapability.Communication.Bluetooth.Core
* @atomicservice
* @since 12
*/
MATCH_MODE_AGGRESSIVE = 1,
/**
* sticky mode
*
* @syscap SystemCapability.Communication.Bluetooth.Core
* @since 10
*/
/**
* sticky mode
*
* @syscap SystemCapability.Communication.Bluetooth.Core
* @atomicservice
* @since 12
*/
MATCH_MODE_STICKY = 2
}
/**
* The enum of BLE advertising state.
*
* @enum { number }
* @syscap SystemCapability.Communication.Bluetooth.Core
* @since 11
*/
/**
* The enum of BLE advertising state.
*
* @enum { number }
* @syscap SystemCapability.Communication.Bluetooth.Core
* @crossplatform
* @since 13
*/
enum AdvertisingState {
/**
* advertising started.
*
* @syscap SystemCapability.Communication.Bluetooth.Core
* @since 11
*/
/**
* advertising started.
*
* @syscap SystemCapability.Communication.Bluetooth.Core
* @crossplatform
* @since 13
*/
STARTED = 1,
/**
* advertising temporarily enabled.
*
* @syscap SystemCapability.Communication.Bluetooth.Core
* @since 11
*/
ENABLED = 2,
/**
* advertising temporarily disabled.
*
* @syscap SystemCapability.Communication.Bluetooth.Core
* @since 11
*/
DISABLED = 3,
/**
* advertising stopped.
*
* @syscap SystemCapability.Communication.Bluetooth.Core
* @since 11
*/
/**
* advertising stopped.
*
* @syscap SystemCapability.Communication.Bluetooth.Core
* @crossplatform
* @since 13
*/
STOPPED = 4
}
/**
* Phy type used during scan.
*
* @enum { number }
* @syscap SystemCapability.Communication.Bluetooth.Core
* @atomicservice
* @since 12
*/
/**
* Phy type used during scan.
*
* @enum { number }
* @syscap SystemCapability.Communication.Bluetooth.Core
* @crossplatform
* @atomicservice
* @since 13
*/
enum PhyType {
/**
* Use 1M phy for scanning.
*
* @syscap SystemCapability.Communication.Bluetooth.Core
* @atomicservice
* @since 12
*/
/**
* Use 1M phy for scanning.
*
* @syscap SystemCapability.Communication.Bluetooth.Core
* @crossplatform
* @atomicservice
* @since 13
*/
PHY_LE_1M = 1,
/**
* Use all supported Phys for scanning.
*
* @syscap SystemCapability.Communication.Bluetooth.Core
* @atomicservice
* @since 12
*/
/**
* Use all supported Phys for scanning.
*
* @syscap SystemCapability.Communication.Bluetooth.Core
* @crossplatform
* @atomicservice
* @since 13
*/
PHY_LE_ALL_SUPPORTED = 255
}
}
export default ble;