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