Loading system/include/hardware/bt_sdp.h +3 −3 Original line number Diff line number Diff line Loading @@ -57,16 +57,16 @@ typedef struct _bluetooth_sdp_hdr_overlay { bluetooth_sdp_types type; bluetooth::Uuid uuid; uint32_t service_name_length; char* service_name; const char* service_name; int32_t rfcomm_channel_number; int32_t l2cap_psm; int32_t profile_version; // User pointers, only used for some signals - see bluetooth_sdp_ops_record int user1_ptr_len; uint8_t* user1_ptr; const uint8_t* user1_ptr; int user2_ptr_len; uint8_t* user2_ptr; const uint8_t* user2_ptr; } bluetooth_sdp_hdr_overlay; typedef struct _bluetooth_sdp_mas_record { Loading system/stack/sdp/sdp_db.cc +7 −5 Original line number Diff line number Diff line Loading @@ -51,9 +51,10 @@ static bool find_uuid_in_seq(uint8_t* p, uint32_t seq_len, uint8_t* p_his_uuid, * Returns Pointer to the record, or NULL if not found. * ******************************************************************************/ tSDP_RECORD* sdp_db_service_search(tSDP_RECORD* p_rec, tSDP_UUID_SEQ* p_seq) { const tSDP_RECORD* sdp_db_service_search(const tSDP_RECORD* p_rec, tSDP_UUID_SEQ* p_seq) { uint16_t xx, yy; tSDP_ATTRIBUTE* p_attr; const tSDP_ATTRIBUTE* p_attr; tSDP_RECORD* p_end = &sdp_cb.server_db.record[sdp_cb.server_db.num_records]; /* If NULL, start at the beginning, else start at the first specified record Loading Loading @@ -167,9 +168,10 @@ tSDP_RECORD* sdp_db_find_record(uint32_t handle) { * Returns Pointer to the attribute, or NULL if not found. * ******************************************************************************/ tSDP_ATTRIBUTE* sdp_db_find_attr_in_rec(tSDP_RECORD* p_rec, uint16_t start_attr, const tSDP_ATTRIBUTE* sdp_db_find_attr_in_rec(const tSDP_RECORD* p_rec, uint16_t start_attr, uint16_t end_attr) { tSDP_ATTRIBUTE* p_at; const tSDP_ATTRIBUTE* p_at; uint16_t xx; /* Note that the attributes in a record are assumed to be in sorted order */ Loading system/stack/sdp/sdp_server.cc +5 −5 Original line number Diff line number Diff line Loading @@ -188,7 +188,7 @@ static void process_service_search(tCONN_CB* p_ccb, uint16_t trans_num, uint8_t *p_rsp, *p_rsp_start, *p_rsp_param_len; uint16_t rsp_param_len, num_rsp_handles, xx; uint32_t rsp_handles[SDP_MAX_RECORDS] = {0}; tSDP_RECORD* p_rec = NULL; const tSDP_RECORD* p_rec = NULL; bool is_cont = false; p_req = sdpu_extract_uid_seq(p_req, param_len, &uid_seq); Loading Loading @@ -317,8 +317,8 @@ static void process_service_attr_req(tCONN_CB* p_ccb, uint16_t trans_num, uint8_t *p_rsp, *p_rsp_start, *p_rsp_param_len; uint16_t rsp_param_len, xx; uint32_t rec_handle; tSDP_RECORD* p_rec; tSDP_ATTRIBUTE* p_attr; const tSDP_RECORD* p_rec; const tSDP_ATTRIBUTE* p_attr; bool is_cont = false; uint16_t attr_len; Loading Loading @@ -551,9 +551,9 @@ static void process_service_search_attr_req(tCONN_CB* p_ccb, uint16_t trans_num, tSDP_UUID_SEQ uid_seq; uint8_t *p_rsp, *p_rsp_start, *p_rsp_param_len; uint16_t rsp_param_len, xx; tSDP_RECORD* p_rec; const tSDP_RECORD* p_rec; tSDP_ATTR_SEQ attr_seq, attr_seq_sav; tSDP_ATTRIBUTE* p_attr; const tSDP_ATTRIBUTE* p_attr; tSDP_ATTRIBUTE attr_sav; bool maxxed_out = false, is_cont = false; uint8_t* p_seq_start; Loading system/stack/sdp/sdp_utils.cc +9 −7 Original line number Diff line number Diff line Loading @@ -448,7 +448,7 @@ uint8_t* sdpu_build_attrib_seq(uint8_t* p_out, uint16_t* p_attr, * Returns Pointer to next byte in the output buffer. * ******************************************************************************/ uint8_t* sdpu_build_attrib_entry(uint8_t* p_out, tSDP_ATTRIBUTE* p_attr) { uint8_t* sdpu_build_attrib_entry(uint8_t* p_out, const tSDP_ATTRIBUTE* p_attr) { /* First, store the attribute ID. Goes as a UINT */ UINT8_TO_BE_STREAM(p_out, (UINT_DESC_TYPE << 3) | SIZE_TWO_BYTES); UINT16_TO_BE_STREAM(p_out, p_attr->id); Loading Loading @@ -1004,7 +1004,7 @@ void sdpu_sort_attr_list(uint16_t num_attr, tSDP_DISCOVERY_DB* p_db) { * ******************************************************************************/ uint16_t sdpu_get_list_len(tSDP_UUID_SEQ* uid_seq, tSDP_ATTR_SEQ* attr_seq) { tSDP_RECORD* p_rec; const tSDP_RECORD* p_rec; uint16_t len = 0; uint16_t len1; Loading Loading @@ -1032,8 +1032,9 @@ uint16_t sdpu_get_list_len(tSDP_UUID_SEQ* uid_seq, tSDP_ATTR_SEQ* attr_seq) { * Returns void * ******************************************************************************/ uint16_t sdpu_get_attrib_seq_len(tSDP_RECORD* p_rec, tSDP_ATTR_SEQ* attr_seq) { tSDP_ATTRIBUTE* p_attr; uint16_t sdpu_get_attrib_seq_len(const tSDP_RECORD* p_rec, tSDP_ATTR_SEQ* attr_seq) { const tSDP_ATTRIBUTE* p_attr; uint16_t len1 = 0; uint16_t xx; bool is_range = false; Loading Loading @@ -1071,7 +1072,7 @@ uint16_t sdpu_get_attrib_seq_len(tSDP_RECORD* p_rec, tSDP_ATTR_SEQ* attr_seq) { * Returns void * ******************************************************************************/ uint16_t sdpu_get_attrib_entry_len(tSDP_ATTRIBUTE* p_attr) { uint16_t sdpu_get_attrib_entry_len(const tSDP_ATTRIBUTE* p_attr) { uint16_t len = 3; /* the attribute is in the db record. Loading Loading @@ -1133,7 +1134,8 @@ uint16_t sdpu_get_attrib_entry_len(tSDP_ATTRIBUTE* p_attr) { * offset is also updated * ******************************************************************************/ uint8_t* sdpu_build_partial_attrib_entry(uint8_t* p_out, tSDP_ATTRIBUTE* p_attr, uint8_t* sdpu_build_partial_attrib_entry(uint8_t* p_out, const tSDP_ATTRIBUTE* p_attr, uint16_t len, uint16_t* offset) { uint8_t* p_attr_buff = (uint8_t*)osi_malloc(sizeof(uint8_t) * SDP_MAX_ATTR_LEN); Loading Loading @@ -1168,7 +1170,7 @@ uint8_t* sdpu_build_partial_attrib_entry(uint8_t* p_out, tSDP_ATTRIBUTE* p_attr, * Returns AVRCP profile version if matched, else 0 * ******************************************************************************/ uint16_t sdpu_is_avrcp_profile_description_list(tSDP_ATTRIBUTE* p_attr) { uint16_t sdpu_is_avrcp_profile_description_list(const tSDP_ATTRIBUTE* p_attr) { if (p_attr->id != ATTR_ID_BT_PROFILE_DESC_LIST || p_attr->len != 8) { return 0; } Loading system/stack/sdp/sdpint.h +14 −12 Original line number Diff line number Diff line Loading @@ -114,8 +114,8 @@ typedef struct { uint16_t next_attr_index; /* attr index for next continuation response */ uint16_t next_attr_start_id; /* attr id to start with for the attr index in next cont. response */ tSDP_RECORD* prev_sdp_rec; /* last sdp record that was completely sent in the response */ const tSDP_RECORD* prev_sdp_rec; /* last sdp record that was completely sent in the response */ bool last_attr_seq_desc_sent; /* whether attr seq length has been sent previously */ uint16_t attr_offset; /* offset within the attr to keep trak of partial Loading Loading @@ -203,7 +203,8 @@ extern void sdpu_release_ccb(tCONN_CB* p_ccb); extern uint8_t* sdpu_build_attrib_seq(uint8_t* p_out, uint16_t* p_attr, uint16_t num_attrs); extern uint8_t* sdpu_build_attrib_entry(uint8_t* p_out, tSDP_ATTRIBUTE* p_attr); extern uint8_t* sdpu_build_attrib_entry(uint8_t* p_out, const tSDP_ATTRIBUTE* p_attr); extern void sdpu_build_n_send_error(tCONN_CB* p_ccb, uint16_t trans_num, uint16_t error_code, char* p_error_text); Loading @@ -223,20 +224,21 @@ extern bool sdpu_compare_uuid_with_attr(const bluetooth::Uuid& uuid, extern void sdpu_sort_attr_list(uint16_t num_attr, tSDP_DISCOVERY_DB* p_db); extern uint16_t sdpu_get_list_len(tSDP_UUID_SEQ* uid_seq, tSDP_ATTR_SEQ* attr_seq); extern uint16_t sdpu_get_attrib_seq_len(tSDP_RECORD* p_rec, extern uint16_t sdpu_get_attrib_seq_len(const tSDP_RECORD* p_rec, tSDP_ATTR_SEQ* attr_seq); extern uint16_t sdpu_get_attrib_entry_len(tSDP_ATTRIBUTE* p_attr); extern uint16_t sdpu_get_attrib_entry_len(const tSDP_ATTRIBUTE* p_attr); extern uint8_t* sdpu_build_partial_attrib_entry(uint8_t* p_out, tSDP_ATTRIBUTE* p_attr, const tSDP_ATTRIBUTE* p_attr, uint16_t len, uint16_t* offset); extern uint16_t sdpu_is_avrcp_profile_description_list(tSDP_ATTRIBUTE* p_attr); extern uint16_t sdpu_is_avrcp_profile_description_list( const tSDP_ATTRIBUTE* p_attr); /* Functions provided by sdp_db.cc */ extern tSDP_RECORD* sdp_db_service_search(tSDP_RECORD* p_rec, extern const tSDP_RECORD* sdp_db_service_search(const tSDP_RECORD* p_rec, tSDP_UUID_SEQ* p_seq); extern tSDP_RECORD* sdp_db_find_record(uint32_t handle); extern tSDP_ATTRIBUTE* sdp_db_find_attr_in_rec(tSDP_RECORD* p_rec, extern const tSDP_ATTRIBUTE* sdp_db_find_attr_in_rec(const tSDP_RECORD* p_rec, uint16_t start_attr, uint16_t end_attr); Loading Loading
system/include/hardware/bt_sdp.h +3 −3 Original line number Diff line number Diff line Loading @@ -57,16 +57,16 @@ typedef struct _bluetooth_sdp_hdr_overlay { bluetooth_sdp_types type; bluetooth::Uuid uuid; uint32_t service_name_length; char* service_name; const char* service_name; int32_t rfcomm_channel_number; int32_t l2cap_psm; int32_t profile_version; // User pointers, only used for some signals - see bluetooth_sdp_ops_record int user1_ptr_len; uint8_t* user1_ptr; const uint8_t* user1_ptr; int user2_ptr_len; uint8_t* user2_ptr; const uint8_t* user2_ptr; } bluetooth_sdp_hdr_overlay; typedef struct _bluetooth_sdp_mas_record { Loading
system/stack/sdp/sdp_db.cc +7 −5 Original line number Diff line number Diff line Loading @@ -51,9 +51,10 @@ static bool find_uuid_in_seq(uint8_t* p, uint32_t seq_len, uint8_t* p_his_uuid, * Returns Pointer to the record, or NULL if not found. * ******************************************************************************/ tSDP_RECORD* sdp_db_service_search(tSDP_RECORD* p_rec, tSDP_UUID_SEQ* p_seq) { const tSDP_RECORD* sdp_db_service_search(const tSDP_RECORD* p_rec, tSDP_UUID_SEQ* p_seq) { uint16_t xx, yy; tSDP_ATTRIBUTE* p_attr; const tSDP_ATTRIBUTE* p_attr; tSDP_RECORD* p_end = &sdp_cb.server_db.record[sdp_cb.server_db.num_records]; /* If NULL, start at the beginning, else start at the first specified record Loading Loading @@ -167,9 +168,10 @@ tSDP_RECORD* sdp_db_find_record(uint32_t handle) { * Returns Pointer to the attribute, or NULL if not found. * ******************************************************************************/ tSDP_ATTRIBUTE* sdp_db_find_attr_in_rec(tSDP_RECORD* p_rec, uint16_t start_attr, const tSDP_ATTRIBUTE* sdp_db_find_attr_in_rec(const tSDP_RECORD* p_rec, uint16_t start_attr, uint16_t end_attr) { tSDP_ATTRIBUTE* p_at; const tSDP_ATTRIBUTE* p_at; uint16_t xx; /* Note that the attributes in a record are assumed to be in sorted order */ Loading
system/stack/sdp/sdp_server.cc +5 −5 Original line number Diff line number Diff line Loading @@ -188,7 +188,7 @@ static void process_service_search(tCONN_CB* p_ccb, uint16_t trans_num, uint8_t *p_rsp, *p_rsp_start, *p_rsp_param_len; uint16_t rsp_param_len, num_rsp_handles, xx; uint32_t rsp_handles[SDP_MAX_RECORDS] = {0}; tSDP_RECORD* p_rec = NULL; const tSDP_RECORD* p_rec = NULL; bool is_cont = false; p_req = sdpu_extract_uid_seq(p_req, param_len, &uid_seq); Loading Loading @@ -317,8 +317,8 @@ static void process_service_attr_req(tCONN_CB* p_ccb, uint16_t trans_num, uint8_t *p_rsp, *p_rsp_start, *p_rsp_param_len; uint16_t rsp_param_len, xx; uint32_t rec_handle; tSDP_RECORD* p_rec; tSDP_ATTRIBUTE* p_attr; const tSDP_RECORD* p_rec; const tSDP_ATTRIBUTE* p_attr; bool is_cont = false; uint16_t attr_len; Loading Loading @@ -551,9 +551,9 @@ static void process_service_search_attr_req(tCONN_CB* p_ccb, uint16_t trans_num, tSDP_UUID_SEQ uid_seq; uint8_t *p_rsp, *p_rsp_start, *p_rsp_param_len; uint16_t rsp_param_len, xx; tSDP_RECORD* p_rec; const tSDP_RECORD* p_rec; tSDP_ATTR_SEQ attr_seq, attr_seq_sav; tSDP_ATTRIBUTE* p_attr; const tSDP_ATTRIBUTE* p_attr; tSDP_ATTRIBUTE attr_sav; bool maxxed_out = false, is_cont = false; uint8_t* p_seq_start; Loading
system/stack/sdp/sdp_utils.cc +9 −7 Original line number Diff line number Diff line Loading @@ -448,7 +448,7 @@ uint8_t* sdpu_build_attrib_seq(uint8_t* p_out, uint16_t* p_attr, * Returns Pointer to next byte in the output buffer. * ******************************************************************************/ uint8_t* sdpu_build_attrib_entry(uint8_t* p_out, tSDP_ATTRIBUTE* p_attr) { uint8_t* sdpu_build_attrib_entry(uint8_t* p_out, const tSDP_ATTRIBUTE* p_attr) { /* First, store the attribute ID. Goes as a UINT */ UINT8_TO_BE_STREAM(p_out, (UINT_DESC_TYPE << 3) | SIZE_TWO_BYTES); UINT16_TO_BE_STREAM(p_out, p_attr->id); Loading Loading @@ -1004,7 +1004,7 @@ void sdpu_sort_attr_list(uint16_t num_attr, tSDP_DISCOVERY_DB* p_db) { * ******************************************************************************/ uint16_t sdpu_get_list_len(tSDP_UUID_SEQ* uid_seq, tSDP_ATTR_SEQ* attr_seq) { tSDP_RECORD* p_rec; const tSDP_RECORD* p_rec; uint16_t len = 0; uint16_t len1; Loading Loading @@ -1032,8 +1032,9 @@ uint16_t sdpu_get_list_len(tSDP_UUID_SEQ* uid_seq, tSDP_ATTR_SEQ* attr_seq) { * Returns void * ******************************************************************************/ uint16_t sdpu_get_attrib_seq_len(tSDP_RECORD* p_rec, tSDP_ATTR_SEQ* attr_seq) { tSDP_ATTRIBUTE* p_attr; uint16_t sdpu_get_attrib_seq_len(const tSDP_RECORD* p_rec, tSDP_ATTR_SEQ* attr_seq) { const tSDP_ATTRIBUTE* p_attr; uint16_t len1 = 0; uint16_t xx; bool is_range = false; Loading Loading @@ -1071,7 +1072,7 @@ uint16_t sdpu_get_attrib_seq_len(tSDP_RECORD* p_rec, tSDP_ATTR_SEQ* attr_seq) { * Returns void * ******************************************************************************/ uint16_t sdpu_get_attrib_entry_len(tSDP_ATTRIBUTE* p_attr) { uint16_t sdpu_get_attrib_entry_len(const tSDP_ATTRIBUTE* p_attr) { uint16_t len = 3; /* the attribute is in the db record. Loading Loading @@ -1133,7 +1134,8 @@ uint16_t sdpu_get_attrib_entry_len(tSDP_ATTRIBUTE* p_attr) { * offset is also updated * ******************************************************************************/ uint8_t* sdpu_build_partial_attrib_entry(uint8_t* p_out, tSDP_ATTRIBUTE* p_attr, uint8_t* sdpu_build_partial_attrib_entry(uint8_t* p_out, const tSDP_ATTRIBUTE* p_attr, uint16_t len, uint16_t* offset) { uint8_t* p_attr_buff = (uint8_t*)osi_malloc(sizeof(uint8_t) * SDP_MAX_ATTR_LEN); Loading Loading @@ -1168,7 +1170,7 @@ uint8_t* sdpu_build_partial_attrib_entry(uint8_t* p_out, tSDP_ATTRIBUTE* p_attr, * Returns AVRCP profile version if matched, else 0 * ******************************************************************************/ uint16_t sdpu_is_avrcp_profile_description_list(tSDP_ATTRIBUTE* p_attr) { uint16_t sdpu_is_avrcp_profile_description_list(const tSDP_ATTRIBUTE* p_attr) { if (p_attr->id != ATTR_ID_BT_PROFILE_DESC_LIST || p_attr->len != 8) { return 0; } Loading
system/stack/sdp/sdpint.h +14 −12 Original line number Diff line number Diff line Loading @@ -114,8 +114,8 @@ typedef struct { uint16_t next_attr_index; /* attr index for next continuation response */ uint16_t next_attr_start_id; /* attr id to start with for the attr index in next cont. response */ tSDP_RECORD* prev_sdp_rec; /* last sdp record that was completely sent in the response */ const tSDP_RECORD* prev_sdp_rec; /* last sdp record that was completely sent in the response */ bool last_attr_seq_desc_sent; /* whether attr seq length has been sent previously */ uint16_t attr_offset; /* offset within the attr to keep trak of partial Loading Loading @@ -203,7 +203,8 @@ extern void sdpu_release_ccb(tCONN_CB* p_ccb); extern uint8_t* sdpu_build_attrib_seq(uint8_t* p_out, uint16_t* p_attr, uint16_t num_attrs); extern uint8_t* sdpu_build_attrib_entry(uint8_t* p_out, tSDP_ATTRIBUTE* p_attr); extern uint8_t* sdpu_build_attrib_entry(uint8_t* p_out, const tSDP_ATTRIBUTE* p_attr); extern void sdpu_build_n_send_error(tCONN_CB* p_ccb, uint16_t trans_num, uint16_t error_code, char* p_error_text); Loading @@ -223,20 +224,21 @@ extern bool sdpu_compare_uuid_with_attr(const bluetooth::Uuid& uuid, extern void sdpu_sort_attr_list(uint16_t num_attr, tSDP_DISCOVERY_DB* p_db); extern uint16_t sdpu_get_list_len(tSDP_UUID_SEQ* uid_seq, tSDP_ATTR_SEQ* attr_seq); extern uint16_t sdpu_get_attrib_seq_len(tSDP_RECORD* p_rec, extern uint16_t sdpu_get_attrib_seq_len(const tSDP_RECORD* p_rec, tSDP_ATTR_SEQ* attr_seq); extern uint16_t sdpu_get_attrib_entry_len(tSDP_ATTRIBUTE* p_attr); extern uint16_t sdpu_get_attrib_entry_len(const tSDP_ATTRIBUTE* p_attr); extern uint8_t* sdpu_build_partial_attrib_entry(uint8_t* p_out, tSDP_ATTRIBUTE* p_attr, const tSDP_ATTRIBUTE* p_attr, uint16_t len, uint16_t* offset); extern uint16_t sdpu_is_avrcp_profile_description_list(tSDP_ATTRIBUTE* p_attr); extern uint16_t sdpu_is_avrcp_profile_description_list( const tSDP_ATTRIBUTE* p_attr); /* Functions provided by sdp_db.cc */ extern tSDP_RECORD* sdp_db_service_search(tSDP_RECORD* p_rec, extern const tSDP_RECORD* sdp_db_service_search(const tSDP_RECORD* p_rec, tSDP_UUID_SEQ* p_seq); extern tSDP_RECORD* sdp_db_find_record(uint32_t handle); extern tSDP_ATTRIBUTE* sdp_db_find_attr_in_rec(tSDP_RECORD* p_rec, extern const tSDP_ATTRIBUTE* sdp_db_find_attr_in_rec(const tSDP_RECORD* p_rec, uint16_t start_attr, uint16_t end_attr); Loading