Adjusted mutex lock and delay for modbus
This commit is contained in:
@@ -34,7 +34,7 @@ namespace drivers
|
||||
|
||||
const uint8_t c_respHeaderSize = 3;
|
||||
const uint8_t c_respCrcSize = 2;
|
||||
const uint16_t c_minDelay = 10;
|
||||
const uint32_t c_minDelay = 500;
|
||||
|
||||
typedef struct
|
||||
{
|
||||
@@ -62,9 +62,8 @@ namespace drivers
|
||||
MODBUS &operator=(const MODBUS &) = delete;
|
||||
|
||||
// Get transaction lock
|
||||
std::unique_lock<std::mutex> getLock() {
|
||||
return std::unique_lock<std::mutex>(m_mutex);
|
||||
}
|
||||
std::unique_lock<std::mutex> getLock();
|
||||
std::mutex &getMutex();
|
||||
|
||||
// Func 0x01
|
||||
const bool readCoils(const uint8_t device, const uint16_t reg, const uint16_t num, std::vector<bool> &coils);
|
||||
|
||||
Reference in New Issue
Block a user