From 0e62bacb8479a9e67c238202592d463cd54bedba Mon Sep 17 00:00:00 2001 From: Jonathan Naylor Date: Wed, 8 Jun 2016 07:20:56 +0100 Subject: [PATCH] Dont't allow control data out over a reflector. --- YSFGateway/YSFGateway.cpp | 14 ++++++++++---- YSFGateway/YSFGateway.h | 1 + 2 files changed, 11 insertions(+), 4 deletions(-) diff --git a/YSFGateway/YSFGateway.cpp b/YSFGateway/YSFGateway.cpp index 07eca73..e5557ed 100644 --- a/YSFGateway/YSFGateway.cpp +++ b/YSFGateway/YSFGateway.cpp @@ -78,7 +78,8 @@ m_conf(configFile), m_gps(NULL), m_wiresX(NULL), m_netNetwork(NULL), -m_linked(false) +m_linked(false), +m_exclude(false) { } @@ -223,6 +224,9 @@ int CYSFGateway::run() unsigned char dt = fich.getDT(); unsigned char fn = fich.getFN(); + // Don't send out control data + m_exclude = (dt == YSF_DT_DATA_FR_MODE); + if (m_wiresX != NULL) { WX_STATUS status = m_wiresX->process(buffer + 35U, fi, dt, fn); switch (status) { @@ -247,14 +251,15 @@ int CYSFGateway::run() m_gps->data(buffer + 14U, buffer + 35U, fi, dt, fn); } + if (networkEnabled && m_linked && !m_exclude) + m_netNetwork->write(buffer); + if (buffer[34U] == 0x01U) { if (m_gps != NULL) m_gps->reset(); watchdogTimer.stop(); + m_exclude = false; } - - if (networkEnabled && m_linked) - m_netNetwork->write(buffer); } len = m_netNetwork->read(buffer); @@ -279,6 +284,7 @@ int CYSFGateway::run() if (m_gps != NULL) m_gps->reset(); watchdogTimer.stop(); + m_exclude = false; } if (ms < 5U) diff --git a/YSFGateway/YSFGateway.h b/YSFGateway/YSFGateway.h index 0233502..5273da7 100644 --- a/YSFGateway/YSFGateway.h +++ b/YSFGateway/YSFGateway.h @@ -40,6 +40,7 @@ private: CWiresX* m_wiresX; CNetwork* m_netNetwork; bool m_linked; + bool m_exclude; void createGPS(); };