Lines Matching refs:sad

817 	struct select_attrs_data *sad = user_data;  in select_attrs()  local
822 for (idx_filter = 0U; idx_filter < sad->num_filters; idx_filter++) { in select_attrs()
824 att_id_lower = (sad->filter[idx_filter] >> 16); in select_attrs()
825 att_id_upper = (sad->filter[idx_filter]); in select_attrs()
848 if ((sad->state->current_svc != sad->rec->index) && in select_attrs()
849 sad->new_service) { in select_attrs()
856 if (sad->rsp_buf) { in select_attrs()
857 space = MIN(SDP_MTU, sad->sdp->chan.tx.mtu) - in select_attrs()
858 sad->rsp_buf->len - sizeof(struct bt_sdp_hdr); in select_attrs()
860 if ((!sad->state->pkt_full) && in select_attrs()
861 ((seq_size > sad->max_att_len) || in select_attrs()
862 (space < seq_size + sad->cont_state_size))) { in select_attrs()
864 sad->state->pkt_full = true; in select_attrs()
869 if (!sad->state->pkt_full && sad->rsp_buf) { in select_attrs()
873 if (!sad->seq && in select_attrs()
874 (sad->state->current_svc != sad->rec->index)) { in select_attrs()
875 sad->seq = net_buf_add(sad->rsp_buf, in select_attrs()
876 sizeof(*sad->seq)); in select_attrs()
877 sad->seq->type = BT_SDP_SEQ16; in select_attrs()
878 sad->seq->size = 0U; in select_attrs()
882 net_buf_add_u8(sad->rsp_buf, BT_SDP_UINT16); in select_attrs()
883 net_buf_add_be16(sad->rsp_buf, att_id_cur); in select_attrs()
886 copy_attribute(&attr->val, sad->rsp_buf, 1); in select_attrs()
888 sad->max_att_len -= seq_size; in select_attrs()
889 sad->att_list_len += seq_size; in select_attrs()
890 sad->state->last_att = att_idx; in select_attrs()
891 sad->state->current_svc = sad->rec->index; in select_attrs()
894 if (sad->seq) { in select_attrs()
898 sad->seq->size += attr_size; in select_attrs()
899 sad->state->att_list_size += seq_size; in select_attrs()
904 sad->state->att_list_size += seq_size; in select_attrs()
907 sad->new_service = false; in select_attrs()
918 if (sad->state->pkt_full && !sad->seq && sad->rsp_buf) { in select_attrs()
950 struct select_attrs_data sad; in create_attr_list() local
953 sad.num_filters = num_filters; in create_attr_list()
954 sad.rec = record; in create_attr_list()
955 sad.rsp_buf = rsp_buf; in create_attr_list()
956 sad.sdp = sdp; in create_attr_list()
957 sad.max_att_len = max_att_len; in create_attr_list()
958 sad.cont_state_size = cont_state_size; in create_attr_list()
959 sad.seq = NULL; in create_attr_list()
960 sad.filter = filter; in create_attr_list()
961 sad.state = state; in create_attr_list()
962 sad.att_list_len = 0U; in create_attr_list()
963 sad.new_service = true; in create_attr_list()
965 idx_att = bt_sdp_foreach_attr(sad.rec, next_att, select_attrs, &sad); in create_attr_list()
967 if (sad.seq) { in create_attr_list()
968 sad.seq->size = sys_cpu_to_be16(sad.seq->size); in create_attr_list()
971 return sad.att_list_len; in create_attr_list()