Merge branch 'master' into FM

This commit is contained in:
Jonathan Naylor 2020-05-05 20:53:40 +01:00
commit da0f1a6a76
3 changed files with 24 additions and 2 deletions

View file

@ -2040,6 +2040,18 @@ void CMMDVMHost::remoteControl()
}
m_pocsag->sendPage(ric, text);
}
case RCD_CW:
setMode(MODE_IDLE); // Force the modem to go idle so that we can send the CW text.
if (!m_modem->hasTX()){
std::string cwtext;
for (unsigned int i = 0U; i < m_remoteControl->getArgCount(); i++) {
if (i > 0U)
cwtext += " ";
cwtext += m_remoteControl->getArgString(i);
}
m_display->writeCW();
m_modem->sendCWId(cwtext);
}
default:
break;
}

View file

@ -28,6 +28,7 @@ const unsigned int SET_MODE_ARGS = 2U;
const unsigned int ENABLE_ARGS = 2U;
const unsigned int DISABLE_ARGS = 2U;
const unsigned int PAGE_ARGS = 3U;
const unsigned int CW_ARGS = 2U;
const unsigned int BUFFER_LENGTH = 100U;
@ -117,7 +118,10 @@ REMOTE_COMMAND CRemoteControl::getCommand()
} else if (m_args.at(0U) == "page" && m_args.size() >= PAGE_ARGS) {
// Page command is in the form of "page <ric> <message>"
m_command = RCD_PAGE;
}
} else if (m_args.at(0U) == "cw" && m_args.size() >= CW_ARGS) {
// CW command is in the form of "cw <message>"
m_command = RCD_CW;
}
if (m_command == RCD_NONE) {
m_args.clear();
@ -143,6 +147,8 @@ unsigned int CRemoteControl::getArgCount() const
return m_args.size() - SET_MODE_ARGS;
case RCD_PAGE:
return m_args.size() - 1U;
case RCD_CW:
return m_args.size() - 1U;
default:
return 0U;
}
@ -163,6 +169,9 @@ std::string CRemoteControl::getArgString(unsigned int n) const
case RCD_PAGE:
n += 1U;
break;
case RCD_CW:
n += 1U;
break;
default:
return "";
}

View file

@ -46,7 +46,8 @@ enum REMOTE_COMMAND {
RCD_DISABLE_P25,
RCD_DISABLE_NXDN,
RCD_DISABLE_FM,
RCD_PAGE
RCD_PAGE,
RCD_CW
};
class CRemoteControl {