Update the GATT client to allow use of Write Without Response
characteristics
#302
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.
Summary
Some BLE devices expose the attribute "Write Without Response" on characteristics. Currently,
trouble
only supports writing with responses. This PR extends the GATT client to support Write Without Response.Implementation
According to the BLE Spec regarding Write Without Response, the end of section
3.4.5.3
reads:Therefore, we should be able to re-use existing logic in the
request
method for the GATT client to send the message, and not wait on a response from theresponse_channel
.I've added a new method,
write_characteristic_without_response
which invokes this newWrite
command processTesting
I've tested this on an Acaia Lunar 2021 which exposes a Write Without Response characteristic, writing to this before would cause an
WRITE_NOT_PERMITTED = 0x03
error code from the host layer. Utilizing the new method allows me keep a long-lived connection open with the scale. This was tested on an ESP32C3 dev board.