• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1/*
2 * Copyright (C) 2023-2024 Huawei Device Co., Ltd.
3 * Licensed under the Apache License, Version 2.0 (the "License");
4 * you may not use this file except in compliance with the License.
5 * You may obtain a copy of the License at
6 *
7 *     http://www.apache.org/licenses/LICENSE-2.0
8 *
9 * Unless required by applicable law or agreed to in writing, software
10 * distributed under the License is distributed on an "AS IS" BASIS,
11 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12 * See the License for the specific language governing permissions and
13 * limitations under the License.
14 */
15
16/**
17 * @file
18 * @kit ConnectivityKit
19 */
20
21import type { AsyncCallback, Callback } from './@ohos.base';
22
23/**
24 * Provides methods for enabling/disabling bluetooth or monitoring bluetooth state.
25 *
26 * @namespace access
27 * @syscap SystemCapability.Communication.Bluetooth.Core
28 * @since 10
29 */
30/**
31 * Provides methods for enabling/disabling bluetooth or monitoring bluetooth state.
32 *
33 * @namespace access
34 * @syscap SystemCapability.Communication.Bluetooth.Core
35 * @atomicservice
36 * @since 11
37 */
38/**
39 * Provides methods for enabling/disabling bluetooth or monitoring bluetooth state.
40 *
41 * @namespace access
42 * @syscap SystemCapability.Communication.Bluetooth.Core
43 * @crossplatform
44 * @atomicservice
45 * @since arkts {'1.1':'13','1.2':'20'}
46 * @arkts 1.1&1.2
47 */
48declare namespace access {
49  /**
50   * Enables Bluetooth on a device.
51   *
52   * @permission ohos.permission.ACCESS_BLUETOOTH
53   * @throws { BusinessError } 201 - Permission denied.
54   * @throws { BusinessError } 801 - Capability not supported.
55   * @throws { BusinessError } 2900001 - Service stopped.
56   * @throws { BusinessError } 2900099 - Operation failed.
57   * @syscap SystemCapability.Communication.Bluetooth.Core
58   * @since 10
59   */
60  /**
61   * Enables Bluetooth on a device.
62   *
63   * @permission ohos.permission.ACCESS_BLUETOOTH
64   * @throws { BusinessError } 201 - Permission denied.
65   * @throws { BusinessError } 801 - Capability not supported.
66   * @throws { BusinessError } 2900001 - Service stopped.
67   * @throws { BusinessError } 2900099 - Operation failed.
68   * @syscap SystemCapability.Communication.Bluetooth.Core
69   * @atomicservice
70   * @since 12
71   */
72  /**
73   * Enables Bluetooth on a device.
74   *
75   * @permission ohos.permission.ACCESS_BLUETOOTH
76   * @throws { BusinessError } 201 - Permission denied.
77   * @throws { BusinessError } 801 - Capability not supported.
78   * @throws { BusinessError } 2900001 - Service stopped.
79   * @throws { BusinessError } 2900099 - Operation failed.
80   * @syscap SystemCapability.Communication.Bluetooth.Core
81   * @crossplatform
82   * @atomicservice
83   * @since arkts {'1.1':'13','1.2':'20'}
84   * @arkts 1.1&1.2
85   */
86  function enableBluetooth(): void;
87
88  /**
89   * Disables Bluetooth on a device.
90   *
91   * @permission ohos.permission.ACCESS_BLUETOOTH
92   * @throws { BusinessError } 201 - Permission denied.
93   * @throws { BusinessError } 801 - Capability not supported.
94   * @throws { BusinessError } 2900001 - Service stopped.
95   * @throws { BusinessError } 2900099 - Operation failed.
96   * @syscap SystemCapability.Communication.Bluetooth.Core
97   * @since 10
98   */
99  /**
100   * Disables Bluetooth on a device.
101   *
102   * @permission ohos.permission.ACCESS_BLUETOOTH
103   * @throws { BusinessError } 201 - Permission denied.
104   * @throws { BusinessError } 801 - Capability not supported.
105   * @throws { BusinessError } 2900001 - Service stopped.
106   * @throws { BusinessError } 2900099 - Operation failed.
107   * @syscap SystemCapability.Communication.Bluetooth.Core
108   * @atomicservice
109   * @since 12
110   */
111  /**
112   * Disables Bluetooth on a device.
113   *
114   * @permission ohos.permission.ACCESS_BLUETOOTH
115   * @throws { BusinessError } 201 - Permission denied.
116   * @throws { BusinessError } 801 - Capability not supported.
117   * @throws { BusinessError } 2900001 - Service stopped.
118   * @throws { BusinessError } 2900099 - Operation failed.
119   * @syscap SystemCapability.Communication.Bluetooth.Core
120   * @crossplatform
121   * @atomicservice
122   * @since arkts {'1.1':'13','1.2':'20'}
123   * @arkts 1.1&1.2
124   */
125  function disableBluetooth(): void;
126
127  /**
128   * Asynchronous interface for enables Bluetooth on a device.
129   *
130   * @permission ohos.permission.ACCESS_BLUETOOTH
131   * @returns { Promise<void> } Returns the promise object.
132   * @throws { BusinessError } 201 - Permission denied.
133   * @throws { BusinessError } 801 - Capability not supported.
134   * @throws { BusinessError } 2900001 - Service stopped.
135   * @throws { BusinessError } 2900013 - The user does not respond.
136   * @throws { BusinessError } 2900014 - User refuse the action.
137   * @throws { BusinessError } 2900099 - Operation failed.
138   * @syscap SystemCapability.Communication.Bluetooth.Core
139   * @crossplatform
140   * @atomicservice
141   * @since 20
142   */
143  function enableBluetoothAsync(): Promise<void>;
144
145  /**
146   * Asynchronous interface for disables Bluetooth on a device.
147   *
148   * @permission ohos.permission.ACCESS_BLUETOOTH
149   * @returns { Promise<void> } Returns the promise object.
150   * @throws { BusinessError } 201 - Permission denied.
151   * @throws { BusinessError } 801 - Capability not supported.
152   * @throws { BusinessError } 2900001 - Service stopped.
153   * @throws { BusinessError } 2900013 - The user does not respond.
154   * @throws { BusinessError } 2900014 - User refuse the action.
155   * @throws { BusinessError } 2900099 - Operation failed.
156   * @syscap SystemCapability.Communication.Bluetooth.Core
157   * @crossplatform
158   * @atomicservice
159   * @since 20
160   */
161  function disableBluetoothAsync(): Promise<void>;
162
163  /**
164   * Notify bluetooth the result of bluetooth dialog.
165   *
166   * @permission ohos.permission.ACCESS_BLUETOOTH and ohos.permission.MANAGE_BLUETOOTH
167   * @param { NotifyDialogResultParams } notifyDialogResultParams - Indicates the params for dialog result.
168   * @returns { Promise<void> } Returns the promise object.
169   * @throws { BusinessError } 201 - Permission denied.
170   * @throws { BusinessError } 202 - Non-system applications are not allowed to use system APIs.
171   * @throws { BusinessError } 801 - Capability not supported.
172   * @throws { BusinessError } 2900001 - Service stopped.
173   * @throws { BusinessError } 2900099 - Operation failed.
174   * @syscap SystemCapability.Communication.Bluetooth.Core
175   * @systemapi
176   * @since 20
177   */
178  function notifyDialogResult(notifyDialogResultParams: NotifyDialogResultParams): Promise<void>;
179
180  /**
181   * Restrict Bluetooth BR/EDR ability on a device.
182   *
183   * @permission ohos.permission.ACCESS_BLUETOOTH and ohos.permission.MANAGE_BLUETOOTH
184   * @returns { Promise<void> } Promise that returns no value.
185   * @throws { BusinessError } 201 - Permission denied.
186   * @throws { BusinessError } 202 - Non-system applications are not allowed to use system APIs.
187   * @throws { BusinessError } 801 - Capability not supported.
188   * @throws { BusinessError } 2900001 - Service stopped.
189   * @throws { BusinessError } 2900099 - Operation failed.
190   * @syscap SystemCapability.Communication.Bluetooth.Core
191   * @systemapi
192   * @since arkts {'1.1':'12','1.2':'20'}
193   * @arkts 1.1&1.2
194   */
195  function restrictBluetooth(): Promise<void>;
196
197  /**
198   * Obtains the Bluetooth status of a device.
199   *
200   * @permission ohos.permission.ACCESS_BLUETOOTH
201   * @returns { BluetoothState } Returns the Bluetooth status.
202   * @throws { BusinessError } 201 - Permission denied.
203   * @throws { BusinessError } 801 - Capability not supported.
204   * @throws { BusinessError } 2900001 - Service stopped.
205   * @throws { BusinessError } 2900099 - Operation failed.
206   * @syscap SystemCapability.Communication.Bluetooth.Core
207   * @since 10
208   */
209  /**
210   * Obtains the Bluetooth status of a device.
211   *
212   * @permission ohos.permission.ACCESS_BLUETOOTH
213   * @returns { BluetoothState } Returns the Bluetooth status.
214   * @throws { BusinessError } 201 - Permission denied.
215   * @throws { BusinessError } 801 - Capability not supported.
216   * @throws { BusinessError } 2900001 - Service stopped.
217   * @throws { BusinessError } 2900099 - Operation failed.
218   * @syscap SystemCapability.Communication.Bluetooth.Core
219   * @atomicservice
220   * @since 11
221   */
222  /**
223   * Obtains the Bluetooth status of a device.
224   *
225   * @returns { BluetoothState } Returns the Bluetooth status.
226   * @throws { BusinessError } 801 - Capability not supported.
227   * @throws { BusinessError } 2900001 - Service stopped.
228   * @throws { BusinessError } 2900099 - Operation failed.
229   * @syscap SystemCapability.Communication.Bluetooth.Core
230   * @crossplatform
231   * @atomicservice
232   * @since arkts {'1.1':'13','1.2':'20'}
233   * @arkts 1.1&1.2
234   */
235  function getState(): BluetoothState;
236
237  /**
238   * Restoring bluetooth settings.
239   *
240   * @permission ohos.permission.ACCESS_BLUETOOTH and ohos.permission.MANAGE_BLUETOOTH
241   * @param { AsyncCallback<void> } callback - Callback used to return the result.
242   * @throws { BusinessError } 201 - Permission denied.
243   * @throws { BusinessError } 202 - Non-system applications are not allowed to use system APIs.
244   * @throws { BusinessError } 401 - Invalid parameter. Possible causes: 1. Mandatory parameters are left unspecified.
245   * <br>2. Incorrect parameter types.
246   * @throws { BusinessError } 801 - Capability not supported.
247   * @throws { BusinessError } 2900001 - Service stopped.
248   * @throws { BusinessError } 2900099 - Operation failed.
249   * @syscap SystemCapability.Communication.Bluetooth.Core
250   * @systemapi
251   * @since 11
252   */
253  function factoryReset(callback: AsyncCallback<void>): void;
254
255  /**
256   * Restoring bluetooth settings.
257   *
258   * @permission ohos.permission.ACCESS_BLUETOOTH and ohos.permission.MANAGE_BLUETOOTH
259   * @returns { Promise<void> } Promise that returns no value.
260   * @throws { BusinessError } 201 - Permission denied.
261   * @throws { BusinessError } 202 - Non-system applications are not allowed to use system APIs.
262   * @throws { BusinessError } 801 - Capability not supported.
263   * @throws { BusinessError } 2900001 - Service stopped.
264   * @throws { BusinessError } 2900099 - Operation failed.
265   * @syscap SystemCapability.Communication.Bluetooth.Core
266   * @systemapi
267   * @since 11
268   */
269  function factoryReset(): Promise<void>;
270
271  /**
272   * Obtaining the MAC address of the local device.
273   *
274   * @permission ohos.permission.ACCESS_BLUETOOTH and ohos.permission.GET_BLUETOOTH_LOCAL_MAC
275   * @returns { string } The local MAC address. For example, "11:22:33:AA:BB:FF".
276   * @throws { BusinessError } 201 - Permission denied.
277   * @throws { BusinessError } 202 - Non-system applications are not allowed to use system APIs.
278   * @throws { BusinessError } 801 - Capability not supported.
279   * @throws { BusinessError } 2900001 - Service stopped.
280   * @throws { BusinessError } 2900099 - Operation failed.
281   * @syscap SystemCapability.Communication.Bluetooth.Core
282   * @systemapi
283   * @since 11
284   */
285  function getLocalAddress(): string;
286
287  /**
288   * Subscribe the event reported when the Bluetooth state changes.
289   *
290   * @permission ohos.permission.ACCESS_BLUETOOTH
291   * @param { 'stateChange' } type - Type of the Bluetooth state changes event to listen for.
292   * @param { Callback<BluetoothState> } callback - Callback used to listen for the Bluetooth state event.
293   * @throws { BusinessError } 201 - Permission denied.
294   * @throws { BusinessError } 401 - Invalid parameter. Possible causes: 1. Mandatory parameters are left unspecified.
295   * <br>2. Incorrect parameter types. 3. Parameter verification failed.
296   * @throws { BusinessError } 801 - Capability not supported.
297   * @throws { BusinessError } 2900099 - Operation failed.
298   * @syscap SystemCapability.Communication.Bluetooth.Core
299   * @since 10
300   */
301  /**
302   * Subscribe the event reported when the Bluetooth state changes.
303   *
304   * @permission ohos.permission.ACCESS_BLUETOOTH
305   * @param { 'stateChange' } type - Type of the Bluetooth state changes event to listen for.
306   * @param { Callback<BluetoothState> } callback - Callback used to listen for the Bluetooth state event.
307   * @throws { BusinessError } 201 - Permission denied.
308   * @throws { BusinessError } 401 - Invalid parameter. Possible causes: 1. Mandatory parameters are left unspecified.
309   * <br>2. Incorrect parameter types. 3. Parameter verification failed.
310   * @throws { BusinessError } 801 - Capability not supported.
311   * @throws { BusinessError } 2900099 - Operation failed.
312   * @syscap SystemCapability.Communication.Bluetooth.Core
313   * @atomicservice
314   * @since 12
315   */
316  /**
317   * Subscribe the event reported when the Bluetooth state changes.
318   *
319   * @permission ohos.permission.ACCESS_BLUETOOTH
320   * @param { 'stateChange' } type - Type of the Bluetooth state changes event to listen for.
321   * @param { Callback<BluetoothState> } callback - Callback used to listen for the Bluetooth state event.
322   * @throws { BusinessError } 201 - Permission denied.
323   * @throws { BusinessError } 401 - Invalid parameter. Possible causes: 1. Mandatory parameters are left unspecified.
324   * <br>2. Incorrect parameter types. 3. Parameter verification failed.
325   * @throws { BusinessError } 801 - Capability not supported.
326   * @throws { BusinessError } 2900099 - Operation failed.
327   * @syscap SystemCapability.Communication.Bluetooth.Core
328   * @crossplatform
329   * @atomicservice
330   * @since 13
331   */
332  /**
333   * Subscribe the event reported when the Bluetooth state changes.
334   *
335   * @param { 'stateChange' } type - Type of the Bluetooth state changes event to listen for.
336   * @param { Callback<BluetoothState> } callback - Callback used to listen for the Bluetooth state event.
337   * @throws { BusinessError } 401 - Invalid parameter. Possible causes: 1. Mandatory parameters are left unspecified.
338   * <br>2. Incorrect parameter types. 3. Parameter verification failed.
339   * @throws { BusinessError } 801 - Capability not supported.
340   * @throws { BusinessError } 2900099 - Operation failed.
341   * @syscap SystemCapability.Communication.Bluetooth.Core
342   * @crossplatform
343   * @atomicservice
344   * @since 18
345   */
346  function on(type: 'stateChange', callback: Callback<BluetoothState>): void;
347
348  /**
349   * Unsubscribe the event reported when the Bluetooth state changes.
350   *
351   * @permission ohos.permission.ACCESS_BLUETOOTH
352   * @param { 'stateChange' } type - Type of the Bluetooth state changes event to listen for.
353   * @param { Callback<BluetoothState> } callback - Callback used to listen for the Bluetooth state event.
354   * @throws { BusinessError } 201 - Permission denied.
355   * @throws { BusinessError } 401 - Invalid parameter. Possible causes: 1. Mandatory parameters are left unspecified.
356   * <br>2. Incorrect parameter types. 3. Parameter verification failed.
357   * @throws { BusinessError } 801 - Capability not supported.
358   * @throws { BusinessError } 2900099 - Operation failed.
359   * @syscap SystemCapability.Communication.Bluetooth.Core
360   * @since 10
361   */
362  /**
363   * Unsubscribe the event reported when the Bluetooth state changes.
364   *
365   * @permission ohos.permission.ACCESS_BLUETOOTH
366   * @param { 'stateChange' } type - Type of the Bluetooth state changes event to listen for.
367   * @param { Callback<BluetoothState> } callback - Callback used to listen for the Bluetooth state event.
368   * @throws { BusinessError } 201 - Permission denied.
369   * @throws { BusinessError } 401 - Invalid parameter. Possible causes: 1. Mandatory parameters are left unspecified.
370   * <br>2. Incorrect parameter types. 3. Parameter verification failed.
371   * @throws { BusinessError } 801 - Capability not supported.
372   * @throws { BusinessError } 2900099 - Operation failed.
373   * @syscap SystemCapability.Communication.Bluetooth.Core
374   * @atomicservice
375   * @since 12
376   */
377  /**
378   * Unsubscribe the event reported when the Bluetooth state changes.
379   *
380   * @permission ohos.permission.ACCESS_BLUETOOTH
381   * @param { 'stateChange' } type - Type of the Bluetooth state changes event to listen for.
382   * @param { Callback<BluetoothState> } callback - Callback used to listen for the Bluetooth state event.
383   * @throws { BusinessError } 201 - Permission denied.
384   * @throws { BusinessError } 401 - Invalid parameter. Possible causes: 1. Mandatory parameters are left unspecified.
385   * <br>2. Incorrect parameter types. 3. Parameter verification failed.
386   * @throws { BusinessError } 801 - Capability not supported.
387   * @throws { BusinessError } 2900099 - Operation failed.
388   * @syscap SystemCapability.Communication.Bluetooth.Core
389   * @crossplatform
390   * @atomicservice
391   * @since 13
392   */
393  /**
394   * Unsubscribe the event reported when the Bluetooth state changes.
395   *
396   * @param { 'stateChange' } type - Type of the Bluetooth state changes event to listen for.
397   * @param { Callback<BluetoothState> } callback - Callback used to listen for the Bluetooth state event.
398   * @throws { BusinessError } 401 - Invalid parameter. Possible causes: 1. Mandatory parameters are left unspecified.
399   * <br>2. Incorrect parameter types. 3. Parameter verification failed.
400   * @throws { BusinessError } 801 - Capability not supported.
401   * @throws { BusinessError } 2900099 - Operation failed.
402   * @syscap SystemCapability.Communication.Bluetooth.Core
403   * @crossplatform
404   * @atomicservice
405   * @since 18
406   */
407  function off(type: 'stateChange', callback?: Callback<BluetoothState>): void;
408
409  /**
410   * Add a persistent random device address. Once the randomized address is successfully added,
411   * the application can save it for an extended period of time.
412   *
413   * @permission ohos.permission.ACCESS_BLUETOOTH and ohos.permission.PERSISTENT_BLUETOOTH_PEERS_MAC
414   * @param { string } deviceId - the randomized address of remote device.
415   * @returns { Promise<void> } Returns the promise object.
416   * @throws { BusinessError } 201 - Permission denied.
417   * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified.
418   * 2. Incorrect parameter types. 3. Parameter verification failed.
419   * @throws { BusinessError } 801 - Capability not supported.
420   * @throws { BusinessError } 2900003 - Bluetooth disabled.
421   * @throws { BusinessError } 2900010 - The number of supported device addresses has reached the upper limit.
422   * @throws { BusinessError } 2900099 - Add persistent device address failed.
423   * @syscap SystemCapability.Communication.Bluetooth.Core
424   * @atomicservice
425   * @since 16
426   */
427  function addPersistentDeviceId(deviceId: string): Promise<void>;
428
429  /**
430   * Delete a persistent random device address.
431   *
432   * @permission ohos.permission.ACCESS_BLUETOOTH and ohos.permission.PERSISTENT_BLUETOOTH_PEERS_MAC
433   * @param { string } deviceId - the randomized address of remote device.
434   * @returns { Promise<void> } Returns the promise object.
435   * @throws { BusinessError } 201 - Permission denied.
436   * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified.
437   * 2. Incorrect parameter types. 3. Parameter verification failed.
438   * @throws { BusinessError } 801 - Capability not supported.
439   * @throws { BusinessError } 2900003 - Bluetooth disabled.
440   * @throws { BusinessError } 2900099 - delete persistent device address failed.
441   * @syscap SystemCapability.Communication.Bluetooth.Core
442   * @atomicservice
443   * @since 16
444   */
445  function deletePersistentDeviceId(deviceId: string): Promise<void>;
446
447  /**
448   * Obtains the persistent randomized device address of the application.
449   *
450   * @permission ohos.permission.ACCESS_BLUETOOTH and ohos.permission.PERSISTENT_BLUETOOTH_PEERS_MAC
451   * @returns { string[] } Returns the list of persistent random device addresses.
452   * @throws { BusinessError } 201 - Permission denied.
453   * @throws { BusinessError } 801 - Capability not supported.
454   * @throws { BusinessError } 2900003 - Bluetooth disabled.
455   * @throws { BusinessError } 2900099 - Get persistent device address failed.
456   * @syscap SystemCapability.Communication.Bluetooth.Core
457   * @atomicservice
458   * @since 16
459   */
460  function getPersistentDeviceIds(): string[];
461
462  /**
463   * Determine whether the randomized device address application can still be used.
464   *
465   * @permission ohos.permission.ACCESS_BLUETOOTH
466   * @param { string } deviceId - the randomized address of remote device.
467   * @returns { boolean } Returns whether the randomized device address is valid.
468   * @throws { BusinessError } 201 - Permission denied.
469   * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified.
470   * 2. Incorrect parameter types. 3. Parameter verification failed.
471   * @throws { BusinessError } 801 - Capability not supported.
472   * @throws { BusinessError } 2900003 - Bluetooth disabled.
473   * @throws { BusinessError } 2900099 - Check persistent device address failed.
474   * @syscap SystemCapability.Communication.Bluetooth.Core
475   * @atomicservice
476   * @since 16
477   */
478  function isValidRandomDeviceId(deviceId: string): boolean;
479
480  /**
481   * The enum of bluetooth state.
482   *
483   * @enum { number }
484   * @syscap SystemCapability.Communication.Bluetooth.Core
485   * @since 10
486   */
487  /**
488   * The enum of bluetooth state.
489   *
490   * @enum { number }
491   * @syscap SystemCapability.Communication.Bluetooth.Core
492   * @atomicservice
493   * @since 11
494   */
495  /**
496   * The enum of bluetooth state.
497   *
498   * @enum { number }
499   * @syscap SystemCapability.Communication.Bluetooth.Core
500   * @crossplatform
501   * @atomicservice
502   * @since arkts {'1.1':'13','1.2':'20'}
503   * @arkts 1.1&1.2
504   */
505  export enum BluetoothState {
506    /**
507     * Indicates the local Bluetooth is off
508     *
509     * @syscap SystemCapability.Communication.Bluetooth.Core
510     * @since 10
511     */
512    /**
513     * Indicates the local Bluetooth is off
514     *
515     * @syscap SystemCapability.Communication.Bluetooth.Core
516     * @atomicservice
517     * @since 11
518     */
519    /**
520     * Indicates the local Bluetooth is off
521     *
522     * @syscap SystemCapability.Communication.Bluetooth.Core
523     * @crossplatform
524     * @atomicservice
525     * @since arkts {'1.1':'13','1.2':'20'}
526     * @arkts 1.1&1.2
527     */
528    STATE_OFF = 0,
529    /**
530     * Indicates the local Bluetooth is turning on
531     *
532     * @syscap SystemCapability.Communication.Bluetooth.Core
533     * @since 10
534     */
535    /**
536     * Indicates the local Bluetooth is turning on
537     *
538     * @syscap SystemCapability.Communication.Bluetooth.Core
539     * @atomicservice
540     * @since 11
541     */
542    /**
543     * Indicates the local Bluetooth is turning on
544     *
545     * @syscap SystemCapability.Communication.Bluetooth.Core
546     * @crossplatform
547     * @atomicservice
548     * @since arkts {'1.1':'13','1.2':'20'}
549     * @arkts 1.1&1.2
550     */
551    STATE_TURNING_ON = 1,
552    /**
553     * Indicates the local Bluetooth is on, and ready for use
554     *
555     * @syscap SystemCapability.Communication.Bluetooth.Core
556     * @since 10
557     */
558    /**
559     * Indicates the local Bluetooth is on, and ready for use
560     *
561     * @syscap SystemCapability.Communication.Bluetooth.Core
562     * @atomicservice
563     * @since 11
564     */
565    /**
566     * Indicates the local Bluetooth is on, and ready for use
567     *
568     * @syscap SystemCapability.Communication.Bluetooth.Core
569     * @crossplatform
570     * @atomicservice
571     * @since arkts {'1.1':'13','1.2':'20'}
572     * @arkts 1.1&1.2
573     */
574    STATE_ON = 2,
575    /**
576     * Indicates the local Bluetooth is turning off
577     *
578     * @syscap SystemCapability.Communication.Bluetooth.Core
579     * @since 10
580     */
581    /**
582     * Indicates the local Bluetooth is turning off
583     *
584     * @syscap SystemCapability.Communication.Bluetooth.Core
585     * @atomicservice
586     * @since 11
587     */
588    /**
589     * Indicates the local Bluetooth is turning off
590     *
591     * @syscap SystemCapability.Communication.Bluetooth.Core
592     * @crossplatform
593     * @atomicservice
594     * @since arkts {'1.1':'13','1.2':'20'}
595     * @arkts 1.1&1.2
596     */
597    STATE_TURNING_OFF = 3,
598    /**
599     * Indicates the local Bluetooth is turning LE mode on
600     *
601     * @syscap SystemCapability.Communication.Bluetooth.Core
602     * @since 10
603     */
604    /**
605     * Indicates the local Bluetooth is turning LE mode on
606     *
607     * @syscap SystemCapability.Communication.Bluetooth.Core
608     * @atomicservice
609     * @since arkts {'1.1':'11','1.2':'20'}
610     * @arkts 1.1&1.2
611     */
612    STATE_BLE_TURNING_ON = 4,
613    /**
614     * Indicates the local Bluetooth is in LE only mode
615     *
616     * @syscap SystemCapability.Communication.Bluetooth.Core
617     * @since 10
618     */
619    /**
620     * Indicates the local Bluetooth is in LE only mode
621     *
622     * @syscap SystemCapability.Communication.Bluetooth.Core
623     * @atomicservice
624     * @since arkts {'1.1':'11','1.2':'20'}
625     * @arkts 1.1&1.2
626     */
627    STATE_BLE_ON = 5,
628    /**
629     * Indicates the local Bluetooth is turning off LE only mode
630     *
631     * @syscap SystemCapability.Communication.Bluetooth.Core
632     * @since 10
633     */
634    /**
635     * Indicates the local Bluetooth is turning off LE only mode
636     *
637     * @syscap SystemCapability.Communication.Bluetooth.Core
638     * @atomicservice
639     * @since arkts {'1.1':'11','1.2':'20'}
640     * @arkts 1.1&1.2
641     */
642    STATE_BLE_TURNING_OFF = 6
643  }
644
645  /**
646   * Describes the result of bluetooth dialog.
647   *
648   * @typedef NotifyDialogResultParams
649   * @syscap SystemCapability.Communication.Bluetooth.Core
650   * @systemapi
651   * @since 20
652   */
653  interface NotifyDialogResultParams {
654    /**
655     * The type of bluetooth dialog.
656     *
657     * @type { DialogType }
658     * @syscap SystemCapability.Communication.Bluetooth.Core
659     * @systemapi
660     * @since 20
661     */
662    dialogType: DialogType;
663    /**
664     * The result of bluetooth dialog. The value true indicates that the user approves the request,
665     * and the value false indicates that the user rejects the request.
666     *
667     * @type { boolean }
668     * @syscap SystemCapability.Communication.Bluetooth.Core
669     * @systemapi
670     * @since 20
671     */
672    dialogResult: boolean;
673  }
674
675  /**
676   * The enum of bluetooth dialog type.
677   *
678   * @enum { number }
679   * @syscap SystemCapability.Communication.Bluetooth.Core
680   * @systemapi
681   * @since 20
682   */
683  enum DialogType {
684    /**
685     * The type of bluetooth switch dialog.
686     *
687     * @syscap SystemCapability.Communication.Bluetooth.Core
688     * @systemapi
689     * @since 20
690     */
691    BLUETOOTH_SWITCH = 0
692  }
693}
694
695export default access;