mirror of
https://github.com/intrepidcs/libicsneo.git
synced 2026-08-05 01:18:36 +02:00
Device: Add reconnect()
This commit is contained in:
committed by
Kyle Schwarz
parent
5d672d48d4
commit
b48160286b
@@ -42,6 +42,7 @@ public:
|
||||
bool close();
|
||||
bool isOpen();
|
||||
bool isDisconnected();
|
||||
|
||||
virtual void spawnThreads();
|
||||
virtual void joinThreads();
|
||||
void modeChangeIncoming() { driver->modeChangeIncoming(); }
|
||||
|
||||
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user