Add the beginnings of mobile hotspot location.

This commit is contained in:
Jonathan Naylor
2018-10-30 07:53:11 +00:00
parent 52a7f63cdb
commit 66a37d7d25
3 changed files with 23 additions and 3 deletions

View File

@@ -283,7 +283,7 @@ bool CDMRNetwork::write(const CDMRData& data)
return true;
}
bool CDMRNetwork::writePosition(unsigned int id, const unsigned char* data)
bool CDMRNetwork::writeRadioPosition(unsigned int id, const unsigned char* data)
{
if (m_status != RUNNING)
return false;
@@ -325,6 +325,24 @@ bool CDMRNetwork::writeTalkerAlias(unsigned int id, unsigned char type, const un
return write(buffer, 19U);
}
bool CDMRNetwork::writeHomePosition(float latitude, float longitude)
{
m_latitude = latitude;
m_longitude = longitude;
if (m_status != RUNNING)
return false;
char buffer[50U];
::memcpy(buffer + 0U, "RPTG", 4U);
::memcpy(buffer + 4U, m_id, 4U);
::sprintf(buffer + 8U, "%08f%09f", latitude, longitude);
return write((unsigned char*)buffer, 25U);
}
void CDMRNetwork::close()
{
LogMessage("DMR, Closing DMR Network");