mirror of
https://github.com/intrepidcs/libicsneo.git
synced 2026-08-05 01:18:36 +02:00
Extensions: Offer an opportunity to communicate with a dead device
This commit is contained in:
@@ -283,6 +283,8 @@ private:
|
||||
std::vector<Network> supportedTXNetworks;
|
||||
std::vector<Network> supportedRXNetworks;
|
||||
|
||||
APIEvent::Type attemptToBeginCommunication();
|
||||
|
||||
// Use heartbeatSuppressed instead when reading
|
||||
std::atomic<int> heartbeatSuppressedByUser{0};
|
||||
bool heartbeatSuppressed() const { return heartbeatSuppressedByUser > 0 || (settings && settings->applyingSettings); }
|
||||
|
||||
@@ -17,7 +17,12 @@ public:
|
||||
virtual ~DeviceExtension() = default;
|
||||
virtual const char* getName() const = 0;
|
||||
|
||||
virtual void onDeviceOpen() {}
|
||||
// Return false to block opening
|
||||
virtual bool onDeviceOpen() { return true; }
|
||||
|
||||
// Return true to indicate that communication should now be back
|
||||
virtual bool onDeviceCommunicationDead() { return false; }
|
||||
|
||||
virtual void onGoOnline() {}
|
||||
virtual void onGoOffline() {}
|
||||
virtual void onDeviceClose() {}
|
||||
|
||||
Reference in New Issue
Block a user