mirror of
https://github.com/g4klx/MMDVMHost
synced 2025-12-23 00:35:53 +08:00
Add the beginnings of mobile hotspot location.
This commit is contained in:
@@ -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");
|
||||
|
||||
Reference in New Issue
Block a user