Device: Wait longer to receive message in heart beat thread
parent
53e66b8772
commit
188a087c51
|
|
@ -280,8 +280,11 @@ bool Device::open(OpenFlags flags, OpenStatusHandler handler) {
|
|||
|
||||
// No heartbeat received, request a status
|
||||
com->sendCommand(Command::RequestStatusUpdate);
|
||||
// The response should come back quickly if the com is quiet
|
||||
std::this_thread::sleep_for(std::chrono::milliseconds(50));
|
||||
|
||||
// Wait until we either received the message or reach max wait time
|
||||
for (uint32_t sleepTime = 0; sleepTime < 3500 && !receivedMessage; sleepTime += 50)
|
||||
std::this_thread::sleep_for(std::chrono::milliseconds(50));
|
||||
|
||||
// Check if we got a message, and if not, if settings are being applied
|
||||
if(receivedMessage) {
|
||||
receivedMessage = false;
|
||||
|
|
|
|||
Loading…
Reference in New Issue