mirror of
https://github.com/intrepidcs/libicsneo.git
synced 2026-09-20 16:08:37 +02:00
Device: Wait longer to receive message in heart beat thread
This commit is contained in:
+4
-1
@@ -280,8 +280,11 @@ bool Device::open(OpenFlags flags, OpenStatusHandler handler) {
|
|||||||
|
|
||||||
// No heartbeat received, request a status
|
// No heartbeat received, request a status
|
||||||
com->sendCommand(Command::RequestStatusUpdate);
|
com->sendCommand(Command::RequestStatusUpdate);
|
||||||
// The response should come back quickly if the com is quiet
|
|
||||||
|
// 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));
|
std::this_thread::sleep_for(std::chrono::milliseconds(50));
|
||||||
|
|
||||||
// Check if we got a message, and if not, if settings are being applied
|
// Check if we got a message, and if not, if settings are being applied
|
||||||
if(receivedMessage) {
|
if(receivedMessage) {
|
||||||
receivedMessage = false;
|
receivedMessage = false;
|
||||||
|
|||||||
Reference in New Issue
Block a user