• 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 } from './@ohos.base';
22import type baseProfile from './@ohos.bluetooth.baseProfile';
23
24/**
25 * Provides methods to accessing bluetooth audio related capabilities.
26 *
27 * @namespace a2dp
28 * @syscap SystemCapability.Communication.Bluetooth.Core
29 * @since 10
30 */
31/**
32 * Provides methods to accessing bluetooth audio related capabilities.
33 *
34 * @namespace a2dp
35 * @syscap SystemCapability.Communication.Bluetooth.Core
36 * @crossplatform
37 * @since 13
38 */
39declare namespace a2dp {
40  /**
41   * Base interface of profile.
42   *
43   * @typedef { baseProfile.BaseProfile } BaseProfile
44   * @syscap SystemCapability.Communication.Bluetooth.Core
45   * @since 10
46   */
47  type BaseProfile = baseProfile.BaseProfile;
48
49  /**
50   * create the instance of a2dp profile.
51   *
52   * @returns { A2dpSourceProfile } Returns the instance of profile.
53   * @throws { BusinessError } 401 - Invalid parameter.Possible causes: 1. Mandatory parameters are left unspecified.
54   * <br>2. Incorrect parameter types. 3. Parameter verification failed.
55   * @throws { BusinessError } 801 - Capability not supported.
56   * @syscap SystemCapability.Communication.Bluetooth.Core
57   * @since 10
58   */
59  /**
60   * create the instance of a2dp profile.
61   *
62   * @returns { A2dpSourceProfile } Returns the instance of profile.
63   * @throws { BusinessError } 401 - Invalid parameter.Possible causes: 1. Mandatory parameters are left unspecified.
64   * <br>2. Incorrect parameter types. 3. Parameter verification failed.
65   * @throws { BusinessError } 801 - Capability not supported.
66   * @syscap SystemCapability.Communication.Bluetooth.Core
67   * @crossplatform
68   * @since 13
69   */
70  function createA2dpSrcProfile(): A2dpSourceProfile;
71
72  /**
73   * Manager a2dp source profile.
74   *
75   * @typedef A2dpSourceProfile
76   * @syscap SystemCapability.Communication.Bluetooth.Core
77   * @since 10
78   */
79  /**
80   * Manager a2dp source profile.
81   *
82   * @extends BaseProfile
83   * @typedef A2dpSourceProfile
84   * @syscap SystemCapability.Communication.Bluetooth.Core
85   * @crossplatform
86   * @since 13
87   */
88  interface A2dpSourceProfile extends BaseProfile {
89    /**
90     * Initiate an A2DP connection to a remote device.
91     *
92     * @permission ohos.permission.ACCESS_BLUETOOTH
93     * @param { string } deviceId - Indicates device ID. For example, "11:22:33:AA:BB:FF".
94     * @throws { BusinessError } 201 - Permission denied.
95     * @throws { BusinessError } 202 - Non-system applications are not allowed to use system APIs.
96     * @throws { BusinessError } 401 - Invalid parameter. Possible causes: 1. Mandatory parameters are left unspecified.
97     * <br>2. Incorrect parameter types. 3. Parameter verification failed.
98     * @throws { BusinessError } 801 - Capability not supported.
99     * @throws { BusinessError } 2900001 - Service stopped.
100     * @throws { BusinessError } 2900003 - Bluetooth disabled.
101     * @throws { BusinessError } 2900004 - Profile not supported.
102     * @throws { BusinessError } 2900099 - Operation failed.
103     * @syscap SystemCapability.Communication.Bluetooth.Core
104     * @systemapi
105     * @since 10
106     */
107    connect(deviceId: string): void;
108
109    /**
110     * Disconnect the A2DP connection with the remote device.
111     *
112     * @permission ohos.permission.ACCESS_BLUETOOTH
113     * @param { string } deviceId - Indicates device ID. For example, "11:22:33:AA:BB:FF".
114     * @throws { BusinessError } 201 - Permission denied.
115     * @throws { BusinessError } 202 - Non-system applications are not allowed to use system APIs.
116     * @throws { BusinessError } 401 - Invalid parameter. Possible causes: 1. Mandatory parameters are left unspecified.
117     * <br>2. Incorrect parameter types. 3. Parameter verification failed.
118     * @throws { BusinessError } 801 - Capability not supported.
119     * @throws { BusinessError } 2900001 - Service stopped.
120     * @throws { BusinessError } 2900003 - Bluetooth disabled.
121     * @throws { BusinessError } 2900004 - Profile not supported.
122     * @throws { BusinessError } 2900099 - Operation failed.
123     * @syscap SystemCapability.Communication.Bluetooth.Core
124     * @systemapi
125     * @since 10
126     */
127    disconnect(deviceId: string): void;
128
129    /**
130     * Obtains the playing state of device.
131     *
132     * @permission ohos.permission.ACCESS_BLUETOOTH
133     * @param { string } deviceId - Indicates device ID. For example, "11:22:33:AA:BB:FF".
134     * @returns { PlayingState } Returns the playing state.
135     * @throws { BusinessError } 201 - Permission denied.
136     * @throws { BusinessError } 401 - Invalid parameter. Possible causes: 1. Mandatory parameters are left unspecified.
137     * <br>2. Incorrect parameter types. 3. Parameter verification failed.
138     * @throws { BusinessError } 801 - Capability not supported.
139     * @throws { BusinessError } 2900001 - Service stopped.
140     * @throws { BusinessError } 2900003 - Bluetooth disabled.
141     * @throws { BusinessError } 2900004 - Profile not supported.
142     * @throws { BusinessError } 2900099 - Operation failed.
143     * @syscap SystemCapability.Communication.Bluetooth.Core
144     * @since 10
145     */
146    getPlayingState(deviceId: string): PlayingState;
147
148    /**
149     * Checks whether the device supports absolute volume.
150     *
151     * @permission ohos.permission.ACCESS_BLUETOOTH
152     * @param { string } deviceId - Indicates device ID. For example, "11:22:33:AA:BB:FF".
153     * @returns { Promise<boolean> } Returns the promise object.
154     * @throws { BusinessError } 201 - Permission denied.
155     * @throws { BusinessError } 202 - Non-system applications are not allowed to use system APIs.
156     * @throws { BusinessError } 401 - Invalid parameter. Possible causes: 1. Mandatory parameters are left unspecified.
157     * <br>2. Incorrect parameter types. 3. Parameter verification failed.
158     * @throws { BusinessError } 801 - Capability not supported.
159     * @throws { BusinessError } 2900001 - Service stopped.
160     * @throws { BusinessError } 2900003 - Bluetooth disabled.
161     * @throws { BusinessError } 2900099 - Operation failed.
162     * @syscap SystemCapability.Communication.Bluetooth.Core
163     * @systemapi
164     * @since 11
165     */
166    isAbsoluteVolumeSupported(deviceId: string): Promise<boolean>;
167
168    /**
169     * Checks whether the device supports absolute volume.
170     *
171     * @permission ohos.permission.ACCESS_BLUETOOTH
172     * @param { string } deviceId - Indicates device ID. For example, "11:22:33:AA:BB:FF".
173     * @param { AsyncCallback<boolean> } callback - Callback used to listen for the pairing request event.
174     * @throws { BusinessError } 201 - Permission denied.
175     * @throws { BusinessError } 202 - Non-system applications are not allowed to use system APIs.
176     * @throws { BusinessError } 401 - Invalid parameter. Possible causes: 1. Mandatory parameters are left unspecified.
177     * <br>2. Incorrect parameter types. 3. Parameter verification failed.
178     * @throws { BusinessError } 801 - Capability not supported.
179     * @throws { BusinessError } 2900001 - Service stopped.
180     * @throws { BusinessError } 2900003 - Bluetooth disabled.
181     * @throws { BusinessError } 2900099 - Operation failed.
182     * @syscap SystemCapability.Communication.Bluetooth.Core
183     * @systemapi
184     * @since 11
185     */
186    isAbsoluteVolumeSupported(deviceId: string, callback: AsyncCallback<boolean>): void;
187
188    /**
189     * Checks whether the absolute volume is enabled.
190     *
191     * @permission ohos.permission.ACCESS_BLUETOOTH
192     * @param { string } deviceId - Indicates device ID. For example, "11:22:33:AA:BB:FF".
193     * @returns { Promise<boolean> } Returns the promise object.
194     * @throws { BusinessError } 201 - Permission denied.
195     * @throws { BusinessError } 202 - Non-system applications are not allowed to use system APIs.
196     * @throws { BusinessError } 401 - Invalid parameter. Possible causes: 1. Mandatory parameters are left unspecified.
197     * <br>2. Incorrect parameter types. 3. Parameter verification failed.
198     * @throws { BusinessError } 801 - Capability not supported.
199     * @throws { BusinessError } 2900001 - Service stopped.
200     * @throws { BusinessError } 2900003 - Bluetooth disabled.
201     * @throws { BusinessError } 2900099 - Operation failed.
202     * @syscap SystemCapability.Communication.Bluetooth.Core
203     * @systemapi
204     * @since 11
205     */
206    isAbsoluteVolumeEnabled(deviceId: string): Promise<boolean>;
207
208    /**
209     * Checks whether the absolute volume is enabled.
210     *
211     * @permission ohos.permission.ACCESS_BLUETOOTH
212     * @param { string } deviceId - Indicates device ID. For example, "11:22:33:AA:BB:FF".
213     * @param { AsyncCallback<boolean> } callback - the callback result.
214     * @throws { BusinessError } 201 - Permission denied.
215     * @throws { BusinessError } 202 - Non-system applications are not allowed to use system APIs.
216     * @throws { BusinessError } 401 - Invalid parameter. Possible causes: 1. Mandatory parameters are left unspecified.
217     * <br>2. Incorrect parameter types. 3. Parameter verification failed.
218     * @throws { BusinessError } 801 - Capability not supported.
219     * @throws { BusinessError } 2900001 - Service stopped.
220     * @throws { BusinessError } 2900003 - Bluetooth disabled.
221     * @throws { BusinessError } 2900099 - Operation failed.
222     * @syscap SystemCapability.Communication.Bluetooth.Core
223     * @systemapi
224     * @since 11
225     */
226    isAbsoluteVolumeEnabled(deviceId: string, callback: AsyncCallback<boolean>): void;
227
228    /**
229     * Turn on the absolute volume switch.
230     *
231     * @permission ohos.permission.ACCESS_BLUETOOTH and ohos.permission.MANAGE_BLUETOOTH
232     * @param { string } deviceId - Indicates device ID. For example, "11:22:33:AA:BB:FF".
233     * @returns { Promise<void> } Returns the promise object.
234     * @throws { BusinessError } 201 - Permission denied.
235     * @throws { BusinessError } 202 - Non-system applications are not allowed to use system APIs.
236     * @throws { BusinessError } 401 - Invalid parameter. Possible causes: 1. Mandatory parameters are left unspecified.
237     * <br>2. Incorrect parameter types. 3. Parameter verification failed.
238     * @throws { BusinessError } 801 - Capability not supported.
239     * @throws { BusinessError } 2900001 - Service stopped.
240     * @throws { BusinessError } 2900003 - Bluetooth disabled.
241     * @throws { BusinessError } 2900099 - Operation failed.
242     * @syscap SystemCapability.Communication.Bluetooth.Core
243     * @systemapi
244     * @since 11
245     */
246    enableAbsoluteVolume(deviceId: string): Promise<void>;
247
248    /**
249     * Turn on the absolute volume switch..
250     *
251     * @permission ohos.permission.ACCESS_BLUETOOTH and ohos.permission.MANAGE_BLUETOOTH
252     * @param { string } deviceId - Indicates device ID. For example, "11:22:33:AA:BB:FF".
253     * @param { AsyncCallback<void> } callback - the callback result.
254     * @throws { BusinessError } 201 - Permission denied.
255     * @throws { BusinessError } 202 - Non-system applications are not allowed to use system APIs.
256     * @throws { BusinessError } 401 - Invalid parameter. Possible causes: 1. Mandatory parameters are left unspecified.
257     * <br>2. Incorrect parameter types. 3. Parameter verification failed.
258     * @throws { BusinessError } 801 - Capability not supported.
259     * @throws { BusinessError } 2900001 - Service stopped.
260     * @throws { BusinessError } 2900003 - Bluetooth disabled.
261     * @throws { BusinessError } 2900099 - Operation failed.
262     * @syscap SystemCapability.Communication.Bluetooth.Core
263     * @systemapi
264     * @since 11
265     */
266    enableAbsoluteVolume(deviceId: string, callback: AsyncCallback<void>): void;
267
268    /**
269     * Turn off the absolute volume switch.
270     *
271     * @permission ohos.permission.ACCESS_BLUETOOTH and ohos.permission.MANAGE_BLUETOOTH
272     * @param { string } deviceId - Indicates device ID. For example, "11:22:33:AA:BB:FF".
273     * @returns { Promise<void> } Returns the promise object.
274     * @throws { BusinessError } 201 - Permission denied.
275     * @throws { BusinessError } 202 - Non-system applications are not allowed to use system APIs.
276     * @throws { BusinessError } 401 - Invalid parameter. Possible causes: 1. Mandatory parameters are left unspecified.
277     * <br>2. Incorrect parameter types. 3. Parameter verification failed.
278     * @throws { BusinessError } 801 - Capability not supported.
279     * @throws { BusinessError } 2900001 - Service stopped.
280     * @throws { BusinessError } 2900003 - Bluetooth disabled.
281     * @throws { BusinessError } 2900099 - Operation failed.
282     * @syscap SystemCapability.Communication.Bluetooth.Core
283     * @systemapi
284     * @since 11
285     */
286    disableAbsoluteVolume(deviceId: string): Promise<void>;
287
288    /**
289     * Turn off the absolute volume switch..
290     *
291     * @permission ohos.permission.ACCESS_BLUETOOTH and ohos.permission.MANAGE_BLUETOOTH
292     * @param { string } deviceId - Indicates device ID. For example, "11:22:33:AA:BB:FF".
293     * @param { AsyncCallback<void> } callback - the callback result.
294     * @throws { BusinessError } 201 - Permission denied.
295     * @throws { BusinessError } 202 - Non-system applications are not allowed to use system APIs.
296     * @throws { BusinessError } 401 - Invalid parameter. Possible causes: 1. Mandatory parameters are left unspecified.
297     * <br>2. Incorrect parameter types. 3. Parameter verification failed.
298     * @throws { BusinessError } 801 - Capability not supported.
299     * @throws { BusinessError } 2900001 - Service stopped.
300     * @throws { BusinessError } 2900003 - Bluetooth disabled.
301     * @throws { BusinessError } 2900099 - Operation failed.
302     * @syscap SystemCapability.Communication.Bluetooth.Core
303     * @systemapi
304     * @since 11
305     */
306    disableAbsoluteVolume(deviceId: string, callback: AsyncCallback<void>): void;
307
308    /**
309     * Get codec information.
310     *
311     * @permission ohos.permission.ACCESS_BLUETOOTH
312     * @param { string } deviceId - Indicates device ID. For example, "11:22:33:AA:BB:FF".
313     * @returns { CodecInfo } Returns the CodecInfo.
314     * @throws { BusinessError } 201 - Permission denied.
315     * @throws { BusinessError } 202 - Non-system applications are not allowed to use system APIs.
316     * @throws { BusinessError } 401 - Invalid parameter. Possible causes: 1. Mandatory parameters are left unspecified.
317     * <br>2. Incorrect parameter types. 3. Parameter verification failed.
318     * @throws { BusinessError } 801 - Capability not supported.
319     * @throws { BusinessError } 2900001 - Service stopped.
320     * @throws { BusinessError } 2900003 - Bluetooth disabled.
321     * @throws { BusinessError } 2900099 - Operation failed.
322     * @syscap SystemCapability.Communication.Bluetooth.Core
323     * @systemapi
324     * @since 11
325     */
326    getCurrentCodecInfo(deviceId: string): CodecInfo;
327
328    /**
329     * Set codec information.
330     *
331     * @permission ohos.permission.ACCESS_BLUETOOTH and ohos.permission.MANAGE_BLUETOOTH
332     * @param { string } deviceId - Indicates device ID. For example, "11:22:33:AA:BB:FF".
333     * @param { CodecInfo } codecInfo - Indicates the CodecInfo.
334     * @throws { BusinessError } 201 - Permission denied.
335     * @throws { BusinessError } 202 - Non-system applications are not allowed to use system APIs.
336     * @throws { BusinessError } 401 - Invalid parameter. Possible causes: 1. Mandatory parameters are left unspecified.
337     * <br>2. Incorrect parameter types. 3. Parameter verification failed.
338     * @throws { BusinessError } 801 - Capability not supported.
339     * @throws { BusinessError } 2900001 - Service stopped.
340     * @throws { BusinessError } 2900003 - Bluetooth disabled.
341     * @throws { BusinessError } 2900099 - Operation failed.
342     * @syscap SystemCapability.Communication.Bluetooth.Core
343     * @systemapi
344     * @since 11
345     */
346    setCurrentCodecInfo(deviceId: string, codecInfo: CodecInfo): void;
347
348    /**
349     * Restriction devices to play music within {@code duration} milliseconds of connection.
350     *
351     * @permission ohos.permission.ACCESS_BLUETOOTH and ohos.permission.MANAGE_BLUETOOTH
352     * @param { string } deviceId - Indicates device ID. For example, "11:22:33:AA:BB:FF".
353     * @param { number } duration - Restricted duration <milliseconds>. Valid range is from 3000ms to 20000ms.
354     * @returns { Promise<void> } Returns the promise object.
355     * @throws { BusinessError } 201 - Permission denied.
356     * @throws { BusinessError } 202 - Non-system applications are not allowed to use system APIs.
357     * @throws { BusinessError } 401 - Invalid parameter. Possible causes: 1. Mandatory parameters are left unspecified.
358     * <br>2. Incorrect parameter types. 3. Parameter verification failed.
359     * @throws { BusinessError } 801 - Capability not supported.
360     * @throws { BusinessError } 2900001 - Service stopped.
361     * @throws { BusinessError } 2900003 - Bluetooth disabled.
362     * @throws { BusinessError } 2900099 - Operation failed.
363     * @syscap SystemCapability.Communication.Bluetooth.Core
364     * @systemapi
365     * @since 12
366     */
367    disableAutoPlay(deviceId: string, duration: number): Promise<void>;
368
369    /**
370     * Allow devices to automatically play music when connected.
371     *
372     * @permission ohos.permission.ACCESS_BLUETOOTH and ohos.permission.MANAGE_BLUETOOTH
373     * @param { string } deviceId - Indicates device ID. For example, "11:22:33:AA:BB:FF".
374     * @returns { Promise<void> } Returns the promise object.
375     * @throws { BusinessError } 201 - Permission denied.
376     * @throws { BusinessError } 202 - Non-system applications are not allowed to use system APIs.
377     * @throws { BusinessError } 401 - Invalid parameter. Possible causes: 1. Mandatory parameters are left unspecified.
378     * <br>2. Incorrect parameter types. 3. Parameter verification failed.
379     * @throws { BusinessError } 801 - Capability not supported.
380     * @throws { BusinessError } 2900001 - Service stopped.
381     * @throws { BusinessError } 2900003 - Bluetooth disabled.
382     * @throws { BusinessError } 2900099 - Operation failed.
383     * @syscap SystemCapability.Communication.Bluetooth.Core
384     * @systemapi
385     * @since 12
386     */
387    enableAutoPlay(deviceId: string): Promise<void>;
388
389    /**
390     * Obtains the duration for which automatic playback is disabled.
391     *
392     * @permission ohos.permission.ACCESS_BLUETOOTH and ohos.permission.MANAGE_BLUETOOTH
393     * @param { string } deviceId - Indicates device ID. For example, "11:22:33:AA:BB:FF".
394     * @returns { Promise<number> } Returns the duration <milliseconds>;
395     *                              If returns { @code -1 } means allow devices automatic play music when connected.
396     * @throws { BusinessError } 201 - Permission denied.
397     * @throws { BusinessError } 202 - Non-system applications are not allowed to use system APIs.
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 } 2900001 - Service stopped.
402     * @throws { BusinessError } 2900003 - Bluetooth disabled.
403     * @throws { BusinessError } 2900099 - Operation failed.
404     * @syscap SystemCapability.Communication.Bluetooth.Core
405     * @systemapi
406     * @since 12
407     */
408    getAutoPlayDisabledDuration(deviceId: string): Promise<number>;
409  }
410
411  /**
412   * Describes the codec information.
413   *
414   * @typedef CodecInfo
415   * @syscap SystemCapability.Communication.Bluetooth.Core
416   * @since 11
417   */
418  interface CodecInfo {
419    /**
420     * codec type
421     *
422     * @type { CodecType }
423     * @syscap SystemCapability.Communication.Bluetooth.Core
424     * @since 11
425     */
426    codecType: CodecType;
427    /**
428     * codec bits per sample.
429     *
430     * @type { CodecBitsPerSample }
431     * @syscap SystemCapability.Communication.Bluetooth.Core
432     * @since 11
433     */
434    codecBitsPerSample: CodecBitsPerSample;
435    /**
436     * codec channel mode.
437     *
438     * @type { CodecChannelMode }
439     * @syscap SystemCapability.Communication.Bluetooth.Core
440     * @since 11
441     */
442    codecChannelMode: CodecChannelMode;
443    /**
444     * codec sample rate.
445     *
446     * @type { CodecSampleRate }
447     * @syscap SystemCapability.Communication.Bluetooth.Core
448     * @since 11
449     */
450    codecSampleRate: CodecSampleRate;
451  }
452
453  /**
454   * The enum of a2dp playing state.
455   *
456   * @enum { number }
457   * @syscap SystemCapability.Communication.Bluetooth.Core
458   * @since 10
459   */
460  enum PlayingState {
461    /**
462     * Not playing.
463     *
464     * @syscap SystemCapability.Communication.Bluetooth.Core
465     * @since 10
466     */
467    STATE_NOT_PLAYING,
468    /**
469     * Playing.
470     *
471     * @syscap SystemCapability.Communication.Bluetooth.Core
472     * @since 10
473     */
474    STATE_PLAYING
475  }
476
477  /**
478   * Describes the codec type.
479   *
480   * @enum { number }
481   * @syscap SystemCapability.Communication.Bluetooth.Core
482   * @since 11
483   */
484  enum CodecType {
485    /**
486     * invalid codec type.
487     *
488     * @syscap SystemCapability.Communication.Bluetooth.Core
489     * @since 11
490     */
491    CODEC_TYPE_INVALID = -1,
492    /**
493     * SBC - Sub-band coding.
494     *
495     * @syscap SystemCapability.Communication.Bluetooth.Core
496     * @since 11
497     */
498    CODEC_TYPE_SBC = 0,
499    /**
500     * AAC -Advanced Audio Coding.
501     *
502     * @syscap SystemCapability.Communication.Bluetooth.Core
503     * @since 11
504     */
505    CODEC_TYPE_AAC = 1,
506    /**
507     * L2HC.
508     *
509     * @syscap SystemCapability.Communication.Bluetooth.Core
510     * @since 11
511     */
512    CODEC_TYPE_L2HC = 2,
513    /**
514     * L2HCST.
515     *
516     * @syscap SystemCapability.Communication.Bluetooth.Core
517     * @since 13
518     */
519    CODEC_TYPE_L2HCST = 3,
520    /**
521     * LDAC.
522     *
523     * @syscap SystemCapability.Communication.Bluetooth.Core
524     * @since 13
525     */
526    CODEC_TYPE_LDAC = 4
527  }
528
529  /**
530   * Describes the codec channel mode.
531   *
532   * @enum { number }
533   * @syscap SystemCapability.Communication.Bluetooth.Core
534   * @since 11
535   */
536  enum CodecChannelMode {
537    /**
538     * Codec channel mode none.
539     *
540     * @syscap SystemCapability.Communication.Bluetooth.Core
541     * @since 11
542     */
543    CODEC_CHANNEL_MODE_NONE = 0,
544    /**
545     * Codec channel mode MONO.
546     *
547     * @syscap SystemCapability.Communication.Bluetooth.Core
548     * @since 11
549     */
550    CODEC_CHANNEL_MODE_MONO = 1,
551    /**
552     * Codec channel mode STEREO.
553     *
554     * @syscap SystemCapability.Communication.Bluetooth.Core
555     * @since 11
556     */
557    CODEC_CHANNEL_MODE_STEREO = 2
558  }
559
560  /**
561   * Describes the codec bits per sample.
562   *
563   * @enum { number }
564   * @syscap SystemCapability.Communication.Bluetooth.Core
565   * @since 11
566   */
567  enum CodecBitsPerSample {
568    /**
569     * Codec bits per sample none.
570     *
571     * @syscap SystemCapability.Communication.Bluetooth.Core
572     * @since 11
573     */
574    CODEC_BITS_PER_SAMPLE_NONE = 0,
575    /**
576     * Codec 16 bits per sample.
577     *
578     * @syscap SystemCapability.Communication.Bluetooth.Core
579     * @since 11
580     */
581    CODEC_BITS_PER_SAMPLE_16 = 1,
582    /**
583     * Codec 24 bits per sample.
584     *
585     * @syscap SystemCapability.Communication.Bluetooth.Core
586     * @since 11
587     */
588    CODEC_BITS_PER_SAMPLE_24 = 2,
589    /**
590     * Codec 32 bits per sample.
591     *
592     * @syscap SystemCapability.Communication.Bluetooth.Core
593     * @since 11
594     */
595    CODEC_BITS_PER_SAMPLE_32 = 3
596  }
597
598  /**
599   * Describes the codec sample rate.
600   *
601   * @enum { number }
602   * @syscap SystemCapability.Communication.Bluetooth.Core
603   * @since 11
604   */
605  enum CodecSampleRate {
606    /**
607     * Codec sample rate none.
608     *
609     * @syscap SystemCapability.Communication.Bluetooth.Core
610     * @since 11
611     */
612    CODEC_SAMPLE_RATE_NONE = 0,
613    /**
614     * Codec sample rate 44.1k.
615     *
616     * @syscap SystemCapability.Communication.Bluetooth.Core
617     * @since 11
618     */
619    CODEC_SAMPLE_RATE_44100 = 1,
620    /**
621     * Codec sample rate 48k.
622     *
623     * @syscap SystemCapability.Communication.Bluetooth.Core
624     * @since 11
625     */
626    CODEC_SAMPLE_RATE_48000 = 2,
627    /**
628     * Codec sample rate 88.2k.
629     *
630     * @syscap SystemCapability.Communication.Bluetooth.Core
631     * @since 11
632     */
633    CODEC_SAMPLE_RATE_88200 = 3,
634    /**
635     * Codec sample rate 96k.
636     *
637     * @syscap SystemCapability.Communication.Bluetooth.Core
638     * @since 11
639     */
640    CODEC_SAMPLE_RATE_96000 = 4,
641    /**
642     * Codec sample rate 176.4k.
643     *
644     * @syscap SystemCapability.Communication.Bluetooth.Core
645     * @since 11
646     */
647    CODEC_SAMPLE_RATE_176400 = 5,
648    /**
649     * Codec sample rate 192k.
650     *
651     * @syscap SystemCapability.Communication.Bluetooth.Core
652     * @since 11
653     */
654    CODEC_SAMPLE_RATE_192000 = 6
655  }
656}
657
658export default a2dp;