Bluetooth: SDP: Fix ssa discovery issue caused by setting range
If the range of the service search attribute request is set and the
start of the range is not 0x0000, the response data of the request is
not valid. It is caused by the data element sequence has not be added
to response data. The client cannot parse the response data properly.
The root cause of this issue is that the total length of service
record will be added only when adding the first attribute of service
record.
Fix the issue by reset the `state.last_att` and `state.last_att_index`
if the index of current record is not same with `state.current_svc`.
And do not update `state.last_att`, `state.last_att_index`, and
`state.current_svc` in the function `select_attrs()`.
Signed-off-by:
Lyle Zhu <lyle.zhu@nxp.com>
Loading
Please sign in to comment