Skip to content
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

Unable to receive mConfig.characterDelimiter #51

Open
strobotek opened this issue Oct 30, 2024 · 0 comments
Open

Unable to receive mConfig.characterDelimiter #51

strobotek opened this issue Oct 30, 2024 · 0 comments

Comments

@strobotek
Copy link

Hello,

I understand that the characterDelimiter is used to separate messages received via Bluetooth in discrete chunks / packets. However, it would be useful to have a configuration option (a field in config) so that we can also enable receiving the characterDelimiter too.

Let's say the characterDelimiter is 0x0A, and I receive the following sequence over the Bluetooth link:
0xAA 0xBB 0xCC 0x0A 0x0A 0xDD 0xEE 0xFF 0x0A
In the current version of the library I would get two onDataRead callbacks, with the following content:
0xAA 0xBB 0xCC
0xDD 0xEE 0xFF

It would be great to have a config option (for example something like config.receiveDelimiter), that when active would generate three callbacks:
0xAA 0xBB 0xCC 0x0A
0x0A
0xDD 0xEE 0xFF 0x0A

In this way, we would be able to recreate the complete incoming sequence, if we wanted. Of course, if the config option above would be disabled, the code would work just like it works now.

Unfortunately I could not find a workaround to this issue. A partial workaround would be to append a delimiter to every callback, but if the original sequence would have several delimiter characters in a row, there would be no way of detecting that.

So, I suggest you make a very easy modification in BluetoothClassicService.java (lines 334 to 350), together with adding another config option, so that this issue could be solved.

Thank you

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant