mirror of
https://github.com/bluekitchen/btstack.git
synced 2025-02-26 00:40:38 +00:00
hfp: defines for supported features
This commit is contained in:
parent
e2898183f0
commit
0851a5a143
27
src/hfp.h
27
src/hfp.h
@ -52,13 +52,8 @@
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
#define HFP_DEFAULT_HF_SUPPORTED_FEATURES 0x0000
|
||||
#define HFP_DEFAULT_AG_SUPPORTED_FEATURES 0x0009
|
||||
|
||||
#define HFP_MAX_NUM_CODECS 20
|
||||
#define HFP_MAX_NUM_INDICATORS 20
|
||||
|
||||
/* AT+BRSF Result:
|
||||
/* HF Supported Features:
|
||||
0: EC and/or NR function
|
||||
1: Three-way calling
|
||||
2: CLI presentation capability
|
||||
@ -71,7 +66,13 @@ extern "C" {
|
||||
9: eSCO S4 (and T2) Settings Supported
|
||||
10-31: Reserved for future definition
|
||||
*/
|
||||
/* +BRSF Result:
|
||||
#define HFP_HFSF_THREE_WAY_CALLING 1
|
||||
#define HFP_HFSF_EC_NR_FUNCTION 0
|
||||
#define HFP_HFSF_CODEC_NEGOTIATION 7
|
||||
#define HFP_HFSF_HF_INDICATORS 8
|
||||
#define HFP_HFSF_ESCO 9
|
||||
|
||||
/* AG Supported Features:
|
||||
0: Three-way calling
|
||||
1: EC and/or NR function
|
||||
2: Voice recognition function
|
||||
@ -86,6 +87,18 @@ extern "C" {
|
||||
11: eSCO S4 (and T2) Settings Supported
|
||||
12-31: Reserved for future definition
|
||||
*/
|
||||
#define HFP_AGSF_THREE_WAY_CALLING 0
|
||||
#define HFP_AGSF_EC_NR_FUNCTION 1
|
||||
#define HFP_AGSF_CODEC_NEGOTIATION 9
|
||||
#define HFP_AGSF_HF_INDICATORS 10
|
||||
#define HFP_AGSF_ESCO 11
|
||||
|
||||
#define HFP_DEFAULT_HF_SUPPORTED_FEATURES 0x0000
|
||||
#define HFP_DEFAULT_AG_SUPPORTED_FEATURES 0x0009
|
||||
|
||||
#define HFP_MAX_NUM_CODECS 20
|
||||
#define HFP_MAX_NUM_INDICATORS 20
|
||||
|
||||
#define HFP_SUPPORTED_FEATURES "+BRSF"
|
||||
#define HFP_AVAILABLE_CODECS "+BAC"
|
||||
#define HFP_INDICATOR "+CIND"
|
||||
|
13
src/hfp_hf.c
13
src/hfp_hf.c
@ -77,24 +77,23 @@ static int get_bit(uint16_t bitmap, int position){
|
||||
|
||||
|
||||
int has_codec_negotiation_feature(hfp_connection_t * connection){
|
||||
int hf = get_bit(hfp_supported_features,7);
|
||||
int ag = get_bit(connection->remote_supported_features,9);
|
||||
int hf = get_bit(hfp_supported_features, HFP_HFSF_CODEC_NEGOTIATION);
|
||||
int ag = get_bit(connection->remote_supported_features, HFP_AGSF_CODEC_NEGOTIATION);
|
||||
printf("\ncodec_negotiation_feature: HF %d, AG %d\n", hf, ag);
|
||||
return hf && ag;
|
||||
}
|
||||
|
||||
int has_call_waiting_and_3way_calling_feature(hfp_connection_t * connection){
|
||||
int hf = get_bit(hfp_supported_features,1);
|
||||
int ag = get_bit(connection->remote_supported_features,0);
|
||||
int hf = get_bit(hfp_supported_features, HFP_HFSF_THREE_WAY_CALLING);
|
||||
int ag = get_bit(connection->remote_supported_features, HFP_AGSF_THREE_WAY_CALLING);
|
||||
printf("\n3way_calling_feature: HF %d, AG %d\n", hf, ag);
|
||||
return hf && ag;
|
||||
}
|
||||
|
||||
|
||||
int has_hf_indicators_feature(hfp_connection_t * connection){
|
||||
|
||||
int hf = get_bit(hfp_supported_features,8);
|
||||
int ag = get_bit(connection->remote_supported_features,10);
|
||||
int hf = get_bit(hfp_supported_features, HFP_HFSF_HF_INDICATORS);
|
||||
int ag = get_bit(connection->remote_supported_features, HFP_AGSF_HF_INDICATORS);
|
||||
printf("\nhf_indicators_feature: HF %d, AG %d\n", hf, ag);
|
||||
return hf && ag;
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user