Device: Add reconnect()

This commit is contained in:
Yasser Yassine
2025-10-11 16:33:22 -04:00
committed by Kyle Schwarz
parent 5d672d48d4
commit b48160286b
19 changed files with 118 additions and 54 deletions
+5
View File
@@ -12,9 +12,12 @@
#include "icsneo/api/eventmanager.h"
#include "icsneo/third-party/concurrentqueue/blockingconcurrentqueue.h"
#include "icsneo/communication/ringbuffer.h"
#include "icsneo/device/founddevice.h"
namespace icsneo {
typedef std::function<void(std::vector<FoundDevice>&)> driver_finder_t;
#define ICSNEO_DRIVER_RINGBUFFER_SIZE (512 * 1024)
class Driver {
public:
@@ -25,6 +28,7 @@ public:
virtual void modeChangeIncoming() {}
virtual void awaitModeChangeComplete() {}
virtual bool close() = 0;
virtual driver_finder_t getFinder() = 0;
inline bool isDisconnected() const { return disconnected; };
inline bool isClosing() const { return closing; }
@@ -37,6 +41,7 @@ public:
bool readAvailable() { return readBuffer.size() > 0; }
RingBuffer& getReadBuffer() { return readBuffer; }
virtual bool enableCommunication(bool /* enable */, bool& sendMsg) { sendMsg = true; return true; }
device_eventhandler_t report;