Page alert commands

This commit is contained in:
Max Lapan
2022-11-26 11:04:01 +01:00
parent 8f5ff4ca05
commit 55ba1233a8
5 changed files with 76 additions and 1 deletions

View File

@@ -148,6 +148,50 @@ void CPOCSAGControl::sendPageBCD(unsigned int ric, const std::string& text)
}
void CPOCSAGControl::sendPageAlert1(unsigned int ric)
{
if (!m_enabled)
return;
POCSAGData* output = new POCSAGData;
output->m_ric = ric;
addAddress(FUNCTIONAL_ALERT1, ric, output->m_buffer);
LogDebug("Local message to %07u, func Alert1", ric);
// Ensure data is an even number of words
if ((output->m_buffer.size() % 2U) == 1U)
output->m_buffer.push_back(POCSAG_IDLE_WORD);
m_data.push_back(output);
}
void CPOCSAGControl::sendPageAlert2(unsigned int ric, const std::string& text)
{
if (!m_enabled)
return;
POCSAGData* output = new POCSAGData;
output->m_ric = ric;
output->m_text = text;
addAddress(FUNCTIONAL_ALERT2, ric, output->m_buffer);
LogDebug("Local message to %07u, func Alert2: \"%s\"", ric, text.c_str());
packASCII(text, output->m_buffer);
// Ensure data is an even number of words
if ((output->m_buffer.size() % 2U) == 1U)
output->m_buffer.push_back(POCSAG_IDLE_WORD);
m_data.push_back(output);
}
bool CPOCSAGControl::readNetwork()
{
if (m_network == NULL)