Skip to content

Conversation

@andrzej-kaczmarek
Copy link
Contributor

ATT_READ_BY_TYPE_RSP handler will extract proc from the proc list and then call the callback for each handle-value pair in the PDU. However, this means each time proc is extracted it will be then added to the tail of the proc list. If there are more than 1 matching procesures on the list, subsequent extracts when handling the same PDU may extract invalid proc from the list and break the procedure.

This fixes the problem by adding proc back to list at the head instead of the tail of proc list. This way subsequent iterations of handle-value pairs handling will extract proper proc as it will be the first matching on the list.

@github-actions github-actions bot added host size/M Medium PR labels Oct 7, 2025
ATT_READ_BY_TYPE_RSP handler will extract proc from the proc list and
then call the callback for each handle-value pair in the PDU. However,
this means each time proc is extracted it will be then added to the
tail of the proc list. If there are more than 1 matching procesures on
the list, subsequent extracts when handling *the same PDU* may extract
invalid proc from the list and break the procedure.

This fixes the problem by adding proc back to list at the head instead
of the tail of proc list. This way subsequent iterations of handle-value
pairs handling will extract proper proc as it will be the first matching
on the list.
@andrzej-kaczmarek andrzej-kaczmarek force-pushed the att-read-by-type-rsp-fix branch from 44c00f9 to 864cf79 Compare October 7, 2025 09:02
@github-actions github-actions bot added the size/S Small PR label Oct 7, 2025
/* We need to put procedure on head of the queue since caller expects
* to process the same proc again.
*/
ble_gattc_process_status(proc, rc, true);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

shoudn't this be put back only on success?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

host size/M Medium PR size/S Small PR

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants