mirror of
https://github.com/intrepidcs/libicsneo.git
synced 2026-08-05 01:18:36 +02:00
Driver: Block between read attempts
Driver: * Refactored to limit accessibility of member fields; Communication: * readTask() now calls for a blocking wait;
This commit is contained in:
committed by
Kyle Schwarz
parent
f25a0a4a81
commit
75af3220b0
@@ -22,8 +22,10 @@ public:
|
||||
private:
|
||||
neodevice_t& device;
|
||||
std::optional<void*> handle;
|
||||
void readTask() override;
|
||||
void writeTask() override;
|
||||
|
||||
std::thread readThread, writeThread;
|
||||
void readTask();
|
||||
void writeTask();
|
||||
};
|
||||
|
||||
}
|
||||
|
||||
@@ -47,8 +47,10 @@ private:
|
||||
|
||||
static std::string HandleToTTY(neodevice_handle_t handle);
|
||||
|
||||
void readTask() override;
|
||||
void writeTask() override;
|
||||
std::thread readThread, writeThread;
|
||||
void readTask();
|
||||
void writeTask();
|
||||
|
||||
bool fdIsValid();
|
||||
};
|
||||
|
||||
|
||||
@@ -25,8 +25,11 @@ public:
|
||||
bool isOpen() override;
|
||||
bool close() override;
|
||||
private:
|
||||
void readTask() override;
|
||||
void writeTask() override;
|
||||
std::thread readThread, writeThread;
|
||||
|
||||
void readTask();
|
||||
void writeTask();
|
||||
|
||||
bool writeQueueFull() override;
|
||||
bool writeQueueAlmostFull() override;
|
||||
bool writeInternal(const std::vector<uint8_t>& bytes) override;
|
||||
|
||||
@@ -57,8 +57,11 @@ private:
|
||||
static std::vector<std::string> handles;
|
||||
|
||||
static bool ErrorIsDisconnection(int errorCode);
|
||||
std::thread readThread, writeThread;
|
||||
|
||||
void readTask();
|
||||
void writeTask();
|
||||
|
||||
bool openable; // Set to false in the constructor if the object has not been found in searchResultDevices
|
||||
|
||||
neodevice_t& device;
|
||||
|
||||
@@ -30,8 +30,10 @@ private:
|
||||
uint8_t deviceMAC[6];
|
||||
bool openable = true;
|
||||
EthernetPacketizer ethPacketizer;
|
||||
void readTask() override;
|
||||
void writeTask() override;
|
||||
|
||||
std::thread readThread, writeThread;
|
||||
void readTask();
|
||||
void writeTask();
|
||||
|
||||
class NetworkInterface {
|
||||
public:
|
||||
|
||||
@@ -47,8 +47,10 @@ private:
|
||||
uint32_t dstIP;
|
||||
uint16_t dstPort;
|
||||
std::unique_ptr<Socket> socket;
|
||||
void readTask() override;
|
||||
void writeTask() override;
|
||||
|
||||
std::thread readThread, writeThread;
|
||||
void readTask();
|
||||
void writeTask();
|
||||
};
|
||||
|
||||
}
|
||||
|
||||
@@ -32,6 +32,7 @@ private:
|
||||
bool openable = true;
|
||||
EthernetPacketizer ethPacketizer;
|
||||
|
||||
std::thread readThread, writeThread;
|
||||
std::thread transmitThread;
|
||||
pcap_send_queue* transmitQueue = nullptr;
|
||||
std::condition_variable transmitQueueCV;
|
||||
|
||||
@@ -37,6 +37,7 @@ private:
|
||||
std::shared_ptr<Detail> detail;
|
||||
|
||||
std::vector<std::shared_ptr<std::thread>> threads;
|
||||
std::thread readThread, writeThread;
|
||||
void readTask();
|
||||
void writeTask();
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user