From 11cad79a95f20ce2b8cfb44b706960909da62667 Mon Sep 17 00:00:00 2001 From: Jonathan Naylor Date: Thu, 24 May 2018 18:17:37 +0100 Subject: [PATCH] Attempt to fix the inactivity timeout. --- YSFGateway/YSFGateway.cpp | 15 ++++++--------- 1 file changed, 6 insertions(+), 9 deletions(-) diff --git a/YSFGateway/YSFGateway.cpp b/YSFGateway/YSFGateway.cpp index 746869e..a4d22d0 100644 --- a/YSFGateway/YSFGateway.cpp +++ b/YSFGateway/YSFGateway.cpp @@ -343,13 +343,10 @@ int CYSFGateway::run() } m_current.clear(); - m_inactivityTimer.stop(); m_lostTimer.stop(); m_linkType = LINK_NONE; startupLinking(); - } else { - m_inactivityTimer.start(); } } else { if (m_linkType == LINK_YSF) { @@ -366,10 +363,11 @@ int CYSFGateway::run() } m_current.clear(); - m_inactivityTimer.stop(); m_lostTimer.stop(); m_linkType = LINK_NONE; } + + m_inactivityTimer.start(); } m_lostTimer.clock(ms); @@ -386,7 +384,7 @@ int CYSFGateway::run() } m_current.clear(); - m_inactivityTimer.stop(); + m_inactivityTimer.start(); m_lostTimer.stop(); m_linkType = LINK_NONE; } @@ -523,7 +521,7 @@ void CYSFGateway::processWiresX(const unsigned char* buffer, unsigned char fi, u m_fcsNetwork->writeUnlink(3U); m_current.clear(); - m_inactivityTimer.stop(); + m_inactivityTimer.start(); m_lostTimer.stop(); m_linkType = LINK_NONE; @@ -536,7 +534,6 @@ void CYSFGateway::processWiresX(const unsigned char* buffer, unsigned char fi, u bool ok = m_fcsNetwork->writeLink(name); if (ok) { m_current = name; - m_inactivityTimer.start(); m_lostTimer.start(); m_linkType = LINK_FCS; } else { @@ -552,7 +549,7 @@ void CYSFGateway::processWiresX(const unsigned char* buffer, unsigned char fi, u m_ysfNetwork->clearDestination(); m_current.clear(); - m_inactivityTimer.stop(); + m_inactivityTimer.start(); m_lostTimer.stop(); m_linkType = LINK_NONE; } @@ -563,7 +560,7 @@ void CYSFGateway::processWiresX(const unsigned char* buffer, unsigned char fi, u m_fcsNetwork->clearDestination(); m_current.clear(); - m_inactivityTimer.stop(); + m_inactivityTimer.start(); m_lostTimer.stop(); m_linkType = LINK_NONE; }