Skip to content

Commit

Permalink
Add command page_bcd to send bcd message with pocsag
Browse files Browse the repository at this point in the history
  • Loading branch information
Shmuma committed Nov 25, 2022
1 parent f3fb072 commit 8f5ff4c
Show file tree
Hide file tree
Showing 5 changed files with 21 additions and 3 deletions.
14 changes: 13 additions & 1 deletion MMDVMHost.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2639,9 +2639,21 @@ void CMMDVMHost::remoteControl()
text += m_remoteControl->getArgString(i);
}
m_pocsag->sendPage(ric, text);
m_pocsag->sendBCDPage(ric, "01234");
}
break;
case RCD_PAGE_BCD:
if (m_pocsag != NULL) {
unsigned int ric = m_remoteControl->getArgUInt(0U);
std::string text;
for (unsigned int i = 1U; i < m_remoteControl->getArgCount(); i++) {
if (i > 1U)
text += " ";
text += m_remoteControl->getArgString(i);
}
m_pocsag->sendPageBCD(ric, text);
}
break;

case RCD_CW:
setMode(MODE_IDLE); // Force the modem to go idle so that we can send the CW text.
if (!m_modem->hasTX()) {
Expand Down
2 changes: 1 addition & 1 deletion POCSAGControl.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,7 @@ void CPOCSAGControl::sendPage(unsigned int ric, const std::string& text)
}


void CPOCSAGControl::sendBCDPage(unsigned int ric, const std::string& text)
void CPOCSAGControl::sendPageBCD(unsigned int ric, const std::string& text)
{
if (!m_enabled)
return;
Expand Down
2 changes: 1 addition & 1 deletion POCSAGControl.h
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ class CPOCSAGControl {
~CPOCSAGControl();

void sendPage(unsigned int ric, const std::string& text);
void sendBCDPage(unsigned int ric, const std::string& text);
void sendPageBCD(unsigned int ric, const std::string& text);

unsigned int readModem(unsigned char* data);

Expand Down
5 changes: 5 additions & 0 deletions RemoteControl.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -137,6 +137,9 @@ 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) == "page_bcd" && m_args.size() >= PAGE_ARGS) {
// BCD page command is in the form of "page_bcd <ric> <bcd message>"
m_command = RCD_PAGE_BCD;
} 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;
Expand Down Expand Up @@ -192,6 +195,7 @@ unsigned int CRemoteControl::getArgCount() const
case RCD_MODE_M17:
return m_args.size() - SET_MODE_ARGS;
case RCD_PAGE:
case RCD_PAGE_BCD:
return m_args.size() - 1U;
case RCD_CW:
return m_args.size() - 1U;
Expand All @@ -214,6 +218,7 @@ std::string CRemoteControl::getArgString(unsigned int n) const
n += SET_MODE_ARGS;
break;
case RCD_PAGE:
case RCD_PAGE_BCD:
n += 1U;
break;
case RCD_CW:
Expand Down
1 change: 1 addition & 0 deletions RemoteControl.h
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,7 @@ enum REMOTE_COMMAND {
RCD_DISABLE_FM,
RCD_DISABLE_AX25,
RCD_PAGE,
RCD_PAGE_BCD,
RCD_CW,
RCD_RELOAD,
RCD_CONNECTION_STATUS,
Expand Down

0 comments on commit 8f5ff4c

Please sign in to comment.