I need to read a bluetooth stream for 5 seconds, because I need to be sure my app will get the bluetooth message (which is actually just a char
casted to int
).
If my app can't read the message my btState
variable is set to a certain value for another task.
while(btState!=666)
{
btState=666;
try {
while(timestart-timenow<5){ //how do i do this?
btState=mConnectThread.checkstate();
mConnectThread.sendSignal('s');
}
} catch (Exception e) {break; }
}