Add RemoteCommand 'status' command.

As DMRGateway, it reports connection status.

Command sent: "status" to port: 7642
dstar:n/a dmr:conn ysf:n/a p25:n/a nxdn:n/a fm:n/a

RemoveCommand has been slighlty modified, as using Log on a read-only filesystem simply forbids the strings to be displayed.
Another solution would be to set LogInitialisse's filePath to "/tmp/" for *nix systems.
This commit is contained in:
Daniel Caujolle-Bert
2021-03-22 20:27:08 +01:00
parent 0088b0b225
commit 27b7d3fc41
21 changed files with 90 additions and 9 deletions

View File

@@ -635,7 +635,7 @@ int CMMDVMHost::run()
LogInfo(" Address: %s", address.c_str());
LogInfo(" Port: %u", port);
m_remoteControl = new CRemoteControl(address, port);
m_remoteControl = new CRemoteControl(this, address, port);
ret = m_remoteControl->open();
if (!ret) {
@@ -2140,3 +2140,14 @@ void CMMDVMHost::processEnableCommand(bool& mode, bool enabled)
if (!m_modem->writeConfig())
LogError("Cannot write Config to MMDVM");
}
void CMMDVMHost::buildNetworkStatusString(std::string &str)
{
str = "";
str += std::string("dstar:") + (((m_dstarNetwork == NULL) || (m_dstarEnabled == false)) ? "n/a" : (m_dstarNetwork->isConnected() ? "conn" : "disc"));
str += std::string(" dmr:") + (((m_dmrNetwork == NULL) || (m_dmrEnabled == false)) ? "n/a" : (m_dmrNetwork->isConnected() ? "conn" : "disc"));
str += std::string(" ysf:") + (((m_ysfNetwork == NULL) || (m_ysfEnabled == false)) ? "n/a" : (m_ysfNetwork->isConnected() ? "conn" : "disc"));
str += std::string(" p25:") + (((m_p25Network == NULL) || (m_p25Enabled == false)) ? "n/a" : (m_p25Network->isConnected() ? "conn" : "disc"));
str += std::string(" nxdn:") + (((m_nxdnNetwork == NULL) || (m_nxdnEnabled == false)) ? "n/a" : (m_nxdnNetwork->isConnected() ? "conn" : "disc"));
str += std::string(" fm:") + (m_fmEnabled ? "conn" : "n/a");
}