From f9cde1565a8cd13a0dc3cde030c2aac856c9a5bc Mon Sep 17 00:00:00 2001 From: Jonathan Naylor Date: Tue, 22 Sep 2020 15:21:05 +0100 Subject: [PATCH] Ignore any incoming YSF info messages. --- YSFGateway/YSFNetwork.cpp | 6 +++++- YSFParrot/Network.cpp | 4 ++++ YSFReflector/Network.cpp | 4 ++++ 3 files changed, 13 insertions(+), 1 deletion(-) diff --git a/YSFGateway/YSFNetwork.cpp b/YSFGateway/YSFNetwork.cpp index 4f2cc4d..7a19803 100644 --- a/YSFGateway/YSFNetwork.cpp +++ b/YSFGateway/YSFNetwork.cpp @@ -1,5 +1,5 @@ /* - * Copyright (C) 2009-2014,2016,2017,2018 by Jonathan Naylor G4KLX + * Copyright (C) 2009-2014,2016,2017,2018,2020 by Jonathan Naylor G4KLX * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -204,6 +204,10 @@ void CYSFNetwork::clock(unsigned int ms) if (::memcmp(buffer, "YSFO", 4U) == 0) return; + // Throw away any info messages + if (::memcmp(buffer, "YSFI", 4U) == 0) + return; + if (::memcmp(buffer, "YSFP", 4U) == 0 && !m_linked) { if (strcmp(m_name.c_str(),"MMDVM")== 0) LogMessage("Link successful to %s", m_name.c_str()); diff --git a/YSFParrot/Network.cpp b/YSFParrot/Network.cpp index 5443522..35647be 100644 --- a/YSFParrot/Network.cpp +++ b/YSFParrot/Network.cpp @@ -93,6 +93,10 @@ unsigned int CNetwork::read(unsigned char* data) if (::memcmp(data, "YSFO", 4U) == 0) return 0U; + // Throw away incoming info messages + if (::memcmp(data, "YSFI", 4U) == 0) + return 0U; + // Handle incoming unlinks if (::memcmp(data, "YSFU", 4U) == 0) return 0U; diff --git a/YSFReflector/Network.cpp b/YSFReflector/Network.cpp index d4367ea..f4c875e 100644 --- a/YSFReflector/Network.cpp +++ b/YSFReflector/Network.cpp @@ -106,6 +106,10 @@ unsigned int CNetwork::readData(unsigned char* data, unsigned int length, in_add if (::memcmp(data, "YSFO", 4U) == 0) return 0U; + // Throw away any info messages + if (::memcmp(data, "YSFI", 4U) == 0) + return 0U; + // Handle incoming status requests if (::memcmp(data, "YSFS", 4U) == 0) { m_socket.write(m_status, 42U, address, port);