161847f8eSopenharmony_ci/*
261847f8eSopenharmony_ci * Copyright (C) 2023-2024 Huawei Device Co., Ltd.
361847f8eSopenharmony_ci * Licensed under the Apache License, Version 2.0 (the "License");
461847f8eSopenharmony_ci * you may not use this file except in compliance with the License.
561847f8eSopenharmony_ci * You may obtain a copy of the License at
661847f8eSopenharmony_ci *
761847f8eSopenharmony_ci *     http://www.apache.org/licenses/LICENSE-2.0
861847f8eSopenharmony_ci *
961847f8eSopenharmony_ci * Unless required by applicable law or agreed to in writing, software
1061847f8eSopenharmony_ci * distributed under the License is distributed on an "AS IS" BASIS,
1161847f8eSopenharmony_ci * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1261847f8eSopenharmony_ci * See the License for the specific language governing permissions and
1361847f8eSopenharmony_ci * limitations under the License.
1461847f8eSopenharmony_ci */
1561847f8eSopenharmony_ci
1661847f8eSopenharmony_ci/**
1761847f8eSopenharmony_ci * @file
1861847f8eSopenharmony_ci * @kit ConnectivityKit
1961847f8eSopenharmony_ci */
2061847f8eSopenharmony_ci
2161847f8eSopenharmony_ciimport type { AsyncCallback, Callback } from './@ohos.base';
2261847f8eSopenharmony_ci
2361847f8eSopenharmony_ci/**
2461847f8eSopenharmony_ci * Provides methods for enabling/disabling bluetooth or monitoring bluetooth state.
2561847f8eSopenharmony_ci *
2661847f8eSopenharmony_ci * @namespace access
2761847f8eSopenharmony_ci * @syscap SystemCapability.Communication.Bluetooth.Core
2861847f8eSopenharmony_ci * @since 10
2961847f8eSopenharmony_ci */
3061847f8eSopenharmony_ci/**
3161847f8eSopenharmony_ci * Provides methods for enabling/disabling bluetooth or monitoring bluetooth state.
3261847f8eSopenharmony_ci *
3361847f8eSopenharmony_ci * @namespace access
3461847f8eSopenharmony_ci * @syscap SystemCapability.Communication.Bluetooth.Core
3561847f8eSopenharmony_ci * @atomicservice
3661847f8eSopenharmony_ci * @since 11
3761847f8eSopenharmony_ci */
3861847f8eSopenharmony_ci/**
3961847f8eSopenharmony_ci * Provides methods for enabling/disabling bluetooth or monitoring bluetooth state.
4061847f8eSopenharmony_ci *
4161847f8eSopenharmony_ci * @namespace access
4261847f8eSopenharmony_ci * @syscap SystemCapability.Communication.Bluetooth.Core
4361847f8eSopenharmony_ci * @crossplatform
4461847f8eSopenharmony_ci * @atomicservice
4561847f8eSopenharmony_ci * @since 13
4661847f8eSopenharmony_ci */
4761847f8eSopenharmony_cideclare namespace access {
4861847f8eSopenharmony_ci  /**
4961847f8eSopenharmony_ci   * Enables Bluetooth on a device.
5061847f8eSopenharmony_ci   *
5161847f8eSopenharmony_ci   * @permission ohos.permission.ACCESS_BLUETOOTH
5261847f8eSopenharmony_ci   * @throws { BusinessError } 201 - Permission denied.
5361847f8eSopenharmony_ci   * @throws { BusinessError } 801 - Capability not supported.
5461847f8eSopenharmony_ci   * @throws { BusinessError } 2900001 - Service stopped.
5561847f8eSopenharmony_ci   * @throws { BusinessError } 2900099 - Operation failed.
5661847f8eSopenharmony_ci   * @syscap SystemCapability.Communication.Bluetooth.Core
5761847f8eSopenharmony_ci   * @since 10
5861847f8eSopenharmony_ci   */
5961847f8eSopenharmony_ci  /**
6061847f8eSopenharmony_ci   * Enables Bluetooth on a device.
6161847f8eSopenharmony_ci   *
6261847f8eSopenharmony_ci   * @permission ohos.permission.ACCESS_BLUETOOTH
6361847f8eSopenharmony_ci   * @throws { BusinessError } 201 - Permission denied.
6461847f8eSopenharmony_ci   * @throws { BusinessError } 801 - Capability not supported.
6561847f8eSopenharmony_ci   * @throws { BusinessError } 2900001 - Service stopped.
6661847f8eSopenharmony_ci   * @throws { BusinessError } 2900099 - Operation failed.
6761847f8eSopenharmony_ci   * @syscap SystemCapability.Communication.Bluetooth.Core
6861847f8eSopenharmony_ci   * @atomicservice
6961847f8eSopenharmony_ci   * @since 12
7061847f8eSopenharmony_ci   */
7161847f8eSopenharmony_ci  /**
7261847f8eSopenharmony_ci   * Enables Bluetooth on a device.
7361847f8eSopenharmony_ci   *
7461847f8eSopenharmony_ci   * @permission ohos.permission.ACCESS_BLUETOOTH
7561847f8eSopenharmony_ci   * @throws { BusinessError } 201 - Permission denied.
7661847f8eSopenharmony_ci   * @throws { BusinessError } 801 - Capability not supported.
7761847f8eSopenharmony_ci   * @throws { BusinessError } 2900001 - Service stopped.
7861847f8eSopenharmony_ci   * @throws { BusinessError } 2900099 - Operation failed.
7961847f8eSopenharmony_ci   * @syscap SystemCapability.Communication.Bluetooth.Core
8061847f8eSopenharmony_ci   * @crossplatform
8161847f8eSopenharmony_ci   * @atomicservice
8261847f8eSopenharmony_ci   * @since 13
8361847f8eSopenharmony_ci   */
8461847f8eSopenharmony_ci  function enableBluetooth(): void;
8561847f8eSopenharmony_ci
8661847f8eSopenharmony_ci  /**
8761847f8eSopenharmony_ci   * Disables Bluetooth on a device.
8861847f8eSopenharmony_ci   *
8961847f8eSopenharmony_ci   * @permission ohos.permission.ACCESS_BLUETOOTH
9061847f8eSopenharmony_ci   * @throws { BusinessError } 201 - Permission denied.
9161847f8eSopenharmony_ci   * @throws { BusinessError } 801 - Capability not supported.
9261847f8eSopenharmony_ci   * @throws { BusinessError } 2900001 - Service stopped.
9361847f8eSopenharmony_ci   * @throws { BusinessError } 2900099 - Operation failed.
9461847f8eSopenharmony_ci   * @syscap SystemCapability.Communication.Bluetooth.Core
9561847f8eSopenharmony_ci   * @since 10
9661847f8eSopenharmony_ci   */
9761847f8eSopenharmony_ci  /**
9861847f8eSopenharmony_ci   * Disables Bluetooth on a device.
9961847f8eSopenharmony_ci   *
10061847f8eSopenharmony_ci   * @permission ohos.permission.ACCESS_BLUETOOTH
10161847f8eSopenharmony_ci   * @throws { BusinessError } 201 - Permission denied.
10261847f8eSopenharmony_ci   * @throws { BusinessError } 801 - Capability not supported.
10361847f8eSopenharmony_ci   * @throws { BusinessError } 2900001 - Service stopped.
10461847f8eSopenharmony_ci   * @throws { BusinessError } 2900099 - Operation failed.
10561847f8eSopenharmony_ci   * @syscap SystemCapability.Communication.Bluetooth.Core
10661847f8eSopenharmony_ci   * @atomicservice
10761847f8eSopenharmony_ci   * @since 12
10861847f8eSopenharmony_ci   */
10961847f8eSopenharmony_ci  /**
11061847f8eSopenharmony_ci   * Disables Bluetooth on a device.
11161847f8eSopenharmony_ci   *
11261847f8eSopenharmony_ci   * @permission ohos.permission.ACCESS_BLUETOOTH
11361847f8eSopenharmony_ci   * @throws { BusinessError } 201 - Permission denied.
11461847f8eSopenharmony_ci   * @throws { BusinessError } 801 - Capability not supported.
11561847f8eSopenharmony_ci   * @throws { BusinessError } 2900001 - Service stopped.
11661847f8eSopenharmony_ci   * @throws { BusinessError } 2900099 - Operation failed.
11761847f8eSopenharmony_ci   * @syscap SystemCapability.Communication.Bluetooth.Core
11861847f8eSopenharmony_ci   * @crossplatform
11961847f8eSopenharmony_ci   * @atomicservice
12061847f8eSopenharmony_ci   * @since 13
12161847f8eSopenharmony_ci   */
12261847f8eSopenharmony_ci  function disableBluetooth(): void;
12361847f8eSopenharmony_ci
12461847f8eSopenharmony_ci  /**
12561847f8eSopenharmony_ci   * Restrict Bluetooth BR/EDR ability on a device.
12661847f8eSopenharmony_ci   *
12761847f8eSopenharmony_ci   * @permission ohos.permission.ACCESS_BLUETOOTH and ohos.permission.MANAGE_BLUETOOTH
12861847f8eSopenharmony_ci   * @returns { Promise<void> } Promise that returns no value.
12961847f8eSopenharmony_ci   * @throws { BusinessError } 201 - Permission denied.
13061847f8eSopenharmony_ci   * @throws { BusinessError } 202 - Non-system applications are not allowed to use system APIs.
13161847f8eSopenharmony_ci   * @throws { BusinessError } 801 - Capability not supported.
13261847f8eSopenharmony_ci   * @throws { BusinessError } 2900001 - Service stopped.
13361847f8eSopenharmony_ci   * @throws { BusinessError } 2900099 - Operation failed.
13461847f8eSopenharmony_ci   * @syscap SystemCapability.Communication.Bluetooth.Core
13561847f8eSopenharmony_ci   * @systemapi
13661847f8eSopenharmony_ci   * @since 12
13761847f8eSopenharmony_ci   */
13861847f8eSopenharmony_ci  function restrictBluetooth(): Promise<void>;
13961847f8eSopenharmony_ci
14061847f8eSopenharmony_ci  /**
14161847f8eSopenharmony_ci   * Obtains the Bluetooth status of a device.
14261847f8eSopenharmony_ci   *
14361847f8eSopenharmony_ci   * @permission ohos.permission.ACCESS_BLUETOOTH
14461847f8eSopenharmony_ci   * @returns { BluetoothState } Returns the Bluetooth status.
14561847f8eSopenharmony_ci   * @throws { BusinessError } 201 - Permission denied.
14661847f8eSopenharmony_ci   * @throws { BusinessError } 801 - Capability not supported.
14761847f8eSopenharmony_ci   * @throws { BusinessError } 2900001 - Service stopped.
14861847f8eSopenharmony_ci   * @throws { BusinessError } 2900099 - Operation failed.
14961847f8eSopenharmony_ci   * @syscap SystemCapability.Communication.Bluetooth.Core
15061847f8eSopenharmony_ci   * @since 10
15161847f8eSopenharmony_ci   */
15261847f8eSopenharmony_ci  /**
15361847f8eSopenharmony_ci   * Obtains the Bluetooth status of a device.
15461847f8eSopenharmony_ci   *
15561847f8eSopenharmony_ci   * @permission ohos.permission.ACCESS_BLUETOOTH
15661847f8eSopenharmony_ci   * @returns { BluetoothState } Returns the Bluetooth status.
15761847f8eSopenharmony_ci   * @throws { BusinessError } 201 - Permission denied.
15861847f8eSopenharmony_ci   * @throws { BusinessError } 801 - Capability not supported.
15961847f8eSopenharmony_ci   * @throws { BusinessError } 2900001 - Service stopped.
16061847f8eSopenharmony_ci   * @throws { BusinessError } 2900099 - Operation failed.
16161847f8eSopenharmony_ci   * @syscap SystemCapability.Communication.Bluetooth.Core
16261847f8eSopenharmony_ci   * @atomicservice
16361847f8eSopenharmony_ci   * @since 11
16461847f8eSopenharmony_ci   */
16561847f8eSopenharmony_ci  /**
16661847f8eSopenharmony_ci   * Obtains the Bluetooth status of a device.
16761847f8eSopenharmony_ci   *
16861847f8eSopenharmony_ci   * @returns { BluetoothState } Returns the Bluetooth status.
16961847f8eSopenharmony_ci   * @throws { BusinessError } 801 - Capability not supported.
17061847f8eSopenharmony_ci   * @throws { BusinessError } 2900001 - Service stopped.
17161847f8eSopenharmony_ci   * @throws { BusinessError } 2900099 - Operation failed.
17261847f8eSopenharmony_ci   * @syscap SystemCapability.Communication.Bluetooth.Core
17361847f8eSopenharmony_ci   * @crossplatform
17461847f8eSopenharmony_ci   * @atomicservice
17561847f8eSopenharmony_ci   * @since 13
17661847f8eSopenharmony_ci   */
17761847f8eSopenharmony_ci  function getState(): BluetoothState;
17861847f8eSopenharmony_ci
17961847f8eSopenharmony_ci  /**
18061847f8eSopenharmony_ci   * Restoring bluetooth settings.
18161847f8eSopenharmony_ci   *
18261847f8eSopenharmony_ci   * @permission ohos.permission.ACCESS_BLUETOOTH and ohos.permission.MANAGE_BLUETOOTH
18361847f8eSopenharmony_ci   * @param { AsyncCallback<void> } callback - Callback used to return the result.
18461847f8eSopenharmony_ci   * @throws { BusinessError } 201 - Permission denied.
18561847f8eSopenharmony_ci   * @throws { BusinessError } 202 - Non-system applications are not allowed to use system APIs.
18661847f8eSopenharmony_ci   * @throws { BusinessError } 401 - Invalid parameter. Possible causes: 1. Mandatory parameters are left unspecified.
18761847f8eSopenharmony_ci   * <br>2. Incorrect parameter types.
18861847f8eSopenharmony_ci   * @throws { BusinessError } 801 - Capability not supported.
18961847f8eSopenharmony_ci   * @throws { BusinessError } 2900001 - Service stopped.
19061847f8eSopenharmony_ci   * @throws { BusinessError } 2900099 - Operation failed.
19161847f8eSopenharmony_ci   * @syscap SystemCapability.Communication.Bluetooth.Core
19261847f8eSopenharmony_ci   * @systemapi
19361847f8eSopenharmony_ci   * @since 11
19461847f8eSopenharmony_ci   */
19561847f8eSopenharmony_ci  function factoryReset(callback: AsyncCallback<void>): void;
19661847f8eSopenharmony_ci
19761847f8eSopenharmony_ci  /**
19861847f8eSopenharmony_ci   * Restoring bluetooth settings.
19961847f8eSopenharmony_ci   *
20061847f8eSopenharmony_ci   * @permission ohos.permission.ACCESS_BLUETOOTH and ohos.permission.MANAGE_BLUETOOTH
20161847f8eSopenharmony_ci   * @returns { Promise<void> } Promise that returns no value.
20261847f8eSopenharmony_ci   * @throws { BusinessError } 201 - Permission denied.
20361847f8eSopenharmony_ci   * @throws { BusinessError } 202 - Non-system applications are not allowed to use system APIs.
20461847f8eSopenharmony_ci   * @throws { BusinessError } 801 - Capability not supported.
20561847f8eSopenharmony_ci   * @throws { BusinessError } 2900001 - Service stopped.
20661847f8eSopenharmony_ci   * @throws { BusinessError } 2900099 - Operation failed.
20761847f8eSopenharmony_ci   * @syscap SystemCapability.Communication.Bluetooth.Core
20861847f8eSopenharmony_ci   * @systemapi
20961847f8eSopenharmony_ci   * @since 11
21061847f8eSopenharmony_ci   */
21161847f8eSopenharmony_ci  function factoryReset(): Promise<void>;
21261847f8eSopenharmony_ci
21361847f8eSopenharmony_ci  /**
21461847f8eSopenharmony_ci   * Obtaining the MAC address of the local device.
21561847f8eSopenharmony_ci   *
21661847f8eSopenharmony_ci   * @permission ohos.permission.ACCESS_BLUETOOTH and ohos.permission.GET_BLUETOOTH_LOCAL_MAC
21761847f8eSopenharmony_ci   * @returns { string } The local MAC address. For example, "11:22:33:AA:BB:FF".
21861847f8eSopenharmony_ci   * @throws { BusinessError } 201 - Permission denied.
21961847f8eSopenharmony_ci   * @throws { BusinessError } 202 - Non-system applications are not allowed to use system APIs.
22061847f8eSopenharmony_ci   * @throws { BusinessError } 801 - Capability not supported.
22161847f8eSopenharmony_ci   * @throws { BusinessError } 2900001 - Service stopped.
22261847f8eSopenharmony_ci   * @throws { BusinessError } 2900099 - Operation failed.
22361847f8eSopenharmony_ci   * @syscap SystemCapability.Communication.Bluetooth.Core
22461847f8eSopenharmony_ci   * @systemapi
22561847f8eSopenharmony_ci   * @since 11
22661847f8eSopenharmony_ci   */
22761847f8eSopenharmony_ci  function getLocalAddress(): string;
22861847f8eSopenharmony_ci
22961847f8eSopenharmony_ci  /**
23061847f8eSopenharmony_ci   * Subscribe the event reported when the Bluetooth state changes.
23161847f8eSopenharmony_ci   *
23261847f8eSopenharmony_ci   * @permission ohos.permission.ACCESS_BLUETOOTH
23361847f8eSopenharmony_ci   * @param { 'stateChange' } type - Type of the Bluetooth state changes event to listen for.
23461847f8eSopenharmony_ci   * @param { Callback<BluetoothState> } callback - Callback used to listen for the Bluetooth state event.
23561847f8eSopenharmony_ci   * @throws { BusinessError } 201 - Permission denied.
23661847f8eSopenharmony_ci   * @throws { BusinessError } 401 - Invalid parameter. Possible causes: 1. Mandatory parameters are left unspecified.
23761847f8eSopenharmony_ci   * <br>2. Incorrect parameter types. 3. Parameter verification failed.
23861847f8eSopenharmony_ci   * @throws { BusinessError } 801 - Capability not supported.
23961847f8eSopenharmony_ci   * @throws { BusinessError } 2900099 - Operation failed.
24061847f8eSopenharmony_ci   * @syscap SystemCapability.Communication.Bluetooth.Core
24161847f8eSopenharmony_ci   * @since 10
24261847f8eSopenharmony_ci   */
24361847f8eSopenharmony_ci  /**
24461847f8eSopenharmony_ci   * Subscribe the event reported when the Bluetooth state changes.
24561847f8eSopenharmony_ci   *
24661847f8eSopenharmony_ci   * @permission ohos.permission.ACCESS_BLUETOOTH
24761847f8eSopenharmony_ci   * @param { 'stateChange' } type - Type of the Bluetooth state changes event to listen for.
24861847f8eSopenharmony_ci   * @param { Callback<BluetoothState> } callback - Callback used to listen for the Bluetooth state event.
24961847f8eSopenharmony_ci   * @throws { BusinessError } 201 - Permission denied.
25061847f8eSopenharmony_ci   * @throws { BusinessError } 401 - Invalid parameter. Possible causes: 1. Mandatory parameters are left unspecified.
25161847f8eSopenharmony_ci   * <br>2. Incorrect parameter types. 3. Parameter verification failed.
25261847f8eSopenharmony_ci   * @throws { BusinessError } 801 - Capability not supported.
25361847f8eSopenharmony_ci   * @throws { BusinessError } 2900099 - Operation failed.
25461847f8eSopenharmony_ci   * @syscap SystemCapability.Communication.Bluetooth.Core
25561847f8eSopenharmony_ci   * @atomicservice
25661847f8eSopenharmony_ci   * @since 12
25761847f8eSopenharmony_ci   */
25861847f8eSopenharmony_ci  /**
25961847f8eSopenharmony_ci   * Subscribe the event reported when the Bluetooth state changes.
26061847f8eSopenharmony_ci   *
26161847f8eSopenharmony_ci   * @permission ohos.permission.ACCESS_BLUETOOTH
26261847f8eSopenharmony_ci   * @param { 'stateChange' } type - Type of the Bluetooth state changes event to listen for.
26361847f8eSopenharmony_ci   * @param { Callback<BluetoothState> } callback - Callback used to listen for the Bluetooth state event.
26461847f8eSopenharmony_ci   * @throws { BusinessError } 201 - Permission denied.
26561847f8eSopenharmony_ci   * @throws { BusinessError } 401 - Invalid parameter. Possible causes: 1. Mandatory parameters are left unspecified.
26661847f8eSopenharmony_ci   * <br>2. Incorrect parameter types. 3. Parameter verification failed.
26761847f8eSopenharmony_ci   * @throws { BusinessError } 801 - Capability not supported.
26861847f8eSopenharmony_ci   * @throws { BusinessError } 2900099 - Operation failed.
26961847f8eSopenharmony_ci   * @syscap SystemCapability.Communication.Bluetooth.Core
27061847f8eSopenharmony_ci   * @crossplatform
27161847f8eSopenharmony_ci   * @atomicservice
27261847f8eSopenharmony_ci   * @since 13
27361847f8eSopenharmony_ci   */
27461847f8eSopenharmony_ci  function on(type: 'stateChange', callback: Callback<BluetoothState>): void;
27561847f8eSopenharmony_ci
27661847f8eSopenharmony_ci  /**
27761847f8eSopenharmony_ci   * Unsubscribe the event reported when the Bluetooth state changes.
27861847f8eSopenharmony_ci   *
27961847f8eSopenharmony_ci   * @permission ohos.permission.ACCESS_BLUETOOTH
28061847f8eSopenharmony_ci   * @param { 'stateChange' } type - Type of the Bluetooth state changes event to listen for.
28161847f8eSopenharmony_ci   * @param { Callback<BluetoothState> } callback - Callback used to listen for the Bluetooth state event.
28261847f8eSopenharmony_ci   * @throws { BusinessError } 201 - Permission denied.
28361847f8eSopenharmony_ci   * @throws { BusinessError } 401 - Invalid parameter. Possible causes: 1. Mandatory parameters are left unspecified.
28461847f8eSopenharmony_ci   * <br>2. Incorrect parameter types. 3. Parameter verification failed.
28561847f8eSopenharmony_ci   * @throws { BusinessError } 801 - Capability not supported.
28661847f8eSopenharmony_ci   * @throws { BusinessError } 2900099 - Operation failed.
28761847f8eSopenharmony_ci   * @syscap SystemCapability.Communication.Bluetooth.Core
28861847f8eSopenharmony_ci   * @since 10
28961847f8eSopenharmony_ci   */
29061847f8eSopenharmony_ci  /**
29161847f8eSopenharmony_ci   * Unsubscribe the event reported when the Bluetooth state changes.
29261847f8eSopenharmony_ci   *
29361847f8eSopenharmony_ci   * @permission ohos.permission.ACCESS_BLUETOOTH
29461847f8eSopenharmony_ci   * @param { 'stateChange' } type - Type of the Bluetooth state changes event to listen for.
29561847f8eSopenharmony_ci   * @param { Callback<BluetoothState> } callback - Callback used to listen for the Bluetooth state event.
29661847f8eSopenharmony_ci   * @throws { BusinessError } 201 - Permission denied.
29761847f8eSopenharmony_ci   * @throws { BusinessError } 401 - Invalid parameter. Possible causes: 1. Mandatory parameters are left unspecified.
29861847f8eSopenharmony_ci   * <br>2. Incorrect parameter types. 3. Parameter verification failed.
29961847f8eSopenharmony_ci   * @throws { BusinessError } 801 - Capability not supported.
30061847f8eSopenharmony_ci   * @throws { BusinessError } 2900099 - Operation failed.
30161847f8eSopenharmony_ci   * @syscap SystemCapability.Communication.Bluetooth.Core
30261847f8eSopenharmony_ci   * @atomicservice
30361847f8eSopenharmony_ci   * @since 12
30461847f8eSopenharmony_ci   */
30561847f8eSopenharmony_ci  /**
30661847f8eSopenharmony_ci   * Unsubscribe the event reported when the Bluetooth state changes.
30761847f8eSopenharmony_ci   *
30861847f8eSopenharmony_ci   * @permission ohos.permission.ACCESS_BLUETOOTH
30961847f8eSopenharmony_ci   * @param { 'stateChange' } type - Type of the Bluetooth state changes event to listen for.
31061847f8eSopenharmony_ci   * @param { Callback<BluetoothState> } callback - Callback used to listen for the Bluetooth state event.
31161847f8eSopenharmony_ci   * @throws { BusinessError } 201 - Permission denied.
31261847f8eSopenharmony_ci   * @throws { BusinessError } 401 - Invalid parameter. Possible causes: 1. Mandatory parameters are left unspecified.
31361847f8eSopenharmony_ci   * <br>2. Incorrect parameter types. 3. Parameter verification failed.
31461847f8eSopenharmony_ci   * @throws { BusinessError } 801 - Capability not supported.
31561847f8eSopenharmony_ci   * @throws { BusinessError } 2900099 - Operation failed.
31661847f8eSopenharmony_ci   * @syscap SystemCapability.Communication.Bluetooth.Core
31761847f8eSopenharmony_ci   * @crossplatform
31861847f8eSopenharmony_ci   * @atomicservice
31961847f8eSopenharmony_ci   * @since 13
32061847f8eSopenharmony_ci   */
32161847f8eSopenharmony_ci  function off(type: 'stateChange', callback?: Callback<BluetoothState>): void;
32261847f8eSopenharmony_ci
32361847f8eSopenharmony_ci  /**
32461847f8eSopenharmony_ci   * The enum of bluetooth state.
32561847f8eSopenharmony_ci   *
32661847f8eSopenharmony_ci   * @enum { number }
32761847f8eSopenharmony_ci   * @syscap SystemCapability.Communication.Bluetooth.Core
32861847f8eSopenharmony_ci   * @since 10
32961847f8eSopenharmony_ci   */
33061847f8eSopenharmony_ci  /**
33161847f8eSopenharmony_ci   * The enum of bluetooth state.
33261847f8eSopenharmony_ci   *
33361847f8eSopenharmony_ci   * @enum { number }
33461847f8eSopenharmony_ci   * @syscap SystemCapability.Communication.Bluetooth.Core
33561847f8eSopenharmony_ci   * @atomicservice
33661847f8eSopenharmony_ci   * @since 11
33761847f8eSopenharmony_ci   */
33861847f8eSopenharmony_ci  /**
33961847f8eSopenharmony_ci   * The enum of bluetooth state.
34061847f8eSopenharmony_ci   *
34161847f8eSopenharmony_ci   * @enum { number }
34261847f8eSopenharmony_ci   * @syscap SystemCapability.Communication.Bluetooth.Core
34361847f8eSopenharmony_ci   * @crossplatform
34461847f8eSopenharmony_ci   * @atomicservice
34561847f8eSopenharmony_ci   * @since 13
34661847f8eSopenharmony_ci   */
34761847f8eSopenharmony_ci  export enum BluetoothState {
34861847f8eSopenharmony_ci    /**
34961847f8eSopenharmony_ci     * Indicates the local Bluetooth is off
35061847f8eSopenharmony_ci     *
35161847f8eSopenharmony_ci     * @syscap SystemCapability.Communication.Bluetooth.Core
35261847f8eSopenharmony_ci     * @since 10
35361847f8eSopenharmony_ci     */
35461847f8eSopenharmony_ci    /**
35561847f8eSopenharmony_ci     * Indicates the local Bluetooth is off
35661847f8eSopenharmony_ci     *
35761847f8eSopenharmony_ci     * @syscap SystemCapability.Communication.Bluetooth.Core
35861847f8eSopenharmony_ci     * @atomicservice
35961847f8eSopenharmony_ci     * @since 11
36061847f8eSopenharmony_ci     */
36161847f8eSopenharmony_ci    /**
36261847f8eSopenharmony_ci     * Indicates the local Bluetooth is off
36361847f8eSopenharmony_ci     *
36461847f8eSopenharmony_ci     * @syscap SystemCapability.Communication.Bluetooth.Core
36561847f8eSopenharmony_ci     * @crossplatform
36661847f8eSopenharmony_ci     * @atomicservice
36761847f8eSopenharmony_ci     * @since 13
36861847f8eSopenharmony_ci     */
36961847f8eSopenharmony_ci    STATE_OFF = 0,
37061847f8eSopenharmony_ci    /**
37161847f8eSopenharmony_ci     * Indicates the local Bluetooth is turning on
37261847f8eSopenharmony_ci     *
37361847f8eSopenharmony_ci     * @syscap SystemCapability.Communication.Bluetooth.Core
37461847f8eSopenharmony_ci     * @since 10
37561847f8eSopenharmony_ci     */
37661847f8eSopenharmony_ci    /**
37761847f8eSopenharmony_ci     * Indicates the local Bluetooth is turning on
37861847f8eSopenharmony_ci     *
37961847f8eSopenharmony_ci     * @syscap SystemCapability.Communication.Bluetooth.Core
38061847f8eSopenharmony_ci     * @atomicservice
38161847f8eSopenharmony_ci     * @since 11
38261847f8eSopenharmony_ci     */
38361847f8eSopenharmony_ci    /**
38461847f8eSopenharmony_ci     * Indicates the local Bluetooth is turning on
38561847f8eSopenharmony_ci     *
38661847f8eSopenharmony_ci     * @syscap SystemCapability.Communication.Bluetooth.Core
38761847f8eSopenharmony_ci     * @crossplatform
38861847f8eSopenharmony_ci     * @atomicservice
38961847f8eSopenharmony_ci     * @since 13
39061847f8eSopenharmony_ci     */
39161847f8eSopenharmony_ci    STATE_TURNING_ON = 1,
39261847f8eSopenharmony_ci    /**
39361847f8eSopenharmony_ci     * Indicates the local Bluetooth is on, and ready for use
39461847f8eSopenharmony_ci     *
39561847f8eSopenharmony_ci     * @syscap SystemCapability.Communication.Bluetooth.Core
39661847f8eSopenharmony_ci     * @since 10
39761847f8eSopenharmony_ci     */
39861847f8eSopenharmony_ci    /**
39961847f8eSopenharmony_ci     * Indicates the local Bluetooth is on, and ready for use
40061847f8eSopenharmony_ci     *
40161847f8eSopenharmony_ci     * @syscap SystemCapability.Communication.Bluetooth.Core
40261847f8eSopenharmony_ci     * @atomicservice
40361847f8eSopenharmony_ci     * @since 11
40461847f8eSopenharmony_ci     */
40561847f8eSopenharmony_ci    /**
40661847f8eSopenharmony_ci     * Indicates the local Bluetooth is on, and ready for use
40761847f8eSopenharmony_ci     *
40861847f8eSopenharmony_ci     * @syscap SystemCapability.Communication.Bluetooth.Core
40961847f8eSopenharmony_ci     * @crossplatform
41061847f8eSopenharmony_ci     * @atomicservice
41161847f8eSopenharmony_ci     * @since 13
41261847f8eSopenharmony_ci     */
41361847f8eSopenharmony_ci    STATE_ON = 2,
41461847f8eSopenharmony_ci    /**
41561847f8eSopenharmony_ci     * Indicates the local Bluetooth is turning off
41661847f8eSopenharmony_ci     *
41761847f8eSopenharmony_ci     * @syscap SystemCapability.Communication.Bluetooth.Core
41861847f8eSopenharmony_ci     * @since 10
41961847f8eSopenharmony_ci     */
42061847f8eSopenharmony_ci    /**
42161847f8eSopenharmony_ci     * Indicates the local Bluetooth is turning off
42261847f8eSopenharmony_ci     *
42361847f8eSopenharmony_ci     * @syscap SystemCapability.Communication.Bluetooth.Core
42461847f8eSopenharmony_ci     * @atomicservice
42561847f8eSopenharmony_ci     * @since 11
42661847f8eSopenharmony_ci     */
42761847f8eSopenharmony_ci    /**
42861847f8eSopenharmony_ci     * Indicates the local Bluetooth is turning off
42961847f8eSopenharmony_ci     *
43061847f8eSopenharmony_ci     * @syscap SystemCapability.Communication.Bluetooth.Core
43161847f8eSopenharmony_ci     * @crossplatform
43261847f8eSopenharmony_ci     * @atomicservice
43361847f8eSopenharmony_ci     * @since 13
43461847f8eSopenharmony_ci     */
43561847f8eSopenharmony_ci    STATE_TURNING_OFF = 3,
43661847f8eSopenharmony_ci    /**
43761847f8eSopenharmony_ci     * Indicates the local Bluetooth is turning LE mode on
43861847f8eSopenharmony_ci     *
43961847f8eSopenharmony_ci     * @syscap SystemCapability.Communication.Bluetooth.Core
44061847f8eSopenharmony_ci     * @since 10
44161847f8eSopenharmony_ci     */
44261847f8eSopenharmony_ci    /**
44361847f8eSopenharmony_ci     * Indicates the local Bluetooth is turning LE mode on
44461847f8eSopenharmony_ci     *
44561847f8eSopenharmony_ci     * @syscap SystemCapability.Communication.Bluetooth.Core
44661847f8eSopenharmony_ci     * @atomicservice
44761847f8eSopenharmony_ci     * @since 11
44861847f8eSopenharmony_ci     */
44961847f8eSopenharmony_ci    STATE_BLE_TURNING_ON = 4,
45061847f8eSopenharmony_ci    /**
45161847f8eSopenharmony_ci     * Indicates the local Bluetooth is in LE only mode
45261847f8eSopenharmony_ci     *
45361847f8eSopenharmony_ci     * @syscap SystemCapability.Communication.Bluetooth.Core
45461847f8eSopenharmony_ci     * @since 10
45561847f8eSopenharmony_ci     */
45661847f8eSopenharmony_ci    /**
45761847f8eSopenharmony_ci     * Indicates the local Bluetooth is in LE only mode
45861847f8eSopenharmony_ci     *
45961847f8eSopenharmony_ci     * @syscap SystemCapability.Communication.Bluetooth.Core
46061847f8eSopenharmony_ci     * @atomicservice
46161847f8eSopenharmony_ci     * @since 11
46261847f8eSopenharmony_ci     */
46361847f8eSopenharmony_ci    STATE_BLE_ON = 5,
46461847f8eSopenharmony_ci    /**
46561847f8eSopenharmony_ci     * Indicates the local Bluetooth is turning off LE only mode
46661847f8eSopenharmony_ci     *
46761847f8eSopenharmony_ci     * @syscap SystemCapability.Communication.Bluetooth.Core
46861847f8eSopenharmony_ci     * @since 10
46961847f8eSopenharmony_ci     */
47061847f8eSopenharmony_ci    /**
47161847f8eSopenharmony_ci     * Indicates the local Bluetooth is turning off LE only mode
47261847f8eSopenharmony_ci     *
47361847f8eSopenharmony_ci     * @syscap SystemCapability.Communication.Bluetooth.Core
47461847f8eSopenharmony_ci     * @atomicservice
47561847f8eSopenharmony_ci     * @since 11
47661847f8eSopenharmony_ci     */
47761847f8eSopenharmony_ci    STATE_BLE_TURNING_OFF = 6
47861847f8eSopenharmony_ci  }
47961847f8eSopenharmony_ci}
48061847f8eSopenharmony_ci
48161847f8eSopenharmony_ciexport default access;