Commands can now only be sent when the device is open
parent
8a6073a9cf
commit
dc4f96affb
|
|
@ -39,6 +39,11 @@ bool ICommunication::readWait(std::vector<uint8_t>& bytes, std::chrono::millisec
|
||||||
}
|
}
|
||||||
|
|
||||||
bool ICommunication::write(const std::vector<uint8_t>& bytes) {
|
bool ICommunication::write(const std::vector<uint8_t>& bytes) {
|
||||||
|
if(!isOpen()) {
|
||||||
|
err(APIError::DeviceCurrentlyClosed);
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
if(writeBlocks) {
|
if(writeBlocks) {
|
||||||
std::unique_lock<std::mutex> lk(writeMutex);
|
std::unique_lock<std::mutex> lk(writeMutex);
|
||||||
if(writeQueue.size_approx() > writeQueueSize) {
|
if(writeQueue.size_approx() > writeQueueSize) {
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue