1
0
Fork 0

Add more Wires-X debug tracing.

ycs232-kbc
Jonathan Naylor 6 years ago
parent ab4b037955
commit a915b9e863

@ -1,5 +1,5 @@
/* /*
* Copyright (C) 2016,2017,2018 by Jonathan Naylor G4KLX * Copyright (C) 2016,2017,2018,2019 by Jonathan Naylor G4KLX
* *
* This program is free software; you can redistribute it and/or modify * 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 * it under the terms of the GNU General Public License as published by
@ -230,50 +230,52 @@ WX_STATUS CWiresX::process(const unsigned char* data, const unsigned char* sourc
if (!valid) if (!valid)
return WXS_NONE; return WXS_NONE;
CUtils::dump(1U, "Received Wires-X command", m_command, cmd_len);
// If we are using WiresX Passthrough (we already know we are on a YSF2xxx room from YSFGateway // If we are using WiresX Passthrough (we already know we are on a YSF2xxx room from YSFGateway
if (wiresXCommandPassthrough) { if (wiresXCommandPassthrough) {
if (::memcmp(m_command + 1U, DX_REQ, 3U) == 0) { if (::memcmp(m_command + 1U, DX_REQ, 3U) == 0) {
return WXS_NONE; return WXS_NONE;
} else if (::memcmp(m_command + 1U, ALL_REQ, 3U) == 0) { } else if (::memcmp(m_command + 1U, ALL_REQ, 3U) == 0) {
return WXS_NONE; return WXS_NONE;
} else if (::memcmp(m_command + 1U, CONN_REQ, 3U) == 0) { } else if (::memcmp(m_command + 1U, CONN_REQ, 3U) == 0) {
return WXS_NONE; return WXS_NONE;
} else if (::memcmp(m_command + 1U, DISC_REQ, 3U) == 0) { } else if (::memcmp(m_command + 1U, DISC_REQ, 3U) == 0) {
processDisconnect(source); processDisconnect(source);
return WXS_DISCONNECT; return WXS_DISCONNECT;
} else if (::memcmp(m_command + 1U, DISC_REQ2, 3U) == 0) { } else if (::memcmp(m_command + 1U, DISC_REQ2, 3U) == 0) {
processDisconnect(source); processDisconnect(source);
return WXS_DISCONNECT; return WXS_DISCONNECT;
} else if (::memcmp(m_command + 1U, CAT_REQ, 3U) == 0) { } else if (::memcmp(m_command + 1U, CAT_REQ, 3U) == 0) {
return WXS_NONE; return WXS_NONE;
} else { } else {
CUtils::dump("Unknown Wires-X command", m_command, cmd_len); CUtils::dump("Unknown Wires-X command", m_command, cmd_len);
return WXS_NONE; return WXS_NONE;
} }
} }
// Origional Code Here // Origional Code Here
else { else {
if (::memcmp(m_command + 1U, DX_REQ, 3U) == 0) { if (::memcmp(m_command + 1U, DX_REQ, 3U) == 0) {
processDX(source); processDX(source);
return WXS_NONE; return WXS_NONE;
} else if (::memcmp(m_command + 1U, ALL_REQ, 3U) == 0) { } else if (::memcmp(m_command + 1U, ALL_REQ, 3U) == 0) {
processAll(source, m_command + 5U); processAll(source, m_command + 5U);
return WXS_NONE; return WXS_NONE;
} else if (::memcmp(m_command + 1U, CONN_REQ, 3U) == 0) { } else if (::memcmp(m_command + 1U, CONN_REQ, 3U) == 0) {
return processConnect(source, m_command + 5U); return processConnect(source, m_command + 5U);
} else if (::memcmp(m_command + 1U, DISC_REQ, 3U) == 0) { } else if (::memcmp(m_command + 1U, DISC_REQ, 3U) == 0) {
processDisconnect(source); processDisconnect(source);
return WXS_DISCONNECT; return WXS_DISCONNECT;
} else if (::memcmp(m_command + 1U, DISC_REQ2, 3U) == 0) { } else if (::memcmp(m_command + 1U, DISC_REQ2, 3U) == 0) {
processDisconnect(source); processDisconnect(source);
return WXS_DISCONNECT; return WXS_DISCONNECT;
} else if (::memcmp(m_command + 1U, CAT_REQ, 3U) == 0) { } else if (::memcmp(m_command + 1U, CAT_REQ, 3U) == 0) {
processCategory(source, m_command + 5U); processCategory(source, m_command + 5U);
return WXS_NONE; return WXS_NONE;
} else { } else {
CUtils::dump("Unknown Wires-X command", m_command, cmd_len); CUtils::dump("Unknown Wires-X command", m_command, cmd_len);
return WXS_NONE; return WXS_NONE;
} }
} }
} }
@ -1040,8 +1042,7 @@ void CWiresX::sendCategoryReply()
m_seqNo++; m_seqNo++;
} }
bool CWiresX::isBusy() bool CWiresX::isBusy() const
{ {
return m_busy; return m_busy;
} }

@ -1,5 +1,5 @@
/* /*
* Copyright (C) 2016,2017,2018 by Jonathan Naylor G4KLX * Copyright (C) 2016,2017,2018,2019 by Jonathan Naylor G4KLX
* *
* This program is free software; you can redistribute it and/or modify * 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 * it under the terms of the GNU General Public License as published by
@ -55,7 +55,7 @@ public:
void addFCSRoom(const std::string& id, const std::string& name); void addFCSRoom(const std::string& id, const std::string& name);
bool start(); bool start();
bool isBusy(); bool isBusy() const;
WX_STATUS process(const unsigned char* data, const unsigned char* source, unsigned char fi, unsigned char dt, unsigned char fn, unsigned char ft, bool wiresXCommandPassthrough); WX_STATUS process(const unsigned char* data, const unsigned char* source, unsigned char fi, unsigned char dt, unsigned char fn, unsigned char ft, bool wiresXCommandPassthrough);

Loading…
Cancel
Save