Developer World
Spresense SDK Library v1.4.2-3df2e9d
bt_a2dp_codecs.h
Go to the documentation of this file.
1 /****************************************************************************
2  * modules/include/bluetooth/bt_a2dp_codecs.h
3  *
4  * Copyright 2018 Sony Semiconductor Solutions Corporation
5  *
6  * Redistribution and use in source and binary forms, with or without
7  * modification, are permitted provided that the following conditions
8  * are met:
9  *
10  * 1. Redistributions of source code must retain the above copyright
11  * notice, this list of conditions and the following disclaimer.
12  * 2. Redistributions in binary form must reproduce the above copyright
13  * notice, this list of conditions and the following disclaimer in
14  * the documentation and/or other materials provided with the
15  * distribution.
16  * 3. Neither the name of Sony Semiconductor Solutions Corporation nor
17  * the names of its contributors may be used to endorse or promote
18  * products derived from this software without specific prior written
19  * permission.
20  *
21  * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
22  * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
23  * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
24  * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
25  * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
26  * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
27  * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS
28  * OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
29  * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
30  * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
31  * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
32  * POSSIBILITY OF SUCH DAMAGE.
33  *
34  ****************************************************************************/
35 
45 #ifndef __MODULES_INCLUDE_BLUETOOTH_BT_A2DP_CODECS_H
46 #define __MODULES_INCLUDE_BLUETOOTH_BT_A2DP_CODECS_H
47 
48 /****************************************************************************
49  * Included Files
50  ****************************************************************************/
51 
52 #include <stdint.h>
53 
54 /****************************************************************************
55  * Pre-processor Definitions
56  ****************************************************************************/
57 
62 #define CODEC_INFO_MAX_LENGTH 20
63 
65 /****************************************************************************
66  * Public Types
67  ****************************************************************************/
68 
71 typedef enum
72 {
77 
80 typedef enum
81 {
85 
88 typedef enum
89 {
90  BT_A2DP_SAMPLE_FREQ_8000HZ,
91  BT_A2DP_SAMPLE_FREQ_11000HZ,
92  BT_A2DP_SAMPLE_FREQ_12000HZ,
93  BT_A2DP_SAMPLE_FREQ_16000HZ,
94  BT_A2DP_SAMPLE_FREQ_22050HZ,
95  BT_A2DP_SAMPLE_FREQ_24000HZ,
96  BT_A2DP_SAMPLE_FREQ_32000HZ,
97  BT_A2DP_SAMPLE_FREQ_44100HZ,
98  BT_A2DP_SAMPLE_FREQ_48000HZ,
99  BT_A2DP_SAMPLE_FREQ_64000HZ,
100  BT_A2DP_SAMPLE_FREQ_88000HZ,
101  BT_A2DP_SAMPLE_FREQ_96000HZ
103 
106 typedef enum
107 {
108  BT_A2DP_CHANNEL_MONO,
109  BT_A2DP_CHANNEL_DUAL,
110  BT_A2DP_CHANNEL_STEREO,
111  BT_A2DP_CHANNEL_JOINTSTEREO
113 
116 typedef enum
117 {
118  BT_A2DP_CHANNEL_SNR,
119  BT_A2DP_CHANNEL_LOUDNESS
121 
139 typedef struct
140 {
141  BT_A2DP_SAMPLE_FREQ sampFreq;
142  BT_A2DP_CHANNEL_MODE chMode;
143  uint8_t blockLen;
144  uint8_t numSubbands;
145  BT_A2DP_SBC_ALLOC_MODE allocMthd;
146  uint8_t maxBitpool;
147  uint8_t minBitpool;
149 
150 
153 typedef enum
154 {
155  BT_A2DP_MPEG2_AAC_LC,
156  BT_A2DP_MPEG4_AAC_LC,
157  BT_A2DP_MPEG4_AAC_LTP,
158  BT_A2DP_MPEG4_AAC_SSR
160 
175 typedef struct
176 {
177  BT_A2DP_AAC_PROFILE profile;
178  BT_A2DP_SAMPLE_FREQ sampFreq;
180  uint8_t isVbrSupported;
181  uint32_t bitrate;
183 
186 typedef struct
187 {
188  uint8_t codecInfoLength;
189  uint8_t codecInfo[CODEC_INFO_MAX_LENGTH];
191 
194 typedef struct
195 {
196  BT_A2DP_CODEC_TYPE codecId;
197  union
198  {
202  } codec_info;
203  BT_A2DP_TRANSFER_TYPE transfer_type;
205 
206 #endif /* __MODULES_INCLUDE_BLUETOOTH_BT_A2DP_CODECS_H */
Definition: bt_a2dp_codecs.h:74
BT_A2DP_SBC_ALLOC_MODE
Masks for supported allocation method.
Definition: bt_a2dp_codecs.h:116
Codec information element structure, used to provide info of a single type of codec.
Definition: bt_a2dp_codecs.h:194
data type for the MPEG-2, 4 AAC Codec Information Element
Definition: bt_a2dp_codecs.h:175
Definition: bt_a2dp_codecs.h:83
Definition: bt_a2dp_codecs.h:82
Vendor Specific Codec information element type.
Definition: bt_a2dp_codecs.h:186
BT_A2DP_TRANSFER_TYPE
Masks for supported Codecs.
Definition: bt_a2dp_codecs.h:80
BT_A2DP_CODEC_TYPE
Masks for supported Codecs.
Definition: bt_a2dp_codecs.h:71
BT_A2DP_AAC_PROFILE
Masks for supported Codecs.
Definition: bt_a2dp_codecs.h:153
BT_A2DP_SAMPLE_FREQ
Masks for supported sample frequency TODO: Need to create mask.
Definition: bt_a2dp_codecs.h:88
data type for the SBC Codec Information Element
Definition: bt_a2dp_codecs.h:139
Definition: bt_a2dp_codecs.h:73
BT_A2DP_CHANNEL_MODE
Masks for supported channel TODO: Need to create mask.
Definition: bt_a2dp_codecs.h:106