Pass through the MMDVM's home position to all connected networks.

This commit is contained in:
Jonathan Naylor
2018-10-30 07:42:04 +00:00
parent 6aa09f735e
commit 0c31af146c
6 changed files with 82 additions and 27 deletions

View File

@@ -228,7 +228,7 @@ bool CDMRNetwork::write(const CDMRData& data)
return true;
}
bool CDMRNetwork::writePosition(const unsigned char* data, unsigned int length)
bool CDMRNetwork::writeRadioPosition(const unsigned char* data, unsigned int length)
{
if (m_status != RUNNING)
return false;
@@ -260,6 +260,22 @@ bool CDMRNetwork::writeTalkerAlias(const unsigned char* data, unsigned int lengt
return write(buffer, length);
}
bool CDMRNetwork::writeHomePosition(const unsigned char* data, unsigned int length)
{
if (m_status != RUNNING)
return false;
unsigned char buffer[50U];
::memcpy(buffer + 0U, "RPTG", 4U);
::memcpy(buffer + 4U, m_id, 4U);
::memcpy(buffer + 8U, data + 8U, length - 8U);
return write(buffer, length);
}
bool CDMRNetwork::isConnected() const
{
return m_status == RUNNING;