Driver: Add TCP support

Device: Close Driver in heartbeat thread on disconnection
This commit is contained in:
Kyle Schwarz
2023-03-08 18:32:26 +00:00
parent ddee1254a0
commit 9b46d486cb
10 changed files with 674 additions and 12 deletions
+3 -1
View File
@@ -271,8 +271,10 @@ bool Device::open(OpenFlags flags, OpenStatusHandler handler) {
if(receivedMessage) {
receivedMessage = false;
} else {
if(!stopHeartbeatThread && !isDisconnected())
if(!stopHeartbeatThread && !isDisconnected()) {
report(APIEvent::Type::DeviceDisconnected, APIEvent::Severity::Error);
com->driver->close();
}
break;
}
}
+8
View File
@@ -19,6 +19,10 @@
#include "icsneo/platform/ftdi.h"
#endif
#ifdef ICSNEO_ENABLE_TCP
#include "icsneo/platform/tcp.h"
#endif
using namespace icsneo;
template<typename T>
@@ -47,6 +51,10 @@ std::vector<std::shared_ptr<Device>> DeviceFinder::FindAll() {
FirmIO::Find(newDriverFoundDevices);
#endif
#ifdef ICSNEO_ENABLE_TCP
TCP::Find(newDriverFoundDevices);
#endif
#ifdef ICSNEO_ENABLE_RAW_ETHERNET
PCAP::Find(newDriverFoundDevices);
#endif