mirror of
https://github.com/g4klx/MMDVMHost
synced 2025-12-20 22:45:44 +08:00
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:
@@ -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");
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user