Open GoogleCodeExporter opened 9 years ago
*cough* PythonForAndroid_r4.apk
Original comment by bigmark...@gmail.com
on 10 Apr 2013 at 1:14
I get the same error even without turning off the Device. Transmission of bytes
works a few times but then fails with this error :-(
Android 2.3
Original comment by paulherweg
on 23 Aug 2013 at 11:59
[deleted comment]
My work around was to check for a confirmation reply from my bluetooth device
and if I did not receive a confirmation within a timeout period to attempt to
automatically reconnect.
input_buffer = []
time_out = time.time() + .5
while('\n' not in input_buffer):
while(droid.bluetoothReadReady().result == False):
if(time.time() > time_out):
raise Exception
input_buffer.append(droid.bluetoothRead(1).result)
This code has a half second timeout. It reads in data one character at a time,
and if it doesn't receive a newline it assumes something went wrong and throws
an exception. My exception handler then would automatically reconnect, and try
sending data again.
This may not work in your case if disconnections are extremely common, or if
the device does not send a consistent acknowledgement of data received.
Original comment by bigmark...@gmail.com
on 23 Aug 2013 at 12:40
Original issue reported on code.google.com by
bigmark...@gmail.com
on 10 Apr 2013 at 1:13