mirror of
https://github.com/intrepidcs/libicsneo.git
synced 2026-08-05 09:28:40 +02:00
Commands can now only be sent when the device is open
This commit is contained in:
@@ -39,6 +39,11 @@ bool ICommunication::readWait(std::vector<uint8_t>& bytes, std::chrono::millisec
|
||||
}
|
||||
|
||||
bool ICommunication::write(const std::vector<uint8_t>& bytes) {
|
||||
if(!isOpen()) {
|
||||
err(APIError::DeviceCurrentlyClosed);
|
||||
return false;
|
||||
}
|
||||
|
||||
if(writeBlocks) {
|
||||
std::unique_lock<std::mutex> lk(writeMutex);
|
||||
if(writeQueue.size_approx() > writeQueueSize) {
|
||||
|
||||
Reference in New Issue
Block a user