Skip to content

Commit 8f5ff4c

Browse files
committed
Add command page_bcd to send bcd message with pocsag
1 parent f3fb072 commit 8f5ff4c

File tree

5 files changed

+21
-3
lines changed

5 files changed

+21
-3
lines changed

MMDVMHost.cpp

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2639,9 +2639,21 @@ void CMMDVMHost::remoteControl()
26392639
text += m_remoteControl->getArgString(i);
26402640
}
26412641
m_pocsag->sendPage(ric, text);
2642-
m_pocsag->sendBCDPage(ric, "01234");
26432642
}
26442643
break;
2644+
case RCD_PAGE_BCD:
2645+
if (m_pocsag != NULL) {
2646+
unsigned int ric = m_remoteControl->getArgUInt(0U);
2647+
std::string text;
2648+
for (unsigned int i = 1U; i < m_remoteControl->getArgCount(); i++) {
2649+
if (i > 1U)
2650+
text += " ";
2651+
text += m_remoteControl->getArgString(i);
2652+
}
2653+
m_pocsag->sendPageBCD(ric, text);
2654+
}
2655+
break;
2656+
26452657
case RCD_CW:
26462658
setMode(MODE_IDLE); // Force the modem to go idle so that we can send the CW text.
26472659
if (!m_modem->hasTX()) {

POCSAGControl.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -124,7 +124,7 @@ void CPOCSAGControl::sendPage(unsigned int ric, const std::string& text)
124124
}
125125

126126

127-
void CPOCSAGControl::sendBCDPage(unsigned int ric, const std::string& text)
127+
void CPOCSAGControl::sendPageBCD(unsigned int ric, const std::string& text)
128128
{
129129
if (!m_enabled)
130130
return;

POCSAGControl.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ class CPOCSAGControl {
4343
~CPOCSAGControl();
4444

4545
void sendPage(unsigned int ric, const std::string& text);
46-
void sendBCDPage(unsigned int ric, const std::string& text);
46+
void sendPageBCD(unsigned int ric, const std::string& text);
4747

4848
unsigned int readModem(unsigned char* data);
4949

RemoteControl.cpp

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -137,6 +137,9 @@ REMOTE_COMMAND CRemoteControl::getCommand()
137137
} else if (m_args.at(0U) == "page" && m_args.size() >= PAGE_ARGS) {
138138
// Page command is in the form of "page <ric> <message>"
139139
m_command = RCD_PAGE;
140+
} else if (m_args.at(0U) == "page_bcd" && m_args.size() >= PAGE_ARGS) {
141+
// BCD page command is in the form of "page_bcd <ric> <bcd message>"
142+
m_command = RCD_PAGE_BCD;
140143
} else if (m_args.at(0U) == "cw" && m_args.size() >= CW_ARGS) {
141144
// CW command is in the form of "cw <message>"
142145
m_command = RCD_CW;
@@ -192,6 +195,7 @@ unsigned int CRemoteControl::getArgCount() const
192195
case RCD_MODE_M17:
193196
return m_args.size() - SET_MODE_ARGS;
194197
case RCD_PAGE:
198+
case RCD_PAGE_BCD:
195199
return m_args.size() - 1U;
196200
case RCD_CW:
197201
return m_args.size() - 1U;
@@ -214,6 +218,7 @@ std::string CRemoteControl::getArgString(unsigned int n) const
214218
n += SET_MODE_ARGS;
215219
break;
216220
case RCD_PAGE:
221+
case RCD_PAGE_BCD:
217222
n += 1U;
218223
break;
219224
case RCD_CW:

RemoteControl.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,7 @@ enum REMOTE_COMMAND {
5454
RCD_DISABLE_FM,
5555
RCD_DISABLE_AX25,
5656
RCD_PAGE,
57+
RCD_PAGE_BCD,
5758
RCD_CW,
5859
RCD_RELOAD,
5960
RCD_CONNECTION_STATUS,

0 commit comments

Comments
 (0)