From dd2f5fbe26fb03a5195a39ee103daf9870a9b0fe Mon Sep 17 00:00:00 2001 From: Andy Taylor Date: Tue, 5 May 2020 19:24:29 +0100 Subject: [PATCH 1/4] Update MMDVMHost.cpp --- MMDVMHost.cpp | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/MMDVMHost.cpp b/MMDVMHost.cpp index 2134223..1e61600 100644 --- a/MMDVMHost.cpp +++ b/MMDVMHost.cpp @@ -1986,6 +1986,17 @@ void CMMDVMHost::remoteControl() } m_pocsag->sendPage(ric, text); } + case RCD_CW: + 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; } From 8b2b3d344a3890e37439ca35e8812fc540db74a7 Mon Sep 17 00:00:00 2001 From: Andy Taylor Date: Tue, 5 May 2020 19:26:12 +0100 Subject: [PATCH 2/4] Update RemoteControl.cpp --- RemoteControl.cpp | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/RemoteControl.cpp b/RemoteControl.cpp index afa1473..2aca7ff 100644 --- a/RemoteControl.cpp +++ b/RemoteControl.cpp @@ -26,6 +26,7 @@ const unsigned int SET_MODE_ARGS = 2U; const unsigned int PAGE_ARGS = 3U; +const unsigned int CW_ARGS = 2U; const unsigned int BUFFER_LENGTH = 100U; @@ -89,7 +90,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 " m_command = RCD_PAGE; - } + } else if (m_args.at(0U) == "cw" && m_args.size() >= CW_ARGS) { + // CW command is in the form of "cw " + m_command = RCD_CW; + } if (m_command == RCD_NONE) { m_args.clear(); @@ -115,6 +119,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; } @@ -135,6 +141,9 @@ std::string CRemoteControl::getArgString(unsigned int n) const case RCD_PAGE: n += 1U; break; + case RCD_CW: + n += 1U; + break; default: return ""; } From d3f4b1f90c1614666081af1081f7afc972843258 Mon Sep 17 00:00:00 2001 From: Andy Taylor Date: Tue, 5 May 2020 19:27:12 +0100 Subject: [PATCH 3/4] Update RemoteControl.h --- RemoteControl.h | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/RemoteControl.h b/RemoteControl.h index 479987a..c5be6ba 100644 --- a/RemoteControl.h +++ b/RemoteControl.h @@ -33,7 +33,8 @@ enum REMOTE_COMMAND { RCD_MODE_YSF, RCD_MODE_P25, RCD_MODE_NXDN, - RCD_PAGE + RCD_PAGE, + RCD_CW }; class CRemoteControl { From ff492a518fb979811070337453430de4ac45e231 Mon Sep 17 00:00:00 2001 From: Andy Taylor Date: Tue, 5 May 2020 19:30:56 +0100 Subject: [PATCH 4/4] Update MMDVMHost.cpp --- MMDVMHost.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/MMDVMHost.cpp b/MMDVMHost.cpp index 1e61600..c7367ca 100644 --- a/MMDVMHost.cpp +++ b/MMDVMHost.cpp @@ -1987,6 +1987,7 @@ 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++) {