From 7dd9caf7eba2669d8ec190dc82865ee1c2bc889d Mon Sep 17 00:00:00 2001 From: Tom Early Date: Mon, 24 Jan 2022 04:35:21 -0700 Subject: [PATCH] dump unknown YSF packets if DEBUG --- reflector/YSFProtocol.cpp | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/reflector/YSFProtocol.cpp b/reflector/YSFProtocol.cpp index 1a59f96..f8828cc 100644 --- a/reflector/YSFProtocol.cpp +++ b/reflector/YSFProtocol.cpp @@ -188,9 +188,11 @@ void CYsfProtocol::Task(void) } else { - // std::string title("Unknown YSF packet from "); - // title += Ip.GetAddress(); - // Buffer.Dump(title); +#ifdef DEBUG + std::string title("Unknown YSF packet from "); + title += Ip.GetAddress(); + Buffer.Dump(title); +#endif } } @@ -773,7 +775,13 @@ bool CYsfProtocol::IsValidwirexPacket(const CBuffer &Buffer, CYSFFICH *Fich, CCa { unsigned char crc = CCRC::addCRC(command, i + 1U); if (crc == command[i + 1U]) + { valid = true; +#ifdef DEBUG + if (! valid) + std::cout << "WiresX command CRC failed:" << (int)crc << " != " << (int)command[i + 1U] << std::endl; +#endif + } break; } }