mirror of
https://github.com/intrepidcs/libicsneo.git
synced 2026-08-05 01:18:36 +02:00
Detect device disconnects
When a device is sending any traffic, the device is considered to be connected. If no traffic if being received from the device, a status is requested. If the device fails to report the status back in a timely manner, it is considered to be disconnected. If the device fails to reply to the status request, it is important to confirm that the device is not applying settings. While the device is applying settings, it will not be sending heartbeats or able to process a status request.
This commit is contained in:
@@ -324,6 +324,7 @@ static_assert(sizeof(UART_SETTINGS) == UART_SETTINGS_SIZE, "UART_SETTINGS is the
|
||||
#ifdef __cplusplus
|
||||
#include "icsneo/communication/communication.h"
|
||||
#include <iostream>
|
||||
#include <atomic>
|
||||
|
||||
namespace icsneo {
|
||||
|
||||
@@ -404,6 +405,8 @@ public:
|
||||
|
||||
bool readonly = false;
|
||||
bool disableGSChecksumming = false;
|
||||
|
||||
std::atomic<bool> applyingSettings{false};
|
||||
protected:
|
||||
std::shared_ptr<Communication> com;
|
||||
device_eventhandler_t report;
|
||||
|
||||
Reference in New Issue
Block a user