WS63 SDK 文档 7021f4f@fbb_ws63
ws63 和 ws63e 解决方案的 SDK 文档
载入中...
搜索中...
未找到
bts_a2dp_source.h
浏览该文件的文档.
1/*
2 * Copyright (c) HiSilicon (Shanghai) Technologies Co., Ltd. 2022. All rights reserved.
3 * Description: BT A2DP-SRC module.
4 */
5
12#ifndef BTS_A2DP_SOURCE_H
13#define BTS_A2DP_SOURCE_H
14
15#include "bts_def.h"
16#ifdef __cplusplus
17extern "C" {
18#endif
19
27#define A2DP_CODEC_PRIORITY_DISABLED (-1)
28#define A2DP_CODEC_PRIORITY_DEFAULT 0
29#define A2DP_CODEC_PRIORITY_HIGHEST (1000 * 1000)
30
38#define A2DP_CODEC_SAMPLE_RATE_NONE 0x00
39#define A2DP_CODEC_SAMPLE_RATE_44100 (0x01 << 0)
40#define A2DP_CODEC_SAMPLE_RATE_48000 (0x01 << 1)
41#define A2DP_CODEC_SAMPLE_RATE_88200 (0x01 << 2)
42#define A2DP_CODEC_SAMPLE_RATE_96000 (0x01 << 3)
43#define A2DP_CODEC_SAMPLE_RATE_176400 (0x01 << 4)
44#define A2DP_CODEC_SAMPLE_RATE_192000 (0x01 << 5)
45
53#define A2DP_CODEC_BITS_PER_SAMPLE_NONE 0x00
54#define A2DP_CODEC_BITS_PER_SAMPLE_16 (0x01 << 0)
55#define A2DP_CODEC_BITS_PER_SAMPLE_24 (0x01 << 1)
56#define A2DP_CODEC_BITS_PER_SAMPLE_32 (0x01 << 2)
57
65#define A2DP_CODEC_CHANNEL_MODE_NONE 0x00
66
74#define A2DP_CODEC_CHANNEL_MODE_MONO (0x01 << 0)
82#define A2DP_CODEC_CHANNEL_MODE_STEREO (0x01 << 1)
83
111
127
135typedef struct {
138 unsigned int codec_type;
140 unsigned char sample_rate;
142 unsigned char bits_per_sample;
144 unsigned char channel_mode;
146 unsigned long codec_specific1;
148 unsigned long codec_specific2;
150 unsigned long codec_specific3;
152 unsigned long codec_specific4;
155
156
182typedef void (*a2dp_src_connect_state_changed_callback)(bd_addr_t *bd_addr, int conn_state);
183
208typedef void (*a2dp_src_playing_state_changed_callback)(bd_addr_t *bd_addr, int playing_state);
209
236
249
269
288
308int a2dp_src_connect(const bd_addr_t *bd_addr);
309
329int a2dp_src_disconnect(const bd_addr_t *bd_addr);
330
351
372
393
414
435
456
461#ifdef __cplusplus
462}
463#endif
464#endif /* BTS_A2DP_SOURCE_H */
int a2dp_src_get_device_connect_state(const bd_addr_t *bd_addr)
通过设备地址查询设备连接状态。
void(* a2dp_src_connect_state_changed_callback)(bd_addr_t *bd_addr, int conn_state)
a2dp src连接状态改变回调函数。
Definition bts_a2dp_source.h:182
void(* a2dp_src_playing_state_changed_callback)(bd_addr_t *bd_addr, int playing_state)
A2dp src播放状态改变回调函数。
Definition bts_a2dp_source.h:208
int a2dp_src_stop_playing(const bd_addr_t *bd_addr)
设置蓝牙音乐的播放为stop状态。
int a2dp_src_suspend_playing(const bd_addr_t *bd_addr)
设置蓝牙音乐的播放为suspend状态。
a2dp_optional_codec_support_state_t
A2dp配置编码格式支持状态。
Definition bts_a2dp_source.h:119
int a2dp_src_disconnect(const bd_addr_t *bd_addr)
与对端设备断开a2dp连接。
int a2dp_src_get_playing_state(const bd_addr_t *bd_addr)
当对端设备已经连接时,通过设备地址查询对端蓝牙设备播放状态。
int a2dp_src_connect(const bd_addr_t *bd_addr)
与对端设备建立a2dp连接。
a2dp_codec_type_t
A2dp编码格式类型。
Definition bts_a2dp_source.h:91
int a2dp_src_deregister_callbacks(a2dp_src_callbacks_t *func)
去注册上层应用的回调。
bd_addr_t a2dp_src_get_active_device(void)
查询对端活跃蓝牙设备的地址。
int a2dp_src_register_callbacks(a2dp_src_callbacks_t *func)
注册上层应用的回调。
int a2dp_src_start_playing(const bd_addr_t *bd_addr)
设置蓝牙音乐的播放为start状态。
void(* a2dp_src_configuration_changed_callback)(bd_addr_t *bd_addr, a2dp_codec_info_t *info)
A2dp 编码格式改变回调函数。
Definition bts_a2dp_source.h:235
@ A2DP_OPTIONAL_CODEC_SUPPORT
Definition bts_a2dp_source.h:122
@ A2DP_OPTIONAL_CODEC_SUPPORT_UNKNOWN
Definition bts_a2dp_source.h:124
@ A2DP_OPTIONAL_CODEC_NOT_SUPPORT
Definition bts_a2dp_source.h:120
@ A2DP_CODEC_TYPE_LHDC
Definition bts_a2dp_source.h:102
@ A2DP_CODEC_TYPE_SBC
Definition bts_a2dp_source.h:92
@ A2DP_CODEC_TYPE_AAC
Definition bts_a2dp_source.h:94
@ A2DP_CODEC_TYPE_LC3
Definition bts_a2dp_source.h:104
@ A2DP_CODEC_TYPE_INVALID
Definition bts_a2dp_source.h:108
@ A2DP_CODEC_TYPE_L2HC
Definition bts_a2dp_source.h:106
@ A2DP_CODEC_TYPE_APTX
Definition bts_a2dp_source.h:96
@ A2DP_CODEC_TYPE_LDAC
Definition bts_a2dp_source.h:100
@ A2DP_CODEC_TYPE_APTX_HD
Definition bts_a2dp_source.h:98
A2dp src配置编码格式参数。
Definition bts_a2dp_source.h:135
unsigned char bits_per_sample
Definition bts_a2dp_source.h:142
unsigned long codec_specific4
Definition bts_a2dp_source.h:152
unsigned long codec_specific2
Definition bts_a2dp_source.h:148
unsigned long codec_specific1
Definition bts_a2dp_source.h:146
int codec_priority
Definition bts_a2dp_source.h:136
unsigned char channel_mode
Definition bts_a2dp_source.h:144
unsigned int codec_type
Definition bts_a2dp_source.h:138
unsigned char sample_rate
Definition bts_a2dp_source.h:140
unsigned long codec_specific3
Definition bts_a2dp_source.h:150
A2dp src回调接口定义。
Definition bts_a2dp_source.h:244
a2dp_src_connect_state_changed_callback connectstate_changed_cb
Definition bts_a2dp_source.h:245
a2dp_src_playing_state_changed_callback playing_state_changed_cb
Definition bts_a2dp_source.h:246
a2dp_src_configuration_changed_callback configuration_changed_cb
Definition bts_a2dp_source.h:247
定义设备的蓝牙地址。
Definition bts_def.h:140