Skip to content

Commit 370641d

Browse files
committed
Bluetooth: Classic: SDP: correct partial response seq length
The total length of the initial data element sequence is indicated in the first response, even though only a portion of this data element sequence is returned in the first response. Signed-off-by: zhenwei fang <[email protected]>
1 parent 366d45f commit 370641d

File tree

1 file changed

+17
-0
lines changed
  • subsys/bluetooth/host/classic

1 file changed

+17
-0
lines changed

subsys/bluetooth/host/classic/sdp.c

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -877,6 +877,11 @@ static uint8_t select_attrs(struct bt_sdp_attribute *attr, uint8_t att_idx,
877877
(space < seq_size + sad->cont_state_size))) {
878878
/* Packet exhausted */
879879
sad->state->pkt_full = true;
880+
881+
/* This case mean packet is exhausted, state stays at
882+
* the previous attr, we should break the loop.
883+
*/
884+
break;
880885
}
881886
}
882887

@@ -1316,6 +1321,18 @@ static uint16_t sdp_svc_search_att_req(struct bt_sdp *sdp, struct net_buf *buf,
13161321
}
13171322

13181323
rsp_buf_cpy = NULL;
1324+
/*
1325+
* If current service is the same as the next service,
1326+
* then we should continue from the last attribute.
1327+
*/
1328+
if (state.current_svc == next_svc) {
1329+
next_att = state.last_att;
1330+
}
1331+
1332+
/* continue from the last attribute, just dry run. */
1333+
att_list_len += create_attr_list(sdp, record, filter, num_filters,
1334+
max_att_len, SDP_SSA_CONT_STATE_SIZE + 1,
1335+
next_att, &state, rsp_buf_cpy);
13191336
}
13201337

13211338
next_att = 0U;

0 commit comments

Comments
 (0)