From 046fbebc35851c91712d73ca81da795a9ecb2e6f Mon Sep 17 00:00:00 2001 From: John Date: Sat, 24 Sep 2022 17:57:24 +0200 Subject: [PATCH] fix unnecessary arbitration start --- src/lib/ebus/device.cpp | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/lib/ebus/device.cpp b/src/lib/ebus/device.cpp index a22bccf7..6896422d 100755 --- a/src/lib/ebus/device.cpp +++ b/src/lib/ebus/device.cpp @@ -361,7 +361,7 @@ result_t Device::recv(unsigned int timeout, symbol_t* value, ArbitrationState* a } return RESULT_ERR_TIMEOUT; } while (true); - if (m_enhancedProto || *value != SYN || m_arbitrationMaster == SYN) { + if (m_enhancedProto || *value != SYN || m_arbitrationMaster == SYN || m_arbitrationCheck) { if (m_listener != nullptr) { m_listener->notifyDeviceData(*value, true); } @@ -435,7 +435,11 @@ bool Device::write(symbol_t value, bool startArbitration) { fprintf(stdout, "raw > %2.2x\n", value); fflush(stdout); #endif +#ifdef SIMULATE_NON_WRITABILITY + return true; +#else return ::write(m_fd, &value, 1) == 1; +#endif } bool Device::available() {