Return BLE_HS_EDONE in characteristic discovery #106
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
If the characteristic is not the last one in a service
next_char_cb
will be called again with the next characteristic which in the current implementation would override the end handle and would again send the state signal.The double state signal then leads to
get_descriptors
returning an empty array, can be tested with this sample code:I haven't found any documentation about what the callback is supposed to return but I found out that returning HS_DONE would not call the callback again. Also Nimble-Arduino also does this so it seems to be correct: https://github.com/wakwak-koba/NimBLE-Arduino/blob/aec7e4294dc2ede1434b68cf8381a307f2c08c68/src/NimBLERemoteCharacteristic.cpp#L216C14-L216C26