Merge branch 'master' into M17_AX25_FM

This commit is contained in:
Jonathan Naylor
2021-03-22 22:14:54 +00:00
21 changed files with 90 additions and 10 deletions

View File

@@ -17,6 +17,7 @@
*/
#include "RemoteControl.h"
#include "MMDVMHost.h"
#include "Log.h"
#include <cstdio>
@@ -32,7 +33,8 @@ const unsigned int CW_ARGS = 2U;
const unsigned int BUFFER_LENGTH = 100U;
CRemoteControl::CRemoteControl(const std::string address, unsigned int port) :
CRemoteControl::CRemoteControl(CMMDVMHost *host, const std::string address, unsigned int port) :
m_host(host),
m_socket(address, port),
m_command(RCD_NONE),
m_args()
@@ -141,9 +143,17 @@ REMOTE_COMMAND CRemoteControl::getCommand()
} else if (m_args.at(0U) == "reload") {
// Reload command is in the form of "reload"
m_command = RCD_RELOAD;
}
else
} else if (m_args.at(0U) == "status") {
if (m_host != NULL) {
m_host->buildNetworkStatusString(replyStr);
} else {
replyStr = "KO";
}
m_command = RCD_CONNECTION_STATUS;
} else {
replyStr = "KO";
}
::snprintf(buffer, BUFFER_LENGTH * 2, "%s remote command of \"%s\" received", ((m_command == RCD_NONE) ? "Invalid" : "Valid"), command);
if (m_command == RCD_NONE) {