forked from mickiebyrd/bluepy
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request IanHarvey#169 from OnBeep/support-empty-wr-value
Support empty values in "wr" and "wrr" commands IanHarvey#169 The GATT protocol supports empty values (length=0) for variable length characteristics, and some devices require empty values in some circumstances. Trying to set an empty value to a GATT characteristic with code like handle.write(bytes('')) results in failure, with the following output when I set `Debugging = True` in `btle.py`: Sent: wr 95 Got: 'rsp=$err code=$badparam\n' With this PR, the `handle.write(bytes(''))` succeeds with the expected behavior on the airwaves and on the GATT server. * 'support-empty-wr-value' of https://github.com/OnBeep/bluepy: bluepy-helper: document "wr" and "wrr" optional quotes bluepy-helper: support unquoted hex strings, too bluepy-helper: teach "wr" and "wrr" commands to take quoted data strings bluepy-helper: have gatt_attr_data_from_string return -1 on error rather than 0
- Loading branch information
Showing
3 changed files
with
22 additions
and
8 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters