-
Notifications
You must be signed in to change notification settings - Fork 589
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
Add support for long-writes #68
Comments
now I face the same problem, any solution? |
Sorry for such a long wait. As for now you have to chunk the data yourself. I am currently chasing bugs mostly and unfortunately don't have enough time to research the problem and possible use cases. |
If it can help others, here the code I use to do the split. I release this to public domain without restrictions. Use (and adapt) at your own risk (note this is a slightly modified version of the class I use in my own project): Usage:
And the test class I used:
Good luck. Regards, |
this could be managed changing the MTU |
I have put somewhere what I do use for byte splitting but cannot find it for reference so I will put it here again:
|
@dariuszseweryn #99 Here comes the reference. |
@nister Could you elaborate more on how did you managed to send more than 20 bytes of data using the Android BLE API? The topic on stackoverflow is describing a custom BLE protocol in order to introduce some flow control in the communication. It describes nothing that the library is not supporting. |
Are we getting this support soon? Byte>20 transmit? How can we achieve it with current library, with bytesplitter |
If you are using Android 5.x or later you can set the MTU > 20 before sending the data |
And if you use 4.3 / 4.4 or your peripheral does not support larger MTUs - you can just make several writes one after another with the next batches of what you want to transmit. The bytesplitter just splits your large byte array into batches that can be written at once - one after another. I have finished a helper but it is still under a code review. |
@dariuszseweryn Thanks! |
Summary: #68 Reviewers: pawel.urban Reviewed By: pawel.urban Differential Revision: https://phabricator.polidea.com/D2204
Summary
Ex: http://stackoverflow.com/questions/24135682/android-sending-data-20-bytes-by-ble
Need to send data > 20 bytes via BLE. It works normally if I using common Android BLE API. But I get only first part (20 bytes) with RxAndroidBle. Behavior is the same in case with .setupNotification, readCharacteristic, writeCharacteristic.
How can I handle it with RxAndroidBle and\or what I'm doing wrong?
Preconditions
Steps to reproduce actual result
Actual result
Only fiirst part receiving
Expected result
Get all data by parts
Thanks!
The text was updated successfully, but these errors were encountered: