From 91745fe847228fad1c972316d9b0298bee939634 Mon Sep 17 00:00:00 2001 From: John-Michael Baier Date: Sun, 1 Nov 2020 10:44:15 +0100 Subject: [PATCH] add host latency --- src/lib/ebus/device.cpp | 3 ++- src/lib/ebus/device.h | 7 +++++++ 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/src/lib/ebus/device.cpp b/src/lib/ebus/device.cpp index af3805e1..df1478e6 100755 --- a/src/lib/ebus/device.cpp +++ b/src/lib/ebus/device.cpp @@ -75,7 +75,8 @@ namespace ebusd { Device::Device(const char* name, bool checkDevice, unsigned int latency, bool readOnly, bool initialSend, bool enhancedProto) - : m_name(name), m_checkDevice(checkDevice), m_latency(latency), m_readOnly(readOnly), m_initialSend(initialSend), + : m_name(name), m_checkDevice(checkDevice), + m_latency(HOST_LATENCY_MS+latency), m_readOnly(readOnly), m_initialSend(initialSend), m_enhancedProto(enhancedProto), m_fd(-1), m_listener(nullptr), m_arbitrationMaster(SYN), m_arbitrationCheck(false), m_bufSize(((MAX_LEN+1+3)/4)*4), m_bufLen(0), m_bufPos(0) { m_buffer = reinterpret_cast(malloc(m_bufSize)); diff --git a/src/lib/ebus/device.h b/src/lib/ebus/device.h index f2248571..213f6780 100755 --- a/src/lib/ebus/device.h +++ b/src/lib/ebus/device.h @@ -43,6 +43,13 @@ namespace ebusd { /** the transfer latency of the network device [ms]. */ #define NETWORK_LATENCY_MS 10 +/** the latency of the host [ms]. */ +#ifdef __CYGWIN__ +#define HOST_LATENCY_MS 20 +#else +#define HOST_LATENCY_MS 0 +#endif + /** the arbitration state handled by @a Device. */ enum ArbitrationState { as_none, //!< no arbitration in process