From 47857b0af667f1ecd922895c102da4e4be646a3e Mon Sep 17 00:00:00 2001 From: Jonathan Naylor Date: Mon, 13 Jun 2016 17:46:38 +0100 Subject: [PATCH] Allow the Parrot to appear as a reflector. --- YSFParrot/Network.cpp | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/YSFParrot/Network.cpp b/YSFParrot/Network.cpp index 5df8f5d..ab954fc 100644 --- a/YSFParrot/Network.cpp +++ b/YSFParrot/Network.cpp @@ -111,6 +111,14 @@ void CNetwork::clock(unsigned int ms) if (::memcmp(buffer, "YSFP", 4U) == 0) return; + // Handle the status command + if (::memcmp(buffer, "YSFS", 4U) == 0) { + unsigned char status[50U]; + ::sprintf((char*)status, "YSFS%05u%16.16s%14.14s%03u", 1U, "Parrot", "Parrot", 0U); + m_socket.write(status, 42U, address, port); + return; + } + // Invalid packet type? if (::memcmp(buffer, "YSFD", 4U) != 0) return;