Add MobileGPS support for DMR.

This commit is contained in:
Jonathan Naylor
2018-11-06 12:14:57 +00:00
parent 2caa2e9a67
commit e847711d17
16 changed files with 255 additions and 12 deletions

View File

@@ -157,7 +157,8 @@ m_callsign(),
m_id(0U),
m_cwCallsign(),
m_lockFileEnabled(false),
m_lockFileName()
m_lockFileName(),
m_mobileGPS(NULL)
{
}
@@ -941,6 +942,9 @@ int CMMDVMHost::run()
if (m_pocsagNetwork != NULL)
m_pocsagNetwork->clock(ms);
if (m_mobileGPS != NULL)
m_mobileGPS->clock(ms);
m_cwIdTimer.clock(ms);
if (m_cwIdTimer.isRunning() && m_cwIdTimer.hasExpired()) {
if (m_mode == MODE_IDLE && !m_modem->hasTX()){
@@ -996,6 +1000,11 @@ int CMMDVMHost::run()
m_display->close();
delete m_display;
if (m_mobileGPS != NULL) {
m_mobileGPS->close();
delete m_mobileGPS;
}
if (m_ump != NULL) {
m_ump->close();
delete m_ump;
@@ -1222,6 +1231,24 @@ bool CMMDVMHost::createDMRNetwork()
return false;
}
bool mobileGPSEnabled = m_conf.getMobileGPSEnabled();
if (mobileGPSEnabled) {
std::string mobileGPSAddress = m_conf.getMobileGPSAddress();
unsigned int mobileGPSPort = m_conf.getMobileGPSPort();
LogInfo("Mobile GPS Parameters");
LogInfo(" Address: %s", mobileGPSAddress.c_str());
LogInfo(" Port; %u", mobileGPSPort);
m_mobileGPS = new CMobileGPS(address, port, m_dmrNetwork);
ret = m_mobileGPS->open();
if (!ret) {
delete m_mobileGPS;
m_mobileGPS = NULL;
}
}
m_dmrNetwork->enable(true);
return true;