Fix lock on MODBUS

This commit is contained in:
Emanuele Trabattoni
2025-07-22 11:15:57 +02:00
parent 146a2b558b
commit 16bb029e93
5 changed files with 21 additions and 8 deletions

View File

@@ -60,6 +60,10 @@ namespace drivers
MODBUS(const MODBUS &) = delete; // remove copy constructors
MODBUS &operator=(const MODBUS &) = delete;
// Get transaction lock
std::unique_lock<std::mutex> getLock() {
return std::unique_lock<std::mutex>(m_mutex);
}
// Func 0x01
const bool readCoils(const uint8_t device, const uint16_t reg, const uint16_t num, std::vector<bool> &coils);