mirror of
https://github.com/g4klx/MMDVMHost
synced 2025-12-21 23:45:49 +08:00
Add MobileGPS support for DMR.
This commit is contained in:
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user