add extra latency needed for enhanced mode

This commit is contained in:
John
2021-11-01 13:39:28 +01:00
parent 24a65257d0
commit 1644ff0897
2 changed files with 4 additions and 1 deletions
+1 -1
View File
@@ -79,7 +79,7 @@ namespace ebusd {
Device::Device(const char* name, bool checkDevice, unsigned int latency, bool readOnly, bool initialSend, Device::Device(const char* name, bool checkDevice, unsigned int latency, bool readOnly, bool initialSend,
bool enhancedProto) bool enhancedProto)
: m_name(name), m_checkDevice(checkDevice), : m_name(name), m_checkDevice(checkDevice),
m_latency(HOST_LATENCY_MS+latency), m_readOnly(readOnly), m_initialSend(initialSend), m_latency(HOST_LATENCY_MS+(enhancedProto?ENHANCED_LATENCY_MS:0)+latency), m_readOnly(readOnly), m_initialSend(initialSend),
m_enhancedProto(enhancedProto), m_fd(-1), m_listener(nullptr), m_arbitrationMaster(SYN), 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_arbitrationCheck(false), m_bufSize(((MAX_LEN+1+3)/4)*4), m_bufLen(0), m_bufPos(0),
m_extraFatures(0), m_infoId(0xff), m_infoLen(0), m_infoPos(0) { m_extraFatures(0), m_infoId(0xff), m_infoLen(0), m_infoPos(0) {
+3
View File
@@ -43,6 +43,9 @@ namespace ebusd {
/** the transfer latency of the network device [ms]. */ /** the transfer latency of the network device [ms]. */
#define NETWORK_LATENCY_MS 30 #define NETWORK_LATENCY_MS 30
/** the extra transfer latency to take into account for enhanced protocol. */
#define ENHANCED_LATENCY_MS 10
/** the latency of the host [ms]. */ /** the latency of the host [ms]. */
#if defined(__CYGWIN__) || defined(_WIN32) #if defined(__CYGWIN__) || defined(_WIN32)
#define HOST_LATENCY_MS 20 #define HOST_LATENCY_MS 20