Reputation: 815
I'm having trouble maintaining a Bluetooth connection (from Android to a device I'm developing) for longer than a few minutes.
The scenario is:
So: why does Android BT stop receiving?
This is very similar to the issue/observation described in bboydflo's answer to this question: Application using bluetooth SPP profile not working after update from Android 4.2 to Android 4.3
Some more background:
I would like to pre-emptively address reasons that this question may be closed:
Upvotes: 1
Views: 1676
Reputation: 815
Ok, I have a partial answer for this one. First, a bit more background:
I had a suspicious that this might be some background buffer running out of space. So, I changed the 2s to 500ms and the 1024-length to 10024. Now, I've had about 20 minutes of connectivity without any trouble (and still going).
It would be nice to find the smoking gun for this. I initially thought that stream.Available() would be sufficient to tell if a buffer was getting filled up, but in this scenario, stream.Available() is actually returning 0 when the Android device stops receiving. So I'm not really sure which queue to check to prove that this issue is related to a buffer becoming filled.
Upvotes: 1