hfp hf docu

This commit is contained in:
Milanka Ringwald 2016-02-18 10:32:37 +01:00
parent 0c086799a0
commit e424899e4e
5 changed files with 23 additions and 18 deletions

View File

@ -758,7 +758,7 @@ extern "C" {
#define HFP_SUBEVENT_CALL_WAITING_NOTIFICATION 0x18
#define HFP_SUBEVENT_CALLING_LINE_INDETIFICATION_NOTIFICATION 0x19
#define HFP_SUBEVENT_ENHANCED_CALL_STATUS 0x1A
#define HFP_SUBEVENT_SUBSCRIBER_NUMBER_INFORMATION 0x1B
// ANCS Client
#define ANCS_CLIENT_CONNECTED 0xF0

View File

@ -1063,15 +1063,15 @@ void hfp_hf_set_supported_features(uint32_t supported_features){
hfp_supported_features = supported_features;
}
void hfp_hf_set_indicators(int indicators_nr, uint16_t * indicators){
void hfp_hf_set_hf_indicators(int indicators_nr, uint16_t * indicators){
hfp_indicators_nr = indicators_nr;
int i;
for (i=0; i<indicators_nr; i++){
for (i = 0; i < hfp_indicators_nr ; i++){
hfp_indicators[i] = indicators[i];
}
}
void hfp_hf_set_indicators_status(uint32_t indicators_status){
void hfp_hf_set_hf_indicators_status(uint32_t indicators_status){
hfp_indicators_status = indicators_status;
}
@ -1543,9 +1543,11 @@ void hfp_hf_set_hf_indicator(bd_addr_t addr, int assigned_number, int value){
// set value
hfp_indicators_value[i] = value;
// mark for update
connection->generic_status_update_bitmap |= (1<<i);
// send update
hfp_run_for_context(connection);
if (connection->state > HFP_LIST_GENERIC_STATUS_INDICATORS){
connection->generic_status_update_bitmap |= (1<<i);
// send update
hfp_run_for_context(connection);
}
return;
}
}

View File

@ -91,15 +91,16 @@ void hfp_hf_set_supported_features(uint32_t supported_features);
*
* @param indicators_nr
* @param indicators
* @param values
*/
void hfp_hf_set_indicators(int indicators_nr, uint16_t * indicators);
void hfp_hf_set_hf_indicators(int indicators_nr, uint16_t * indicators);
/**
* @brief Set HF indicators status bitmap.
*
* @param indicators_status 32-bit bitmap, 0 - indicator is disabled, 1 - indicator is enabled
*/
void hfp_hf_set_indicators_status(uint32_t indicators_status);
void hfp_hf_set_hf_indicators_status(uint32_t indicators_status);
/**
* @brief Register callback for the HFP Hands-Free (HF) client.
@ -384,38 +385,40 @@ void hfp_hf_release_call_with_index(bd_addr_t addr, int index);
void hfp_hf_private_consultation_with_call(bd_addr_t addr, int index);
/*
* @brief
* @brief Query the status of the Response and Hold state of the AG.
* @param bd_addr Bluetooth address of the AG
*/
void hfp_hf_rrh_query_status(bd_addr_t addr);
/*
* @brief
* @brief Put an incoming call on hold in the AG.
* @param bd_addr Bluetooth address of the AG
*/
void hfp_hf_rrh_hold_call(bd_addr_t addr);
/*
* @brief
* @brief Accept held incoming call in the AG.
* @param bd_addr Bluetooth address of the AG
*/
void hfp_hf_rrh_accept_held_call(bd_addr_t addr);
/*
* @brief
* @brief Reject held incoming call in the AG.
* @param bd_addr Bluetooth address of the AG
*/
void hfp_hf_rrh_reject_held_call(bd_addr_t addr);
/*
* @brief
* @brief Query the AG subscriber number.
* @param bd_addr Bluetooth address of the AG
*/
void hfp_hf_query_subscriber_number(bd_addr_t addr);
/*
* @brief
* @brief Set HF indicator.
* @param bd_addr Bluetooth address of the AG
* @param assigned_number
* @param value
*/
void hfp_hf_set_hf_indicator(bd_addr_t addr, int assigned_number, int value);

View File

@ -483,8 +483,8 @@ TEST_GROUP(HFPClient){
hfp_hf_init(rfcomm_channel_nr);
hfp_hf_set_supported_features(supported_features_with_codec_negotiation);
hfp_hf_set_indicators(sizeof(indicators)/sizeof(uint16_t), indicators);
hfp_hf_set_indicators_status(1);
hfp_hf_set_hf_indicators(sizeof(indicators)/sizeof(uint16_t), indicators);
hfp_hf_set_hf_indicators_status(1);
hfp_hf_set_codecs(sizeof(codecs), codecs);
}

View File

@ -536,7 +536,7 @@ int btstack_main(int argc, const char * argv[]){
// hfp_hf_init(rfcomm_channel_nr, HFP_DEFAULT_HF_SUPPORTED_FEATURES, codecs, sizeof(codecs), indicators, sizeof(indicators)/sizeof(uint16_t), 1);
hfp_hf_init(rfcomm_channel_nr);
hfp_hf_set_supported_features(438 | (1<<HFP_HFSF_ESCO_S4) | (1<<HFP_HFSF_EC_NR_FUNCTION));
hfp_hf_set_indicators(sizeof(indicators)/sizeof(uint16_t), indicators);
hfp_hf_set_hf_indicators(sizeof(indicators)/sizeof(uint16_t), indicators, hf_indicators_values);
hfp_hf_set_codecs(sizeof(codecs), codecs);
hfp_hf_set_indicators_status(1);