-
Notifications
You must be signed in to change notification settings - Fork 25
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Read Blob not supported #37
Comments
Bluetooth low energy has a maximum characteristic size of something like 512 bytes. Bluegiga has Bluetooth Classic modules as well. Perhaps you are reading documentation for one of those. |
I'm referring to page 27 of the linked pdf. I ran into an issue reading the characteristic of a device, where the data returned was greater than 22 bytes. The data returned was cut off after 22 bytes. According to that pdf there is a read blob that handles payloads larger than 22 bytes. That being said the documentation goes on to explain that "Read Long" should be used to read characteristic longer than 22 bytes and so far I've not got that to work for me either. |
If someone else stumbles across this issue, using the "Read Long" method is indeed the correct way to read out larger characteristics. The client will then perform successive reads and transmit the data in smaller chunks. Unfortunately The following (hacky) code snippet may act as a workaround though: def read_long_by_handle_properly(connection, handle):
result = b''
def custom_callback(value):
nonlocal result
print('Received long read chunk: {0}'.format(value))
result += value
connection.attrclient_value_cb[handle] = custom_callback
connection.read_long_by_handle(handle)
del connection.attrclient_value_cb[handle]
return result |
"Read (handle)" is currently implemented and only supports a max payload of 22 bytes.
According to Bluegiga documentation "Read Blob (handle, offset)" has a max payload of 64 kBytes.
Unless I'm missing something there is no way to Read Blob with this python module.
The text was updated successfully, but these errors were encountered: