• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 /*
2  * Copyright (C) 2021 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  * @addtogroup Bluetooth
18  * @{
19  *
20  * @brief A2dp codec information and status define.
21  *
22  * @since 6
23  */
24 
25 #ifndef BLUETOOTH_A2DP_CODEC_H
26 #define BLUETOOTH_A2DP_CODEC_H
27 
28 #include <vector>
29 #include "bluetooth_def.h"
30 #include "bluetooth_types.h"
31 
32 namespace OHOS {
33 namespace Bluetooth {
34 /**
35  * @brief A2dp codec configuration information of a2dp source
36  *
37  * @since 6.0
38  */
39 struct A2dpCodecInfo {
40     // Codec priority
41     uint32_t codecPriority;
42 
43     // Codec type
44     uint8_t codecType;
45 
46     // Codec sample
47     uint32_t sampleRate;
48 
49     // Codec bits per sample
50     uint8_t bitsPerSample;
51 
52     // Codec channel mode
53     uint8_t channelMode;
54 
55     // Codec specific value1
56     uint64_t codecSpecific1;
57 
58     // Codec specific value2
59     uint64_t codecSpecific2;
60 
61     // Codec specific value3
62     uint64_t codecSpecific3;
63 
64     // Codec specific value4
65     uint64_t codecSpecific4;
66 };
67 
68 /**
69  * @brief The codec configuration and capability information of a2dp source
70  *
71  * @since 6.0
72  */
73 struct A2dpCodecStatus {
74     // current codec information
75     A2dpCodecInfo codecInfo;
76 
77     // local codec information
78     std::vector<A2dpCodecInfo> codecInfoLocalCap;
79 
80     // Local device and peer confirmed codec information
81     std::vector<A2dpCodecInfo> codecInfoConfirmedCap;
82 };
83 }  // namespace Bluetooth
84 }  // namespace OHOS
85 #endif  // BLUETOOTH_A2DP_CODEC_H