Lines Matching refs:p_ccb
48 static void process_service_search_rsp (tCONN_CB *p_ccb, UINT8 *p_reply, UINT16 len);
49 static void process_service_attr_rsp (tCONN_CB *p_ccb, UINT8 *p_reply, UINT16 len);
50 static void process_service_search_attr_rsp (tCONN_CB *p_ccb, UINT8 *p_reply, UINT16 len);
51 static UINT8 *save_attr_seq (tCONN_CB *p_ccb, UINT8 *p, UINT8 *p_msg_end);
119 static void sdp_snd_service_search_req(tCONN_CB *p_ccb, UINT8 cont_len, UINT8 * p_cont)
128 sdp_disconnect (p_ccb, SDP_NO_RESOURCES);
137 UINT16_TO_BE_STREAM (p, p_ccb->transaction_id);
138 p_ccb->transaction_id++;
146 p = sdpu_build_uuid_seq (p, 1, &p_ccb->p_db->uuid_filters[p_ccb->cur_uuid_idx]);
148 p = sdpu_build_uuid_seq (p, p_ccb->p_db->num_uuid_filters, p_ccb->p_db->uuid_filters);
168 p_ccb->disc_state = SDP_DISC_WAIT_HANDLES;
174 SDP_TRACE_WARNING2("sdp_snd_service_search_req cont_len :%d disc_state:%d",cont_len, p_ccb->disc_state);
178 L2CA_DataWrite (p_ccb->connection_id, p_cmd);
181 btu_start_timer (&p_ccb->timer_entry, BTU_TTYPE_SDP, SDP_INACT_TIMEOUT);
195 void sdp_disc_connected (tCONN_CB *p_ccb)
199 if (SDP_IS_PASS_THRU == p_ccb->is_attr_search)
201 tSDP_DISC_RES_CB *p_rcb = (tSDP_DISC_RES_CB *) p_ccb->p_db;
204 p_ccb->disc_state = SDP_DISC_WAIT_PASS_THRU;
207 memcpy(evt_data.peer_addr, p_ccb->device_address, BD_ADDR_LEN);
208 evt_data.peer_mtu = p_ccb->rem_mtu_size;
214 if (p_ccb->is_attr_search)
216 p_ccb->disc_state = SDP_DISC_WAIT_SEARCH_ATTR;
218 process_service_search_attr_rsp (p_ccb, NULL, 0);
226 p_ccb->num_handles = 0;
227 sdp_snd_service_search_req(p_ccb, 0, NULL);
242 void sdp_disc_server_rsp (tCONN_CB *p_ccb, BT_HDR *p_msg)
248 SDP_TRACE_WARNING1("sdp_disc_server_rsp disc_state:%d", p_ccb->disc_state);
252 btu_stop_timer (&p_ccb->timer_entry);
255 if(SDP_IS_PASS_THRU == p_ccb->is_attr_search)
257 tSDP_DISC_RES_CB *p_rcb = (tSDP_DISC_RES_CB *) p_ccb->p_db;
279 if (p_ccb->disc_state == SDP_DISC_WAIT_HANDLES)
281 process_service_search_rsp (p_ccb, p, p_msg->len);
287 if (p_ccb->disc_state == SDP_DISC_WAIT_ATTR)
289 process_service_attr_rsp (p_ccb, p, p_msg->len);
295 if (p_ccb->disc_state == SDP_DISC_WAIT_SEARCH_ATTR)
297 process_service_search_attr_rsp (p_ccb, p, p_msg->len);
305 SDP_TRACE_WARNING2 ("SDP - Unexp. PDU: %d in state: %d", rsp_pdu, p_ccb->disc_state);
306 sdp_disconnect (p_ccb, SDP_GENERIC_ERROR);
320 static void process_service_search_rsp (tCONN_CB *p_ccb, UINT8 *p_reply, UINT16 len)
331 orig = p_ccb->num_handles;
332 p_ccb->num_handles += cur_handles;
333 if (p_ccb->num_handles == 0)
336 sdp_disconnect (p_ccb, SDP_NO_RECS_MATCH);
343 if (p_ccb->num_handles > sdp_cb.max_recs_per_search)
344 p_ccb->num_handles = sdp_cb.max_recs_per_search;
346 for (xx = orig; xx < p_ccb->num_handles; xx++)
347 BE_STREAM_TO_UINT32 (p_ccb->handles[xx], p_reply);
354 sdp_disconnect (p_ccb, SDP_INVALID_CONT_STATE);
358 sdp_snd_service_search_req(p_ccb, cont_len, p_reply);
363 p_ccb->disc_state = SDP_DISC_WAIT_ATTR;
366 process_service_attr_rsp (p_ccb, NULL, 0);
381 static void sdp_copy_raw_data (tCONN_CB *p_ccb, UINT16 len, BOOLEAN offset)
394 for (i = 0; i < p_ccb->list_len; i++)
396 sprintf((char *)&num_array[i*2],"%02X",(UINT8)(p_ccb->rsp_list[i]));
401 if(p_ccb->p_db->raw_data)
403 cpy_len = p_ccb->p_db->raw_size - p_ccb->p_db->raw_used;
404 list_len = p_ccb->list_len;
405 p_temp = p = &p_ccb->rsp_list[0];
418 list_len, cpy_len, p_ccb->p_db->raw_size, p_ccb->p_db->raw_used);
420 memcpy (&p_ccb->p_db->raw_data[p_ccb->p_db->raw_used], p, cpy_len);
421 p_ccb->p_db->raw_used += cpy_len;
436 static void process_service_attr_rsp (tCONN_CB *p_ccb, UINT8 *p_reply, UINT16 len)
462 if ((p_ccb->list_len + list_byte_count) > SDP_MAX_LIST_BYTE_COUNT)
464 sdp_disconnect (p_ccb, SDP_INVALID_PDU_SIZE);
470 p_ccb->list_len, list_byte_count);
472 if (p_ccb->rsp_list == NULL)
474 p_ccb->rsp_list = (UINT8 *)GKI_getbuf (SDP_MAX_LIST_BYTE_COUNT);
475 if (p_ccb->rsp_list == NULL)
478 sdp_disconnect (p_ccb, SDP_NO_RESOURCES);
482 memcpy (&p_ccb->rsp_list[p_ccb->list_len], p_reply, list_byte_count);
483 p_ccb->list_len += list_byte_count;
486 SDP_TRACE_WARNING1("list_len: %d(attr_rsp)", p_ccb->list_len);
495 sdp_disconnect (p_ccb, SDP_INVALID_CONT_STATE);
505 sdp_copy_raw_data (p_ccb, len, FALSE);
509 if (!save_attr_seq (p_ccb, &p_ccb->rsp_list[0], &p_ccb->rsp_list[p_ccb->list_len]))
511 sdp_disconnect (p_ccb, SDP_DB_FULL);
514 p_ccb
515 p_ccb->cur_handle++;
520 if (p_ccb->cur_handle < p_ccb->num_handles)
527 sdp_disconnect (p_ccb, SDP_NO_RESOURCES);
536 UINT16_TO_BE_STREAM (p, p_ccb->transaction_id);
537 p_ccb->transaction_id++;
543 UINT32_TO_BE_STREAM (p, p_ccb->handles[p_ccb->cur_handle]);
549 if (p_ccb->p_db->num_attr_filters)
550 p = sdpu_build_attrib_seq (p, p_ccb->p_db->attr_filters, p_ccb->p_db->num_attr_filters);
571 L2CA_DataWrite (p_ccb->connection_id, p_msg);
574 btu_start_timer (&p_ccb->timer_entry, BTU_TTYPE_SDP, SDP_INACT_TIMEOUT);
578 sdp_disconnect (p_ccb, SDP_SUCCESS);
594 static void process_service_search_attr_rsp (tCONN_CB *p_ccb, UINT8 *p_reply, UINT16 len)
621 if ((p_ccb->list_len + lists_byte_count) > SDP_MAX_LIST_BYTE_COUNT)
623 sdp_disconnect (p_ccb, SDP_INVALID_PDU_SIZE);
629 p_ccb->list_len, lists_byte_count);
631 if (p_ccb->rsp_list == NULL)
633 p_ccb->rsp_list = (UINT8 *)GKI_getbuf (SDP_MAX_LIST_BYTE_COUNT);
634 if (p_ccb->rsp_list == NULL)
637 sdp_disconnect (p_ccb, SDP_NO_RESOURCES);
641 memcpy (&p_ccb->rsp_list[p_ccb->list_len], p_reply, lists_byte_count);
642 p_ccb->list_len += lists_byte_count;
645 SDP_TRACE_WARNING1("list_len: %d(search_attr_rsp)", p_ccb->list_len);
654 sdp_disconnect (p_ccb, SDP_INVALID_CONT_STATE);
673 sdp_disconnect (p_ccb, SDP_NO_RESOURCES);
682 UINT16_TO_BE_STREAM (p, p_ccb->transaction_id);
683 p_ccb->transaction_id++;
691 p = sdpu_build_uuid_seq (p, 1, &p_ccb->p_db->uuid_filters[p_ccb->cur_uuid_idx]);
693 p = sdpu_build_uuid_seq (p, p_ccb->p_db->num_uuid_filters, p_ccb->p_db->uuid_filters);
700 if (p_ccb->p_db->num_attr_filters)
701 p = sdpu_build_attrib_seq (p, p_ccb->p_db->attr_filters, p_ccb->p_db->num_attr_filters);
722 L2CA_DataWrite (p_ccb->connection_id, p_msg);
725 btu_start_timer (&p_ccb->timer_entry, BTU_TTYPE_SDP, SDP_INACT_TIMEOUT);
737 sdp_copy_raw_data (p_ccb, len, TRUE);
740 p = &p_ccb->rsp_list[0];
752 p_end = &p_ccb->rsp_list[p_ccb->list_len];
756 sdp_disconnect (p_ccb, SDP_INVALID_CONT_STATE);
762 p = save_attr_seq (p_ccb, p, &p_ccb->rsp_list[p_ccb->list_len]);
765 sdp_disconnect (p_ccb, SDP_DB_FULL);
771 sdp_disconnect (p_ccb, SDP_SUCCESS);
784 static UINT8 *save_attr_seq (tCONN_CB *p_ccb, UINT8 *p, UINT8 *p_msg_end)
807 p_rec = add_record (p_ccb->p_db, p_ccb->device_address);
829 p = add_attr (p, p_ccb->p_db, p_rec, attr_id, NULL, 0);