Lines Matching full:p_ccb
53 static void process_service_search (tCONN_CB *p_ccb, UINT16 trans_num,
57 static void process_service_attr_req (tCONN_CB *p_ccb, UINT16 trans_num,
61 static void process_service_search_attr_req (tCONN_CB *p_ccb, UINT16 trans_num,
115 void sdp_server_handle_client_req (tCONN_CB *p_ccb, BT_HDR *p_msg)
124 btu_start_timer (&p_ccb->timer_entry, BTU_TTYPE_SDP, SDP_INACT_TIMEOUT);
135 sdpu_build_n_send_error (p_ccb, trans_num, SDP_INVALID_PDU_SIZE, SDP_TEXT_BAD_HEADER);
142 process_service_search (p_ccb, trans_num, param_len, p_req, p_req_end);
146 process_service_attr_req (p_ccb, trans_num, param_len, p_req, p_req_end);
150 process_service_search_attr_req (p_ccb, trans_num, param_len, p_req, p_req_end);
154 sdpu_build_n_send_error (p_ccb, trans_num, SDP_INVALID_REQ_SYNTAX, SDP_TEXT_BAD_PDU);
173 static void process_service_search (tCONN_CB *p_ccb, UINT16 trans_num,
191 sdpu_build_n_send_error (p_ccb, trans_num, SDP_INVALID_REQ_SYNTAX, SDP_TEXT_BAD_UUID_LIST);
204 sdpu_build_n_send_error (p_ccb, trans_num, SDP_INVALID_REQ_SYNTAX, SDP_TEXT_BAD_MAX_RECORDS_LIST);
225 sdpu_build_n_send_error (p_ccb, trans_num, SDP_INVALID_CONT_STATE,
231 if (cont_offset != p_ccb->cont_offset)
233 sdpu_build_n_send_error (p_ccb, trans_num, SDP_INVALID_CONT_STATE,
247 cur_handles = (UINT16)((p_ccb->rem_mtu_size - SDP_MAX_SERVICE_RSPHDR_LEN) / 4);
253 p_ccb->cont_offset += cur_handles;
287 UINT16_TO_BE_STREAM (p_rsp, p_ccb->cont_offset);
301 L2CA_DataWrite (p_ccb->connection_id, p_buf);
316 static void process_service_attr_req (tCONN_CB *p_ccb, UINT16 trans_num,
337 sdpu_build_n_send_error (p_ccb, trans_num, SDP_INVALID_SERV_REC_HDL, SDP_TEXT_BAD_HANDLE);
344 if (max_list_len > (p_ccb->rem_mtu_size - SDP_MAX_ATTR_RSPHDR_LEN))
345 max_list_len = p_ccb->rem_mtu_size - SDP_MAX_ATTR_RSPHDR_LEN;
351 sdpu_build_n_send_error (p_ccb, trans_num, SDP_INVALID_REQ_SYNTAX, SDP_TEXT_BAD_ATTR_LIST);
361 sdpu_build_n_send_error (p_ccb, trans_num, SDP_INVALID_SERV_REC_HDL, SDP_TEXT_BAD_HANDLE);
370 sdpu_build_n_send_error (p_ccb, trans_num, SDP_INVALID_CONT_STATE, SDP_TEXT_BAD_CONT_LEN);
375 if (cont_offset != p_ccb->cont_offset)
377 sdpu_build_n_send_error (p_ccb, trans_num, SDP_INVALID_CONT_STATE, SDP_TEXT_BAD_CONT_INX);
381 if (!p_ccb->rsp_list)
383 sdpu_build_n_send_error (p_ccb, trans_num, SDP_NO_RESOURCES, NULL);
389 p_rsp = &p_ccb->rsp_list[0];
390 attr_seq.attr_entry[p_ccb->cont_info.next_attr_index].start = p_ccb->cont_info.next_attr_start_id;
395 if (!p_ccb->rsp_list || (GKI_get_buf_size(p_ccb->rsp_list) < max_list_len))
398 if (p_ccb->rsp_list)
400 GKI_freebuf (p_ccb->rsp_list);
403 p_ccb->rsp_list = (UINT8 *)GKI_getbuf (max_list_len);
404 if (p_ccb->rsp_list == NULL)
411 p_ccb->cont_offset = 0;
412 p_rsp = &p_ccb->rsp_list[3]; /* Leave space for data elem descr */
414 /* Reset continuation parameters in p_ccb */
415 p_ccb->cont_info.prev_sdp_rec = NULL;
416 p_ccb->cont_info.next_attr_index = 0;
417 p_ccb->cont_info.attr_offset = 0;
421 for (xx = p_ccb->cont_info.next_attr_index; xx < attr_seq.num_attr; xx++)
428 rem_len = max_list_len - (INT16) (p_rsp - &p_ccb->rsp_list[0]);
433 p_ccb->cont_info.next_attr_index = xx;
434 p_ccb->cont_info.next_attr_start_id = p_attr->id;
440 if (p_ccb->cont_info.attr_offset)
443 &p_ccb->cont_info.attr_offset);
446 if (p_ccb->cont_info.attr_offset != attr_len)
449 p_ccb->cont_info.attr_offset = 0; /* reset attr_offset */
456 sdpu_build_n_send_error (p_ccb, trans_num, SDP_NO_RESOURCES, NULL);
462 &p_ccb->cont_info.attr_offset);
464 p_ccb->cont_info.next_attr_index = xx;
465 p_ccb->cont_info.next_attr_start_id = p_attr->id;
484 p_ccb->cont_info.next_attr_index = 0;
486 len_to_send = (UINT16) (p_rsp - &p_ccb->rsp_list[0]);
491 p_ccb->list_len = sdpu_get_attrib_seq_len(p_rec, &attr_seq_sav) + 3;
493 if (p_ccb->list_len > 255)
495 p_ccb->rsp_list[0] = (UINT8) ((DATA_ELE_SEQ_DESC_TYPE << 3) | SIZE_IN_NEXT_WORD);
496 p_ccb->rsp_list[1] = (UINT8) ((p_ccb->list_len - 3) >> 8);
497 p_ccb->rsp_list[2] = (UINT8) (p_ccb->list_len - 3);
503 p_ccb->rsp_list[1] = (UINT8) ((DATA_ELE_SEQ_DESC_TYPE << 3) | SIZE_IN_NEXT_BYTE);
504 p_ccb->rsp_list[2] = (UINT8) (p_ccb->list_len - 3);
506 p_ccb->list_len--;
530 memcpy (p_rsp, &p_ccb->rsp_list[cont_offset], len_to_send);
533 p_ccb->cont_offset += len_to_send;
536 if (p_ccb->cont_offset < p_ccb->list_len)
541 UINT16_TO_BE_STREAM (p_rsp, p_ccb->cont_offset);
555 L2CA_DataWrite (p_ccb->connection_id, p_buf);
571 static void process_service_search_attr_req (tCONN_CB *p_ccb, UINT16 trans_num,
595 sdpu_build_n_send_error (p_ccb, trans_num, SDP_INVALID_REQ_SYNTAX, SDP_TEXT_BAD_UUID_LIST);
602 if (max_list_len > (p_ccb->rem_mtu_size - SDP_MAX_SERVATTR_RSPHDR_LEN))
603 max_list_len = p_ccb->rem_mtu_size - SDP_MAX_SERVATTR_RSPHDR_LEN;
609 sdpu_build_n_send_error (p_ccb, trans_num, SDP_INVALID_REQ_SYNTAX, SDP_TEXT_BAD_ATTR_LIST);
620 sdpu_build_n_send_error (p_ccb, trans_num, SDP_INVALID_CONT_STATE, SDP_TEXT_BAD_CONT_LEN);
625 if (cont_offset != p_ccb->cont_offset)
627 sdpu_build_n_send_error (p_ccb, trans_num, SDP_INVALID_CONT_STATE, SDP_TEXT_BAD_CONT_INX);
631 if (!p_ccb->rsp_list)
633 sdpu_build_n_send_error (p_ccb, trans_num, SDP_NO_RESOURCES, NULL);
639 p_rsp = &p_ccb->rsp_list[0];
640 attr_seq.attr_entry[p_ccb->cont_info.next_attr_index].start = p_ccb->cont_info.next_attr_start_id;
645 if (!p_ccb->rsp_list || (GKI_get_buf_size(p_ccb->rsp_list) < max_list_len))
648 if (p_ccb->rsp_list)
650 GKI_freebuf (p_ccb->rsp_list);
653 p_ccb->rsp_list = (UINT8 *)GKI_getbuf (max_list_len);
654 if (p_ccb->rsp_list == NULL)
661 p_ccb->cont_offset = 0;
662 p_rsp = &p_ccb->rsp_list[3]; /* Leave space for data elem descr */
664 /* Reset continuation parameters in p_ccb */
665 p_ccb->cont_info.prev_sdp_rec = NULL;
666 p_ccb->cont_info.next_attr_index = 0;
667 p_ccb->cont_info.last_attr_seq_desc_sent = FALSE;
668 p_ccb->cont_info.attr_offset = 0;
672 for (p_rec = sdp_db_service_search (p_ccb->cont_info.prev_sdp_rec, &uid_seq); p_rec; p_rec = sdp_db_service_search (p_rec, &uid_seq))
676 if (p_ccb->cont_info.last_attr_seq_desc_sent == FALSE)
679 rem_len = max_list_len - (INT16) (p_rsp - &p_ccb->rsp_list[0]);
683 p_ccb->cont_info.next_attr_index = 0;
684 p_ccb->cont_info.next_attr_start_id = attr_seq.attr_entry[0].start;
691 for (xx = p_ccb->cont_info.next_attr_index; xx < attr_seq.num_attr; xx++)
698 rem_len = max_list_len - (INT16) (p_rsp - &p_ccb->rsp_list[0]);
703 p_ccb->cont_info.next_attr_index = xx;
704 p_ccb->cont_info.next_attr_start_id = p_attr->id;
711 if (p_ccb->cont_info.attr_offset)
714 &p_ccb->cont_info.attr_offset);
717 if (p_ccb->cont_info.attr_offset != attr_len)
723 p_ccb->cont_info.attr_offset = 0; /* reset attr_offset */
730 sdpu_build_n_send_error (p_ccb, trans_num, SDP_NO_RESOURCES, NULL);
736 &p_ccb->cont_info.attr_offset);
738 p_ccb->cont_info.next_attr_index = xx;
739 p_ccb->cont_info.next_attr_start_id = p_attr->id;
758 if (p_ccb->cont_info.last_attr_seq_desc_sent == FALSE)
767 p_ccb->cont_info.last_attr_seq_desc_sent = TRUE;
780 p_ccb->cont_info.next_attr_index = 0;
781 p_ccb->cont_info.prev_sdp_rec = p_rec;
782 p_ccb->cont_info.last_attr_seq_desc_sent = FALSE;
786 len_to_send = (UINT16) (p_rsp - &p_ccb->rsp_list[0]);
793 p_ccb->list_len = sdpu_get_list_len(&uid_seq, &attr_seq_sav) + 3;
795 if (p_ccb->list_len > 255)
797 p_ccb->rsp_list[0] = (UINT8) ((DATA_ELE_SEQ_DESC_TYPE << 3) | SIZE_IN_NEXT_WORD);
798 p_ccb->rsp_list[1] = (UINT8) ((p_ccb->list_len - 3) >> 8);
799 p_ccb->rsp_list[2] = (UINT8) (p_ccb->list_len - 3);
805 p_ccb->rsp_list[1] = (UINT8) ((DATA_ELE_SEQ_DESC_TYPE << 3) | SIZE_IN_NEXT_BYTE);
806 p_ccb->rsp_list[2] = (UINT8) (p_ccb->list_len - 3);
808 p_ccb->list_len--;
834 memcpy (p_rsp, &p_ccb->rsp_list[cont_offset], len_to_send);
837 p_ccb->cont_offset += len_to_send;
840 if (p_ccb->cont_offset < p_ccb->list_len)
845 UINT16_TO_BE_STREAM (p_rsp, p_ccb->cont_offset);
859 L2CA_DataWrite (p_ccb->connection_id, p_buf);