From 102c7d6667f0af6dfe3b0bebf5a3bf5c01383473 Mon Sep 17 00:00:00 2001 From: Geoffrey Merck Date: Thu, 23 Dec 2021 21:06:25 +0100 Subject: [PATCH] Strip wxWidget out of DPlusProtocolHandler --- DPlusProtocolHandler.cpp | 10 +++++----- DPlusProtocolHandler.h | 8 +------- 2 files changed, 6 insertions(+), 12 deletions(-) diff --git a/DPlusProtocolHandler.cpp b/DPlusProtocolHandler.cpp index a2f03ec..b82f96f 100644 --- a/DPlusProtocolHandler.cpp +++ b/DPlusProtocolHandler.cpp @@ -26,7 +26,7 @@ const unsigned int BUFFER_LENGTH = 1000U; -CDPlusProtocolHandler::CDPlusProtocolHandler(unsigned int port, const wxString& addr) : +CDPlusProtocolHandler::CDPlusProtocolHandler(unsigned int port, const std::string& addr) : m_socket(addr, port), m_type(DP_NONE), m_buffer(NULL), @@ -89,7 +89,7 @@ bool CDPlusProtocolHandler::writePoll(const CPollData& poll) unsigned int length = poll.getDPlusData(buffer, 10U); #if defined(DUMP_TX) - CUtils::dump(wxT("Sending Poll"), buffer, length); + CUtils::dump("Sending Poll", buffer, length); #endif return m_socket.write(buffer, length, poll.getYourAddress(), poll.getYourPort()); @@ -101,7 +101,7 @@ bool CDPlusProtocolHandler::writeConnect(const CConnectData& connect) unsigned int length = connect.getDPlusData(buffer, 40U); #if defined(DUMP_TX) - CUtils::dump(wxT("Sending Connect"), buffer, length); + CUtils::dump("Sending Connect", buffer, length); #endif return m_socket.write(buffer, length, connect.getYourAddress(), connect.getYourPort()); @@ -141,7 +141,7 @@ bool CDPlusProtocolHandler::readPackets() return false; default: // An unknown type - // CUtils::dump(wxT("Unknown packet type from D-Plus"), m_buffer, m_length); + // CUtils::dump("Unknown packet type from D-Plus", m_buffer, m_length); return true; } } else { @@ -157,7 +157,7 @@ bool CDPlusProtocolHandler::readPackets() return false; } else { // An unknown type - CUtils::dump(wxT("Unknown packet type from D-Plus"), m_buffer, m_length); + CUtils::dump("Unknown packet type from D-Plus", m_buffer, m_length); return true; } } diff --git a/DPlusProtocolHandler.h b/DPlusProtocolHandler.h index 3978f78..85b51f6 100644 --- a/DPlusProtocolHandler.h +++ b/DPlusProtocolHandler.h @@ -26,13 +26,7 @@ #include "AMBEData.h" #include "PollData.h" -#if defined(__WINDOWS__) -#include "Inaddr.h" -#else #include -#endif - -#include enum DPLUS_TYPE { DP_NONE, @@ -44,7 +38,7 @@ enum DPLUS_TYPE { class CDPlusProtocolHandler { public: - CDPlusProtocolHandler(unsigned int port, const wxString& addr = wxEmptyString); + CDPlusProtocolHandler(unsigned int port, const std::string& addr = ""); ~CDPlusProtocolHandler(); bool open();