fix SDP records for HFP HF/AG

This commit is contained in:
Matthias Ringwald 2015-11-18 16:34:09 +01:00
parent ba7fd8c4e5
commit d59a7e7577
4 changed files with 16 additions and 10 deletions

View File

@ -323,6 +323,10 @@ static hfp_connection_t * provide_hfp_connection_context_for_bd_addr(bd_addr_t b
return context;
}
/* @param network.
* 0 == no ability to reject a call.
* 1 == ability to reject a call.
*/
/* @param suported_features
* HF bit 0: EC and/or NR function (yes/no, 1 = yes, 0 = no)
@ -341,8 +345,7 @@ static hfp_connection_t * provide_hfp_connection_context_for_bd_addr(bd_addr_t b
* AG bit 5: Wide band speech (yes/no, 1 = yes, 0 = no)
*/
void hfp_create_sdp_record(uint8_t * service, uint16_t service_uuid, int rfcomm_channel_nr, const char * name, uint16_t supported_features){
void hfp_create_sdp_record(uint8_t * service, uint16_t service_uuid, int rfcomm_channel_nr, const char * name){
uint8_t* attribute;
de_create_sequence(service);
@ -404,8 +407,6 @@ void hfp_create_sdp_record(uint8_t * service, uint16_t service_uuid, int rfcomm_
// 0x0100 "Service Name"
de_add_number(service, DE_UINT, DE_SIZE_16, 0x0100);
de_add_data(service, DE_STRING, strlen(name), (uint8_t *) name);
de_add_number(service, DE_UINT, DE_SIZE_16, supported_features);
}
static hfp_connection_t * connection_doing_sdp_query = NULL;

View File

@ -411,7 +411,7 @@ int get_bit(uint16_t bitmap, int position);
int store_bit(uint32_t bitmap, int position, uint8_t value);
// UTILS_END
void hfp_create_sdp_record(uint8_t * service, uint16_t service_uuid, int rfcomm_channel_nr, const char * name, uint16_t supported_features);
void hfp_create_sdp_record(uint8_t * service, uint16_t service_uuid, int rfcomm_channel_nr, const char * name);
void hfp_handle_hci_event(hfp_callback_t callback, uint8_t packet_type, uint8_t *packet, uint16_t size);
void hfp_emit_event(hfp_callback_t callback, uint8_t event_subtype, uint8_t value);

View File

@ -150,14 +150,17 @@ void hfp_ag_create_sdp_record(uint8_t * service, int rfcomm_channel_nr, const ch
if (!name){
name = default_hfp_ag_service_name;
}
hfp_create_sdp_record(service, SDP_HandsfreeAudioGateway, rfcomm_channel_nr, name, supported_features);
hfp_create_sdp_record(service, SDP_HandsfreeAudioGateway, rfcomm_channel_nr, name);
// Network
de_add_number(service, DE_UINT, DE_SIZE_8, ability_to_reject_call);
/*
* 0x01 Ability to reject a call
* 0x00 No ability to reject a call
*/
de_add_number(service, DE_UINT, DE_SIZE_16, 0x0301); // Hands-Free Profile - Network
de_add_number(service, DE_UINT, DE_SIZE_8, ability_to_reject_call);
de_add_number(service, DE_UINT, DE_SIZE_16, 0x0311); // Hands-Free Profile - SupportedFeatures
de_add_number(service, DE_UINT, DE_SIZE_16, supported_features);
}
static int hfp_ag_exchange_supported_features_cmd(uint16_t cid){

View File

@ -114,9 +114,11 @@ void hfp_hf_create_sdp_record(uint8_t * service, int rfcomm_channel_nr, const ch
if (!name){
name = default_hfp_hf_service_name;
}
hfp_create_sdp_record(service, SDP_Handsfree, rfcomm_channel_nr, name, supported_features);
}
hfp_create_sdp_record(service, SDP_Handsfree, rfcomm_channel_nr, name);
de_add_number(service, DE_UINT, DE_SIZE_16, 0x0311); // Hands-Free Profile - SupportedFeatures
de_add_number(service, DE_UINT, DE_SIZE_16, supported_features);
}
static int hfp_hf_cmd_exchange_supported_features(uint16_t cid){
char buffer[20];