mirror of
https://github.com/bluekitchen/btstack.git
synced 2025-02-03 20:54:18 +00:00
pass in service record handle for sdp hfp create
This commit is contained in:
parent
4bcb609897
commit
9b1c3b4d7d
@ -346,13 +346,13 @@ 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){
|
||||
void hfp_create_sdp_record(uint8_t * service, uint32_t service_record_handle, uint16_t service_uuid, int rfcomm_channel_nr, const char * name){
|
||||
uint8_t* attribute;
|
||||
de_create_sequence(service);
|
||||
|
||||
// 0x0000 "Service Record Handle"
|
||||
de_add_number(service, DE_UINT, DE_SIZE_16, SDP_ServiceRecordHandle);
|
||||
de_add_number(service, DE_UINT, DE_SIZE_32, 0x10001);
|
||||
de_add_number(service, DE_UINT, DE_SIZE_32, service_record_handle);
|
||||
|
||||
// 0x0001 "Service Class ID List"
|
||||
de_add_number(service, DE_UINT, DE_SIZE_16, SDP_ServiceClassIDList);
|
||||
|
@ -475,7 +475,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);
|
||||
void hfp_create_sdp_record(uint8_t * service, uint32_t service_record_handle, 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);
|
||||
void hfp_emit_string_event(hfp_callback_t callback, uint8_t event_subtype, const char * value);
|
||||
|
@ -168,11 +168,11 @@ static int has_hf_indicators_feature(hfp_connection_t * connection){
|
||||
return hf && ag;
|
||||
}
|
||||
|
||||
void hfp_ag_create_sdp_record(uint8_t * service, int rfcomm_channel_nr, const char * name, uint8_t ability_to_reject_call, uint16_t supported_features){
|
||||
void hfp_ag_create_sdp_record(uint8_t * service, uint32_t service_record_handle, int rfcomm_channel_nr, const char * name, uint8_t ability_to_reject_call, uint16_t supported_features){
|
||||
if (!name){
|
||||
name = default_hfp_ag_service_name;
|
||||
}
|
||||
hfp_create_sdp_record(service, SDP_HandsfreeAudioGateway, rfcomm_channel_nr, name);
|
||||
hfp_create_sdp_record(service, SDP_HandsfreeAudioGateway, service_record_handle, rfcomm_channel_nr, name);
|
||||
|
||||
/*
|
||||
* 0x01 – Ability to reject a call
|
||||
|
@ -58,7 +58,7 @@ extern "C" {
|
||||
/**
|
||||
* @brief Create HFP Audio Gateway (AG) SDP service record.
|
||||
*/
|
||||
void hfp_ag_create_sdp_record(uint8_t * service, int rfcomm_channel_nr, const char * name, uint8_t ability_to_reject_call, uint16_t supported_features);;
|
||||
void hfp_ag_create_sdp_record(uint8_t * service, uint32_t service_record_handle, int rfcomm_channel_nr, const char * name, uint8_t ability_to_reject_call, uint16_t supported_features);;
|
||||
|
||||
/**
|
||||
* @brief Intialize HFP Audio Gateway (AG) device.
|
||||
|
@ -59,7 +59,7 @@ extern "C" {
|
||||
/**
|
||||
* @brief Create HFP Hands-Free (HF) SDP service record.
|
||||
*/
|
||||
void hfp_hf_create_sdp_record(uint8_t * service, int rfcomm_channel_nr, const char * name, uint16_t supported_features);
|
||||
void hfp_hf_create_sdp_record(uint8_t * service, uint32_t service_record_handle, int rfcomm_channel_nr, const char * name, uint16_t supported_features);
|
||||
|
||||
/**
|
||||
* @brief Intialize HFP Hands-Free (HF) device.
|
||||
|
@ -145,7 +145,7 @@ void hsp_ag_create_service(uint8_t * service, uint32_t service_record_handle, in
|
||||
|
||||
// 0x0000 "Service Record Handle"
|
||||
de_add_number(service, DE_UINT, DE_SIZE_16, SDP_ServiceRecordHandle);
|
||||
de_add_number(service, DE_UINT, DE_SIZE_32, 0x10001);
|
||||
de_add_number(service, DE_UINT, DE_SIZE_32, service_record_handle);
|
||||
|
||||
// 0x0001 "Service Class ID List"
|
||||
de_add_number(service, DE_UINT, DE_SIZE_16, SDP_ServiceClassIDList);
|
||||
|
@ -70,7 +70,7 @@ static void pan_create_service(uint8_t *service, uint32_t service_record_handle,
|
||||
|
||||
// 0x0000 "Service Record Handle"
|
||||
de_add_number(service, DE_UINT, DE_SIZE_16, SDP_ServiceRecordHandle);
|
||||
de_add_number(service, DE_UINT, DE_SIZE_32, 0x10001);
|
||||
de_add_number(service, DE_UINT, DE_SIZE_32, service_record_handle);
|
||||
|
||||
// 0x0001 "Service Class ID List"
|
||||
de_add_number(service, DE_UINT, DE_SIZE_16, SDP_ServiceClassIDList);
|
||||
|
@ -380,7 +380,7 @@ int btstack_main(int argc, const char * argv[]){
|
||||
// init SDP, create record for SPP and register with SDP
|
||||
sdp_init();
|
||||
memset((uint8_t *)hfp_service_buffer, 0, sizeof(hfp_service_buffer));
|
||||
hfp_ag_create_sdp_record((uint8_t *)hfp_service_buffer, rfcomm_channel_nr, hfp_ag_service_name, 0, 0);
|
||||
hfp_ag_create_sdp_record((uint8_t *)hfp_service_buffer, 0x10005, rfcomm_channel_nr, hfp_ag_service_name, 0, 0);
|
||||
|
||||
sdp_register_service((uint8_t *)hfp_service_buffer);
|
||||
|
||||
|
@ -239,7 +239,7 @@ int btstack_main(int argc, const char * argv[]){
|
||||
// init SDP, create record for SPP and register with SDP
|
||||
sdp_init();
|
||||
memset((uint8_t *)hfp_service_buffer, 0, sizeof(hfp_service_buffer));
|
||||
hfp_hf_create_sdp_record((uint8_t *)hfp_service_buffer, rfcomm_channel_nr, hfp_hf_service_name, 0);
|
||||
hfp_hf_create_sdp_record((uint8_t *)hfp_service_buffer, 0x10006, rfcomm_channel_nr, hfp_hf_service_name, 0);
|
||||
sdp_register_service((uint8_t *)hfp_service_buffer);
|
||||
|
||||
// turn on!
|
||||
|
@ -109,10 +109,10 @@ int btstack_main(int argc, const char * argv[]){
|
||||
hsp_hs_create_service((uint8_t *)hsp_hs_service_buffer, 0x10004, 3, "HSP HS", 0);
|
||||
sdp_register_service((uint8_t *)hsp_hs_service_buffer);
|
||||
|
||||
hfp_ag_create_sdp_record((uint8_t *)hfp_ag_service_buffer, 4, "HFP AG", 0, 0);
|
||||
hfp_ag_create_sdp_record((uint8_t *)hfp_ag_service_buffer, 0x10005, 4, "HFP AG", 0, 0);
|
||||
sdp_register_service((uint8_t *)hfp_ag_service_buffer);
|
||||
|
||||
hfp_hf_create_sdp_record((uint8_t *)hfp_hf_service_buffer, 5, "HFP HS", 0);
|
||||
hfp_hf_create_sdp_record((uint8_t *)hfp_hf_service_buffer, 0x10006, 5, "HFP HS", 0);
|
||||
sdp_register_service((uint8_t *)hfp_hf_service_buffer);
|
||||
|
||||
// set CoD for all this
|
||||
|
Loading…
x
Reference in New Issue
Block a user