Skip to content

Commit fb00c61

Browse files
committed
[int][new][bt] [support two sbc/aac decoder]
Project: Bluetooth redmine: #5945, REDMINE-5945 ext-redmine: bug|feat#5945 [Description in detail] Affected branch: [master] Change-Id: I6fce1b55fdb5f204a0193a6d70b9bce3c288a96f
1 parent 1a0b00a commit fb00c61

15 files changed

+623
-462
lines changed

include/av_sbc_api.h

Lines changed: 28 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -105,7 +105,7 @@ U16 bts2_sbc_encode_cfg(BTS2E_SBC_CHNL_MODE chnl_mode,
105105
/*----------------------------------------------------------------------------*
106106
*
107107
* DESCRIPTION:
108-
* Configure the settings required before decoding.
108+
* Configure sbc decoder settings for the specified connection
109109
*
110110
* INPUT:
111111
* BTS2E_SBC_CHNL_MODE chnl_mode
@@ -114,6 +114,7 @@ U16 bts2_sbc_encode_cfg(BTS2E_SBC_CHNL_MODE chnl_mode,
114114
* U8 nrof_blocks
115115
* U8 nrof_subbands
116116
* U8 bitpool
117+
* U8 con_idx
117118
*
118119
* OUTPUT:
119120
* If inputs are valid else returns FALSE.
@@ -129,6 +130,14 @@ U8 bts2_sbc_decode_cfg(BTS2E_SBC_CHNL_MODE chnl_mode,
129130
U8 nrof_subbands,
130131
U8 bitpool);
131132

133+
U8 bts2_sbc_decode_cfg_ext(BTS2E_SBC_CHNL_MODE chnl_mode,
134+
BTS2E_SBC_ALLOC_METHOD alloc_method,
135+
U16 sample_freq,
136+
U8 nrof_blocks,
137+
U8 nrof_subbands,
138+
U8 bitpool,
139+
U8 con_idx);
140+
132141
/*----------------------------------------------------------------------------*
133142
*
134143
* DESCRIPTION:
@@ -152,12 +161,13 @@ void bts2_sbc_encode(BTS2S_SBC_STREAM *pbss);
152161
/*----------------------------------------------------------------------------*
153162
*
154163
* DESCRIPTION:
155-
* SBC decode.
164+
* Sbc decoding the specified connection
156165
*
157166
*
158167
*
159168
* INPUT:
160169
* BTS2S_SBC_STREAM *pbss
170+
* U8 con_idx
161171
*
162172
*
163173
* OUTPUT:
@@ -168,20 +178,23 @@ void bts2_sbc_encode(BTS2S_SBC_STREAM *pbss);
168178
*
169179
*----------------------------------------------------------------------------*/
170180
void bts2_sbc_decode(BTS2S_SBC_STREAM *pbss);
181+
void bts2_sbc_decode_ext(BTS2S_SBC_STREAM *pbss, U8 con_idx);
171182

172183
void bts2_sbc_encode_completed(void);
173184

174185

175186
void bts2_sbc_decode_completed(void);
187+
void bts2_sbc_decode_completed_ext(U8 con_idx);
176188

177189

178190
///////////////////////////////////////////////////////////////////////////////////////////////////////////
179191
/*----------------------------------------------------------------------------*
180192
*
181193
* DESCRIPTION:
182-
* Configure the settings required before encoding.
194+
* Configure msbc encoder settings for the specified connection
183195
*
184196
* INPUT:
197+
* U8 con_idx
185198
*
186199
* OUTPUT:
187200
* Frame size in bytes if inputs are valid else returns zero.
@@ -191,13 +204,15 @@ void bts2_sbc_decode_completed(void);
191204
*
192205
*----------------------------------------------------------------------------*/
193206
U16 bts2_msbc_encode_cfg(void);
207+
U16 bts2_msbc_encode_cfg_ext(U8 con_idx);
194208

195209
/*----------------------------------------------------------------------------*
196210
*
197211
* DESCRIPTION:
198-
* Configure the settings required before decoding.
212+
* Configure msbc decoder settings for the specified connection
199213
*
200214
* INPUT:
215+
* U8 con_idx
201216
*
202217
* OUTPUT:
203218
* If inputs are valid else returns FALSE.
@@ -207,16 +222,18 @@ U16 bts2_msbc_encode_cfg(void);
207222
*
208223
*----------------------------------------------------------------------------*/
209224
U8 bts2_msbc_decode_cfg(void);
225+
U8 bts2_msbc_decode_cfg_ext(U8 con_idx);
210226

211227
/*----------------------------------------------------------------------------*
212228
*
213229
* DESCRIPTION:
214-
* mSBC encode.
230+
* MSBC encoding the specified connection
215231
*
216232
*
217233
*
218234
* INPUT:
219235
* BS_SBC_STREAM *pbss
236+
* U8 con_idx
220237
*
221238
*
222239
* OUTPUT:
@@ -227,16 +244,18 @@ U8 bts2_msbc_decode_cfg(void);
227244
*
228245
*----------------------------------------------------------------------------*/
229246
void bts2_msbc_encode(BTS2S_SBC_STREAM *pbss);
247+
void bts2_msbc_encode_ext(BTS2S_SBC_STREAM *pbss, U8 con_idx);
230248

231249
/*----------------------------------------------------------------------------*
232250
*
233251
* DESCRIPTION:
234-
* mSBC decode.
252+
* MSBC decoding the specified connection
235253
*
236254
*
237255
*
238256
* INPUT:
239257
* BS_SBC_STREAM *pbss
258+
* U8 con_idx
240259
*
241260
*
242261
* OUTPUT:
@@ -247,12 +266,15 @@ void bts2_msbc_encode(BTS2S_SBC_STREAM *pbss);
247266
*
248267
*----------------------------------------------------------------------------*/
249268
void bts2_msbc_decode(BTS2S_SBC_STREAM *pbss);
269+
void bts2_msbc_decode_ext(BTS2S_SBC_STREAM *pbss, U8 con_idx);
250270

251271

252272
void bts2_msbc_encode_completed(void);
273+
void bts2_msbc_encode_completed_ext(U8 con_idx);
253274

254275

255276
void bts2_msbc_decode_completed(void);
277+
void bts2_msbc_decode_completed_ext(U8 con_idx);
256278

257279

258280
#ifdef __cplusplus

include/avrcp_api.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -77,6 +77,7 @@ typedef enum
7777
#define AVRCP_VENDOR_DEPENDENT_PDU_ID_REQUEST_CONTINUING_RESPONSE 0x40
7878
#define AVRCP_VENDOR_DEPENDENT_PDU_ID_ABORT_CONTINUING_RESPONSE 0x41
7979
#define AVRCP_VENDOR_DEPENDENT_PDU_ID_SET_ABSOLUTE_VOLUME 0x50
80+
#define AVRCP_VENDOR_DEPENDENT_PDU_ID_INVALD 0xff
8081

8182

8283
#define AVRCP_VENDOR_DEPENDENT_EVENT_CAPABILITY_COMPANY_ID 0x02

lib/lib_bt_gcc.a

13.4 KB
Binary file not shown.

lib/lib_bt_msvc.lib

6.74 KB
Binary file not shown.

lib/lib_bt_rvds.lib

11.5 KB
Binary file not shown.

lib/lib_bt_rvds_tran_only.lib

4.89 KB
Binary file not shown.

service/bt/bt_cm/bt_connection_manager.c

Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1877,6 +1877,51 @@ void bt_cm(uint8_t argc, char **argv)
18771877
gap_rd_rmt_ext_featr_req(bts2_task_get_app_task_id(), atoi(argv[2]), env->bt_devices[i].info.bd_addr);
18781878
}
18791879
}
1880+
#ifdef CFG_AV
1881+
else if (strcmp(argv[1], "av_conn1") == 0)
1882+
{
1883+
BTS2S_BD_ADDR bd_addr;
1884+
bd_addr.nap = strtol(argv[2], NULL, 0);
1885+
bd_addr.uap = strtol(argv[3], NULL, 0);
1886+
bd_addr.lap = strtol(argv[4], NULL, 0);
1887+
LOG_I("conn addr: %04X:%02X:%06lX",
1888+
bd_addr.nap,
1889+
bd_addr.uap,
1890+
bd_addr.lap);
1891+
1892+
gap_wr_scan_enb_req(bts2_task_get_app_task_id(), 0, 0);
1893+
if (atoi(argv[5]))
1894+
bt_av_conn(&bd_addr, AV_SRC);
1895+
else
1896+
bt_av_conn(&bd_addr, AV_SNK);
1897+
}
1898+
else if (strcmp(argv[1], "av_disconn1") == 0)
1899+
{
1900+
bt_av_disconnect(0);
1901+
}
1902+
#endif
1903+
#ifdef CFG_AVRCP
1904+
else if (strcmp(argv[1], "avrcp_conn1") == 0)
1905+
{
1906+
BTS2S_BD_ADDR bd_addr;
1907+
bd_addr.nap = strtol(argv[2], NULL, 0);
1908+
bd_addr.uap = strtol(argv[3], NULL, 0);
1909+
bd_addr.lap = strtol(argv[4], NULL, 0);
1910+
LOG_I("conn addr: %04X:%02X:%06lX",
1911+
bd_addr.nap,
1912+
bd_addr.uap,
1913+
bd_addr.lap);
1914+
gap_wr_scan_enb_req(bts2_task_get_app_task_id(), 0, 0);
1915+
if (atoi(argv[5]))
1916+
avrcp_conn_req(bts2_task_get_app_task_id(), bd_addr, AVRCP_TG, AVRCP_CT);
1917+
else
1918+
avrcp_conn_req(bts2_task_get_app_task_id(), bd_addr, AVRCP_CT, AVRCP_TG);
1919+
}
1920+
else if (strcmp(argv[1], "avrcp_dis") == 0)
1921+
{
1922+
avrcp_disc_req();
1923+
}
1924+
#endif
18801925
}
18811926
}
18821927

0 commit comments

Comments
 (0)