I opened your project, did a Cleanup Blocks, and used the Ctrl-F search facility to do a grand tour of blocks containing the word BlueTooth.
Here are some fishy things I found:
If you were just granted this permission, why would you then immediately ask for that permission again? Maybe this was intended for asking for two different permissions, one at a time?
You check BlueTooth Enabled immediately after requesting permission(s), without allowing for the time it might take for enablement to happen. This test probably needs to happen later, after permissions have been dealt with?
And why does the error message mention connection, when it is issued after testing enablement? Aren't those two different things?
Enabled means ready and willing to connect,
Connected means actually found something to connect to, and connected to it.
Zoom in on the top, where you try to get a stream of bytes:
You test for at least 1 byte of data available in the buffer.
Then you ask for a bunch of bytes, one at a time.
Asking for a byte that isn't yet there locks up the app until one arrives.
If you are sending bunches of bytes, it would be good to know how many bytes per bunch and ask for all the bytes at once on a list.
This is a good time to learn how to work with lists.
Read a starter article in
P.S. Maybe also post your sketch, so we can see what's in all those bytes?



