mirror of
https://github.com/bluekitchen/btstack.git
synced 2025-03-16 16:20:50 +00:00
hfp: add Enhanced Voice Recognition Status and Voice Recognition Text supported features
This commit is contained in:
parent
eadd370d24
commit
ef3ae4eb99
@ -66,16 +66,18 @@ extern "C" {
|
||||
9: eSCO S4 (and T2) Settings Supported
|
||||
10-31: Reserved for future definition
|
||||
*/
|
||||
#define HFP_HFSF_EC_NR_FUNCTION 0
|
||||
#define HFP_HFSF_THREE_WAY_CALLING 1
|
||||
#define HFP_HFSF_CLI_PRESENTATION_CAPABILITY 2
|
||||
#define HFP_HFSF_VOICE_RECOGNITION_FUNCTION 3
|
||||
#define HFP_HFSF_REMOTE_VOLUME_CONTROL 4
|
||||
#define HFP_HFSF_ENHANCED_CALL_STATUS 5
|
||||
#define HFP_HFSF_ENHANCED_CALL_CONTROL 6
|
||||
#define HFP_HFSF_CODEC_NEGOTIATION 7
|
||||
#define HFP_HFSF_HF_INDICATORS 8
|
||||
#define HFP_HFSF_ESCO_S4 9
|
||||
#define HFP_HFSF_EC_NR_FUNCTION 0
|
||||
#define HFP_HFSF_THREE_WAY_CALLING 1
|
||||
#define HFP_HFSF_CLI_PRESENTATION_CAPABILITY 2
|
||||
#define HFP_HFSF_VOICE_RECOGNITION_FUNCTION 3
|
||||
#define HFP_HFSF_REMOTE_VOLUME_CONTROL 4
|
||||
#define HFP_HFSF_ENHANCED_CALL_STATUS 5
|
||||
#define HFP_HFSF_ENHANCED_CALL_CONTROL 6
|
||||
#define HFP_HFSF_CODEC_NEGOTIATION 7
|
||||
#define HFP_HFSF_HF_INDICATORS 8
|
||||
#define HFP_HFSF_ESCO_S4 9
|
||||
#define HFP_HFSF_ENHANCED_VOICE_RECOGNITION_STATUS 10
|
||||
#define HFP_HFSF_VOICE_RECOGNITION_TEXT 11
|
||||
|
||||
/* AG Supported Features:
|
||||
0: Three-way calling
|
||||
@ -92,18 +94,20 @@ 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_VOICE_RECOGNITION_FUNCTION 2
|
||||
#define HFP_AGSF_IN_BAND_RING_TONE 3
|
||||
#define HFP_AGSF_ATTACH_A_NUMBER_TO_A_VOICE_TAG 4
|
||||
#define HFP_AGSF_ABILITY_TO_REJECT_A_CALL 5
|
||||
#define HFP_AGSF_ENHANCED_CALL_STATUS 6
|
||||
#define HFP_AGSF_ENHANCED_CALL_CONTROL 7
|
||||
#define HFP_AGSF_EXTENDED_ERROR_RESULT_CODES 8
|
||||
#define HFP_AGSF_CODEC_NEGOTIATION 9
|
||||
#define HFP_AGSF_HF_INDICATORS 10
|
||||
#define HFP_AGSF_ESCO_S4 11
|
||||
#define HFP_AGSF_THREE_WAY_CALLING 0
|
||||
#define HFP_AGSF_EC_NR_FUNCTION 1
|
||||
#define HFP_AGSF_VOICE_RECOGNITION_FUNCTION 2
|
||||
#define HFP_AGSF_IN_BAND_RING_TONE 3
|
||||
#define HFP_AGSF_ATTACH_A_NUMBER_TO_A_VOICE_TAG 4
|
||||
#define HFP_AGSF_ABILITY_TO_REJECT_A_CALL 5
|
||||
#define HFP_AGSF_ENHANCED_CALL_STATUS 6
|
||||
#define HFP_AGSF_ENHANCED_CALL_CONTROL 7
|
||||
#define HFP_AGSF_EXTENDED_ERROR_RESULT_CODES 8
|
||||
#define HFP_AGSF_CODEC_NEGOTIATION 9
|
||||
#define HFP_AGSF_HF_INDICATORS 10
|
||||
#define HFP_AGSF_ESCO_S4 11
|
||||
#define HFP_AGSF_ENHANCED_VOICE_RECOGNITION_STATUS 12
|
||||
#define HFP_AGSF_VOICE_RECOGNITION_TEXT 13
|
||||
|
||||
#define HFP_DEFAULT_HF_SUPPORTED_FEATURES 0x0000
|
||||
#define HFP_DEFAULT_AG_SUPPORTED_FEATURES 0x0009
|
||||
@ -139,7 +143,7 @@ extern "C" {
|
||||
#define HFP_CALL_PHONE_NUMBER "ATD"
|
||||
#define HFP_REDIAL_LAST_NUMBER "+BLDN"
|
||||
#define HFP_TURN_OFF_EC_AND_NR "+NREC" // EC (Echo CAnceling), NR (Noise Reduction)
|
||||
#define HFP_ACTIVATE_VOICE_RECOGNITION "+BVRA" // EC (Echo CAnceling), NR (Noise Reduction)
|
||||
#define HFP_ACTIVATE_VOICE_RECOGNITION "+BVRA" // Voice Recognition
|
||||
#define HFP_SET_MICROPHONE_GAIN "+VGM"
|
||||
#define HFP_SET_SPEAKER_GAIN "+VGS"
|
||||
#define HFP_PHONE_NUMBER_FOR_VOICE_TAG "+BINP"
|
||||
|
@ -2567,9 +2567,18 @@ void hfp_ag_create_sdp_record(uint8_t * service, uint32_t service_record_handle,
|
||||
// Wide band speech (bit 5) requires Codec negotiation
|
||||
//
|
||||
uint16_t sdp_features = supported_features & 0x1f;
|
||||
if (wide_band_speech && (supported_features & (1 << HFP_AGSF_CODEC_NEGOTIATION))){
|
||||
if ( (wide_band_speech == 1) && (supported_features & (1 << HFP_AGSF_CODEC_NEGOTIATION))){
|
||||
sdp_features |= 1 << 5;
|
||||
}
|
||||
|
||||
if (supported_features & (1 << HFP_AGSF_ENHANCED_VOICE_RECOGNITION_STATUS)){
|
||||
sdp_features |= 1 << 6;
|
||||
}
|
||||
|
||||
if (supported_features & (1 << HFP_AGSF_VOICE_RECOGNITION_TEXT)){
|
||||
sdp_features |= 1 << 7;
|
||||
}
|
||||
|
||||
de_add_number(service, DE_UINT, DE_SIZE_16, 0x0311); // Hands-Free Profile - SupportedFeatures
|
||||
de_add_number(service, DE_UINT, DE_SIZE_16, sdp_features);
|
||||
}
|
||||
|
@ -1804,9 +1804,18 @@ void hfp_hf_create_sdp_record(uint8_t * service, uint32_t service_record_handle,
|
||||
// Wide band speech (bit 5) requires Codec negotiation
|
||||
//
|
||||
uint16_t sdp_features = supported_features & 0x1f;
|
||||
if (wide_band_speech && (supported_features & (1 << HFP_HFSF_CODEC_NEGOTIATION))){
|
||||
if ( (wide_band_speech != 0) && (supported_features & (1 << HFP_HFSF_CODEC_NEGOTIATION))){
|
||||
sdp_features |= 1 << 5;
|
||||
}
|
||||
|
||||
if (supported_features & (1 << HFP_HFSF_ENHANCED_VOICE_RECOGNITION_STATUS)){
|
||||
sdp_features |= 1 << 5;
|
||||
}
|
||||
|
||||
if (supported_features & (1 << HFP_HFSF_VOICE_RECOGNITION_TEXT)){
|
||||
sdp_features |= 1 << 5;
|
||||
}
|
||||
|
||||
de_add_number(service, DE_UINT, DE_SIZE_16, 0x0311); // Hands-Free Profile - SupportedFeatures
|
||||
de_add_number(service, DE_UINT, DE_SIZE_16, sdp_features);
|
||||
}
|
||||
|
@ -595,7 +595,9 @@ int btstack_main(int argc, const char * argv[]){
|
||||
(1<<HFP_AGSF_IN_BAND_RING_TONE) |
|
||||
(1<<HFP_AGSF_VOICE_RECOGNITION_FUNCTION) |
|
||||
(1<<HFP_AGSF_THREE_WAY_CALLING) |
|
||||
(1<<HFP_AGSF_ATTACH_A_NUMBER_TO_A_VOICE_TAG);
|
||||
(1<<HFP_AGSF_ATTACH_A_NUMBER_TO_A_VOICE_TAG) |
|
||||
(1<<HFP_HFSF_ENHANCED_VOICE_RECOGNITION_STATUS) |
|
||||
(1<<HFP_HFSF_VOICE_RECOGNITION_TEXT);
|
||||
int wide_band_speech = 1;
|
||||
|
||||
// HFP
|
||||
|
@ -80,11 +80,8 @@ static void show_usage(void);
|
||||
#endif
|
||||
static hci_con_handle_t acl_handle = HCI_CON_HANDLE_INVALID;
|
||||
static hci_con_handle_t sco_handle = HCI_CON_HANDLE_INVALID;
|
||||
#ifdef ENABLE_HFP_WIDE_BAND_SPEECH
|
||||
|
||||
static uint8_t codecs[] = {HFP_CODEC_CVSD, HFP_CODEC_MSBC};
|
||||
#else
|
||||
static uint8_t codecs[] = {HFP_CODEC_CVSD};
|
||||
#endif
|
||||
static uint16_t indicators[1] = {0x01};
|
||||
static uint8_t negotiated_codec = HFP_CODEC_CVSD;
|
||||
static btstack_packet_callback_registration_t hci_event_callback_registration;
|
||||
@ -613,12 +610,14 @@ int btstack_main(int argc, const char * argv[]){
|
||||
(1<<HFP_HFSF_CODEC_NEGOTIATION) |
|
||||
(1<<HFP_HFSF_ENHANCED_CALL_STATUS) |
|
||||
(1<<HFP_HFSF_ENHANCED_CALL_CONTROL) |
|
||||
(1<<HFP_HFSF_VOICE_RECOGNITION_FUNCTION) |
|
||||
(1<<HFP_HFSF_THREE_WAY_CALLING) |
|
||||
(1<<HFP_HFSF_EC_NR_FUNCTION)|
|
||||
(1<<HFP_HFSF_REMOTE_VOLUME_CONTROL);
|
||||
int wide_band_speech = 1;
|
||||
|
||||
(1<<HFP_HFSF_VOICE_RECOGNITION_FUNCTION) |
|
||||
(1<<HFP_HFSF_THREE_WAY_CALLING) |
|
||||
(1<<HFP_HFSF_EC_NR_FUNCTION) |
|
||||
(1<<HFP_HFSF_REMOTE_VOLUME_CONTROL) |
|
||||
(1<<HFP_HFSF_ENHANCED_VOICE_RECOGNITION_STATUS) |
|
||||
(1<<HFP_HFSF_VOICE_RECOGNITION_TEXT);
|
||||
|
||||
rfcomm_init();
|
||||
hfp_hf_init(rfcomm_channel_nr);
|
||||
hfp_hf_init_supported_features(hf_supported_features);
|
||||
|
Loading…
x
Reference in New Issue
Block a user