mirror of
https://github.com/intrepidcs/libicsneo.git
synced 2026-08-05 01:18:36 +02:00
Driver: * Refactored to limit accessibility of member fields; Communication: * readTask() now calls for a blocking wait;
36 lines
692 B
C++
36 lines
692 B
C++
#ifndef __FTD3XX_H_
|
|
#define __FTD3XX_H_
|
|
|
|
#ifdef __cplusplus
|
|
|
|
#include <optional>
|
|
|
|
#include "icsneo/communication/driver.h"
|
|
#include "icsneo/device/founddevice.h"
|
|
|
|
namespace icsneo {
|
|
|
|
class FTD3XX : public Driver {
|
|
public:
|
|
static void Find(std::vector<FoundDevice>& foundDevices);
|
|
FTD3XX(const device_eventhandler_t& err, neodevice_t& forDevice);
|
|
~FTD3XX() override { if(isOpen()) close(); }
|
|
bool open() override;
|
|
bool isOpen() override;
|
|
bool close() override;
|
|
bool isEthernet() const override { return false; }
|
|
private:
|
|
neodevice_t& device;
|
|
std::optional<void*> handle;
|
|
|
|
std::thread readThread, writeThread;
|
|
void readTask();
|
|
void writeTask();
|
|
};
|
|
|
|
}
|
|
|
|
#endif // __cplusplus
|
|
|
|
#endif
|