Merge remote-tracking branch 'upstream/master'
This commit is contained in:
commit
974251485d
32
Conf.cpp
32
Conf.cpp
|
@ -57,7 +57,7 @@ enum SECTION {
|
||||||
SECTION_OLED,
|
SECTION_OLED,
|
||||||
SECTION_LCDPROC,
|
SECTION_LCDPROC,
|
||||||
SECTION_LOCK_FILE,
|
SECTION_LOCK_FILE,
|
||||||
SECTION_MOBILE_GPS,
|
SECTION_GPSD,
|
||||||
SECTION_REMOTE_CONTROL
|
SECTION_REMOTE_CONTROL
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -283,9 +283,9 @@ m_lcdprocUTC(false),
|
||||||
m_lcdprocDimOnIdle(false),
|
m_lcdprocDimOnIdle(false),
|
||||||
m_lockFileEnabled(false),
|
m_lockFileEnabled(false),
|
||||||
m_lockFileName(),
|
m_lockFileName(),
|
||||||
m_mobileGPSEnabled(false),
|
m_gpsdEnabled(false),
|
||||||
m_mobileGPSAddress(),
|
m_gpsdAddress(),
|
||||||
m_mobileGPSPort(0U),
|
m_gpsdPort(),
|
||||||
m_remoteControlEnabled(false),
|
m_remoteControlEnabled(false),
|
||||||
m_remoteControlPort(0U)
|
m_remoteControlPort(0U)
|
||||||
{
|
{
|
||||||
|
@ -367,8 +367,8 @@ bool CConf::read()
|
||||||
section = SECTION_LCDPROC;
|
section = SECTION_LCDPROC;
|
||||||
else if (::strncmp(buffer, "[Lock File]", 11U) == 0)
|
else if (::strncmp(buffer, "[Lock File]", 11U) == 0)
|
||||||
section = SECTION_LOCK_FILE;
|
section = SECTION_LOCK_FILE;
|
||||||
else if (::strncmp(buffer, "[Mobile GPS]", 12U) == 0)
|
else if (::strncmp(buffer, "[GPSD]", 6U) == 0)
|
||||||
section = SECTION_MOBILE_GPS;
|
section = SECTION_GPSD;
|
||||||
else if (::strncmp(buffer, "[Remote Control]", 16U) == 0)
|
else if (::strncmp(buffer, "[Remote Control]", 16U) == 0)
|
||||||
section = SECTION_REMOTE_CONTROL;
|
section = SECTION_REMOTE_CONTROL;
|
||||||
else
|
else
|
||||||
|
@ -950,13 +950,13 @@ bool CConf::read()
|
||||||
m_lockFileEnabled = ::atoi(value) == 1;
|
m_lockFileEnabled = ::atoi(value) == 1;
|
||||||
else if (::strcmp(key, "File") == 0)
|
else if (::strcmp(key, "File") == 0)
|
||||||
m_lockFileName = value;
|
m_lockFileName = value;
|
||||||
} else if (section == SECTION_MOBILE_GPS) {
|
} else if (section == SECTION_GPSD) {
|
||||||
if (::strcmp(key, "Enable") == 0)
|
if (::strcmp(key, "Enable") == 0)
|
||||||
m_mobileGPSEnabled = ::atoi(value) == 1;
|
m_gpsdEnabled = ::atoi(value) == 1;
|
||||||
else if (::strcmp(key, "Address") == 0)
|
else if (::strcmp(key, "Address") == 0)
|
||||||
m_mobileGPSAddress = value;
|
m_gpsdAddress = value;
|
||||||
else if (::strcmp(key, "Port") == 0)
|
else if (::strcmp(key, "Port") == 0)
|
||||||
m_mobileGPSPort = (unsigned int)::atoi(value);
|
m_gpsdPort = value;
|
||||||
} else if (section == SECTION_REMOTE_CONTROL) {
|
} else if (section == SECTION_REMOTE_CONTROL) {
|
||||||
if (::strcmp(key, "Enable") == 0)
|
if (::strcmp(key, "Enable") == 0)
|
||||||
m_remoteControlEnabled = ::atoi(value) == 1;
|
m_remoteControlEnabled = ::atoi(value) == 1;
|
||||||
|
@ -2071,19 +2071,19 @@ std::string CConf::getLockFileName() const
|
||||||
return m_lockFileName;
|
return m_lockFileName;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool CConf::getMobileGPSEnabled() const
|
bool CConf::getGPSDEnabled() const
|
||||||
{
|
{
|
||||||
return m_mobileGPSEnabled;
|
return m_gpsdEnabled;
|
||||||
}
|
}
|
||||||
|
|
||||||
std::string CConf::getMobileGPSAddress() const
|
std::string CConf::getGPSDAddress() const
|
||||||
{
|
{
|
||||||
return m_mobileGPSAddress;
|
return m_gpsdAddress;
|
||||||
}
|
}
|
||||||
|
|
||||||
unsigned int CConf::getMobileGPSPort() const
|
std::string CConf::getGPSDPort() const
|
||||||
{
|
{
|
||||||
return m_mobileGPSPort;
|
return m_gpsdPort;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool CConf::getRemoteControlEnabled() const
|
bool CConf::getRemoteControlEnabled() const
|
||||||
|
|
14
Conf.h
14
Conf.h
|
@ -306,10 +306,10 @@ public:
|
||||||
bool getLockFileEnabled() const;
|
bool getLockFileEnabled() const;
|
||||||
std::string getLockFileName() const;
|
std::string getLockFileName() const;
|
||||||
|
|
||||||
// The Mobile GPS section
|
// The GPSD section
|
||||||
bool getMobileGPSEnabled() const;
|
bool getGPSDEnabled() const;
|
||||||
std::string getMobileGPSAddress() const;
|
std::string getGPSDAddress() const;
|
||||||
unsigned int getMobileGPSPort() const;
|
std::string getGPSDPort() const;
|
||||||
|
|
||||||
// The Remote Control section
|
// The Remote Control section
|
||||||
bool getRemoteControlEnabled() const;
|
bool getRemoteControlEnabled() const;
|
||||||
|
@ -565,9 +565,9 @@ private:
|
||||||
bool m_lockFileEnabled;
|
bool m_lockFileEnabled;
|
||||||
std::string m_lockFileName;
|
std::string m_lockFileName;
|
||||||
|
|
||||||
bool m_mobileGPSEnabled;
|
bool m_gpsdEnabled;
|
||||||
std::string m_mobileGPSAddress;
|
std::string m_gpsdAddress;
|
||||||
unsigned int m_mobileGPSPort;
|
std::string m_gpsdPort;
|
||||||
|
|
||||||
bool m_remoteControlEnabled;
|
bool m_remoteControlEnabled;
|
||||||
unsigned int m_remoteControlPort;
|
unsigned int m_remoteControlPort;
|
||||||
|
|
103
GPSD.cpp
Normal file
103
GPSD.cpp
Normal file
|
@ -0,0 +1,103 @@
|
||||||
|
/*
|
||||||
|
* Copyright (C) 2018,2020 by Jonathan Naylor G4KLX
|
||||||
|
*
|
||||||
|
* This program is free software; you can redistribute it and/or modify
|
||||||
|
* it under the terms of the GNU General Public License as published by
|
||||||
|
* the Free Software Foundation; either version 2 of the License, or
|
||||||
|
* (at your option) any later version.
|
||||||
|
*
|
||||||
|
* This program is distributed in the hope that it will be useful,
|
||||||
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
|
* GNU General Public License for more details.
|
||||||
|
*
|
||||||
|
* You should have received a copy of the GNU General Public License
|
||||||
|
* along with this program; if not, write to the Free Software
|
||||||
|
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
|
||||||
|
*/
|
||||||
|
|
||||||
|
#include "GPSD.h"
|
||||||
|
|
||||||
|
#if defined(USE_GPSD)
|
||||||
|
|
||||||
|
#include <cstdio>
|
||||||
|
#include <cassert>
|
||||||
|
#include <cstring>
|
||||||
|
#include <cmath>
|
||||||
|
|
||||||
|
CGPSD::CGPSD(const std::string& address, const std::string& port, CDMRNetwork* network) :
|
||||||
|
m_gpsdAddress(address),
|
||||||
|
m_gpsdPort(port),
|
||||||
|
m_network(network),
|
||||||
|
m_gpsdData(),
|
||||||
|
m_idTimer(1000U, 60U)
|
||||||
|
{
|
||||||
|
assert(!address.empty());
|
||||||
|
assert(!port.empty());
|
||||||
|
assert(network != NULL);
|
||||||
|
}
|
||||||
|
|
||||||
|
CGPSD::~CGPSD()
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
|
bool CGPSD::open()
|
||||||
|
{
|
||||||
|
int ret = ::gps_open(m_gpsdAddress.c_str(), m_gpsdPort.c_str(), &m_gpsdData);
|
||||||
|
if (ret != 0) {
|
||||||
|
LogError("Error when opening access to gpsd - %d - %s", errno, ::gps_errstr(errno));
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
::gps_stream(&m_gpsdData, WATCH_ENABLE | WATCH_JSON, NULL);
|
||||||
|
|
||||||
|
LogMessage("Connected to GPSD");
|
||||||
|
|
||||||
|
m_idTimer.start();
|
||||||
|
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
void CGPSD::clock(unsigned int ms)
|
||||||
|
{
|
||||||
|
m_idTimer.clock(ms);
|
||||||
|
|
||||||
|
if (m_idTimer.hasExpired()) {
|
||||||
|
sendReport();
|
||||||
|
m_idTimer.start();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
void CGPSD::close()
|
||||||
|
{
|
||||||
|
::gps_stream(&m_gpsdData, WATCH_DISABLE, NULL);
|
||||||
|
::gps_close(&m_gpsdData);
|
||||||
|
}
|
||||||
|
|
||||||
|
void CGPSD::sendReport()
|
||||||
|
{
|
||||||
|
if (!::gps_waiting(&m_gpsdData, 0))
|
||||||
|
return;
|
||||||
|
|
||||||
|
#if GPSD_API_MAJOR_VERSION >= 7
|
||||||
|
if (::gps_read(&m_gpsdData, NULL, 0) <= 0)
|
||||||
|
return;
|
||||||
|
#else
|
||||||
|
if (::gps_read(&m_gpsdData) <= 0)
|
||||||
|
return;
|
||||||
|
#endif
|
||||||
|
|
||||||
|
if (m_gpsdData.status != STATUS_FIX)
|
||||||
|
return;
|
||||||
|
|
||||||
|
bool latlonSet = (m_gpsdData.set & LATLON_SET) == LATLON_SET;
|
||||||
|
if (!latlonSet)
|
||||||
|
return;
|
||||||
|
|
||||||
|
float latitude = float(m_gpsdData.fix.latitude);
|
||||||
|
float longitude = float(m_gpsdData.fix.longitude);
|
||||||
|
|
||||||
|
m_network->writeHomePosition(latitude, longitude);
|
||||||
|
}
|
||||||
|
|
||||||
|
#endif
|
|
@ -1,5 +1,5 @@
|
||||||
/*
|
/*
|
||||||
* Copyright (C) 2018 by Jonathan Naylor G4KLX
|
* Copyright (C) 2018,2020 by Jonathan Naylor G4KLX
|
||||||
*
|
*
|
||||||
* This program is free software; you can redistribute it and/or modify
|
* This program is free software; you can redistribute it and/or modify
|
||||||
* it under the terms of the GNU General Public License as published by
|
* it under the terms of the GNU General Public License as published by
|
||||||
|
@ -16,32 +16,22 @@
|
||||||
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
|
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#ifndef MobileGPS_H
|
#ifndef GPSD_H
|
||||||
#define MobileGPS_H
|
#define GPSD_H
|
||||||
|
|
||||||
|
#if defined(USE_GPSD)
|
||||||
|
|
||||||
#include "DMRNetwork.h"
|
#include "DMRNetwork.h"
|
||||||
#include "UDPSocket.h"
|
|
||||||
#include "Timer.h"
|
#include "Timer.h"
|
||||||
|
|
||||||
#include <string>
|
#include <string>
|
||||||
|
|
||||||
#if !defined(_WIN32) && !defined(_WIN64)
|
#include <gps.h>
|
||||||
#include <netdb.h>
|
|
||||||
#include <sys/time.h>
|
|
||||||
#include <sys/types.h>
|
|
||||||
#include <sys/socket.h>
|
|
||||||
#include <unistd.h>
|
|
||||||
#include <netinet/in.h>
|
|
||||||
#include <arpa/inet.h>
|
|
||||||
#include <errno.h>
|
|
||||||
#else
|
|
||||||
#include <winsock.h>
|
|
||||||
#endif
|
|
||||||
|
|
||||||
class CMobileGPS {
|
class CGPSD {
|
||||||
public:
|
public:
|
||||||
CMobileGPS(const std::string& address, unsigned int port, CDMRNetwork* network);
|
CGPSD(const std::string& address, const std::string& port, CDMRNetwork* network);
|
||||||
~CMobileGPS();
|
~CGPSD();
|
||||||
|
|
||||||
bool open();
|
bool open();
|
||||||
|
|
||||||
|
@ -50,14 +40,15 @@ public:
|
||||||
void close();
|
void close();
|
||||||
|
|
||||||
private:
|
private:
|
||||||
CTimer m_idTimer;
|
std::string m_gpsdAddress;
|
||||||
in_addr m_address;
|
std::string m_gpsdPort;
|
||||||
unsigned int m_port;
|
CDMRNetwork* m_network;
|
||||||
CUDPSocket m_socket;
|
struct gps_data_t m_gpsdData;
|
||||||
CDMRNetwork* m_network;
|
CTimer m_idTimer;
|
||||||
|
|
||||||
bool pollGPS();
|
|
||||||
void sendReport();
|
void sendReport();
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#endif
|
|
@ -288,10 +288,10 @@ UTC=0
|
||||||
Enable=0
|
Enable=0
|
||||||
File=/tmp/MMDVM_Active.lck
|
File=/tmp/MMDVM_Active.lck
|
||||||
|
|
||||||
[Mobile GPS]
|
[GPSD]
|
||||||
Enable=0
|
Enable=0
|
||||||
Address=127.0.0.1
|
Address=127.0.0.1
|
||||||
Port=7834
|
Port=2947
|
||||||
|
|
||||||
[Remote Control]
|
[Remote Control]
|
||||||
Enable=0
|
Enable=0
|
||||||
|
|
|
@ -161,7 +161,9 @@ m_id(0U),
|
||||||
m_cwCallsign(),
|
m_cwCallsign(),
|
||||||
m_lockFileEnabled(false),
|
m_lockFileEnabled(false),
|
||||||
m_lockFileName(),
|
m_lockFileName(),
|
||||||
m_mobileGPS(NULL),
|
#if defined(USE_GPSD)
|
||||||
|
m_gpsd(NULL),
|
||||||
|
#endif
|
||||||
m_remoteControl(NULL),
|
m_remoteControl(NULL),
|
||||||
m_fixedMode(false)
|
m_fixedMode(false)
|
||||||
{
|
{
|
||||||
|
@ -1004,8 +1006,10 @@ int CMMDVMHost::run()
|
||||||
if (m_pocsagNetwork != NULL)
|
if (m_pocsagNetwork != NULL)
|
||||||
m_pocsagNetwork->clock(ms);
|
m_pocsagNetwork->clock(ms);
|
||||||
|
|
||||||
if (m_mobileGPS != NULL)
|
#if defined(USE_GPSD)
|
||||||
m_mobileGPS->clock(ms);
|
if (m_gpsd != NULL)
|
||||||
|
m_gpsd->clock(ms);
|
||||||
|
#endif
|
||||||
|
|
||||||
m_cwIdTimer.clock(ms);
|
m_cwIdTimer.clock(ms);
|
||||||
if (m_cwIdTimer.isRunning() && m_cwIdTimer.hasExpired()) {
|
if (m_cwIdTimer.isRunning() && m_cwIdTimer.hasExpired()) {
|
||||||
|
@ -1082,10 +1086,12 @@ int CMMDVMHost::run()
|
||||||
m_display->close();
|
m_display->close();
|
||||||
delete m_display;
|
delete m_display;
|
||||||
|
|
||||||
if (m_mobileGPS != NULL) {
|
#if defined(USE_GPSD)
|
||||||
m_mobileGPS->close();
|
if (m_gpsd != NULL) {
|
||||||
delete m_mobileGPS;
|
m_gpsd->close();
|
||||||
|
delete m_gpsd;
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
if (m_ump != NULL) {
|
if (m_ump != NULL) {
|
||||||
m_ump->close();
|
m_ump->close();
|
||||||
|
@ -1392,23 +1398,25 @@ bool CMMDVMHost::createDMRNetwork()
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool mobileGPSEnabled = m_conf.getMobileGPSEnabled();
|
#if defined(USE_GPSD)
|
||||||
if (mobileGPSEnabled) {
|
bool gpsdEnabled = m_conf.getGPSDEnabled();
|
||||||
std::string mobileGPSAddress = m_conf.getMobileGPSAddress();
|
if (gpsdEnabled) {
|
||||||
unsigned int mobileGPSPort = m_conf.getMobileGPSPort();
|
std::string gpsdAddress = m_conf.getGPSDAddress();
|
||||||
|
std::string gpsdPort = m_conf.getGPSDPort();
|
||||||
|
|
||||||
LogInfo("Mobile GPS Parameters");
|
LogInfo("GPSD Parameters");
|
||||||
LogInfo(" Address: %s", mobileGPSAddress.c_str());
|
LogInfo(" Address: %s", gpsdAddress.c_str());
|
||||||
LogInfo(" Port: %u", mobileGPSPort);
|
LogInfo(" Port: %s", gpsdPort.c_str());
|
||||||
|
|
||||||
m_mobileGPS = new CMobileGPS(address, port, m_dmrNetwork);
|
m_gpsd = new CGPSD(gpsdAddress, gpsdPort, m_dmrNetwork);
|
||||||
|
|
||||||
ret = m_mobileGPS->open();
|
ret = m_gpsd->open();
|
||||||
if (!ret) {
|
if (!ret) {
|
||||||
delete m_mobileGPS;
|
delete m_gpsd;
|
||||||
m_mobileGPS = NULL;
|
m_gpsd = NULL;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
m_dmrNetwork->enable(true);
|
m_dmrNetwork->enable(true);
|
||||||
|
|
||||||
|
|
|
@ -34,11 +34,11 @@
|
||||||
#include "P25Network.h"
|
#include "P25Network.h"
|
||||||
#include "DMRNetwork.h"
|
#include "DMRNetwork.h"
|
||||||
#include "DMRLookup.h"
|
#include "DMRLookup.h"
|
||||||
#include "MobileGPS.h"
|
|
||||||
#include "Display.h"
|
#include "Display.h"
|
||||||
#include "Timer.h"
|
#include "Timer.h"
|
||||||
#include "Modem.h"
|
#include "Modem.h"
|
||||||
#include "Conf.h"
|
#include "Conf.h"
|
||||||
|
#include "GPSD.h"
|
||||||
#include "UMP.h"
|
#include "UMP.h"
|
||||||
|
|
||||||
#include <string>
|
#include <string>
|
||||||
|
@ -102,7 +102,9 @@ private:
|
||||||
std::string m_cwCallsign;
|
std::string m_cwCallsign;
|
||||||
bool m_lockFileEnabled;
|
bool m_lockFileEnabled;
|
||||||
std::string m_lockFileName;
|
std::string m_lockFileName;
|
||||||
CMobileGPS* m_mobileGPS;
|
#if defined(USE_GPSD)
|
||||||
|
CGPSD* m_gpsd;
|
||||||
|
#endif
|
||||||
CRemoteControl* m_remoteControl;
|
CRemoteControl* m_remoteControl;
|
||||||
bool m_fixedMode;
|
bool m_fixedMode;
|
||||||
|
|
||||||
|
|
|
@ -183,13 +183,13 @@
|
||||||
<ClInclude Include="DStarSlowData.h" />
|
<ClInclude Include="DStarSlowData.h" />
|
||||||
<ClInclude Include="Golay2087.h" />
|
<ClInclude Include="Golay2087.h" />
|
||||||
<ClInclude Include="Golay24128.h" />
|
<ClInclude Include="Golay24128.h" />
|
||||||
|
<ClInclude Include="GPSD.h" />
|
||||||
<ClInclude Include="Hamming.h" />
|
<ClInclude Include="Hamming.h" />
|
||||||
<ClInclude Include="DMRLookup.h" />
|
<ClInclude Include="DMRLookup.h" />
|
||||||
<ClInclude Include="I2CController.h" />
|
<ClInclude Include="I2CController.h" />
|
||||||
<ClInclude Include="LCDproc.h" />
|
<ClInclude Include="LCDproc.h" />
|
||||||
<ClInclude Include="Log.h" />
|
<ClInclude Include="Log.h" />
|
||||||
<ClInclude Include="MMDVMHost.h" />
|
<ClInclude Include="MMDVMHost.h" />
|
||||||
<ClInclude Include="MobileGPS.h" />
|
|
||||||
<ClInclude Include="Modem.h" />
|
<ClInclude Include="Modem.h" />
|
||||||
<ClInclude Include="ModemSerialPort.h" />
|
<ClInclude Include="ModemSerialPort.h" />
|
||||||
<ClInclude Include="Mutex.h" />
|
<ClInclude Include="Mutex.h" />
|
||||||
|
@ -281,12 +281,12 @@
|
||||||
<ClCompile Include="DStarSlowData.cpp" />
|
<ClCompile Include="DStarSlowData.cpp" />
|
||||||
<ClCompile Include="Golay2087.cpp" />
|
<ClCompile Include="Golay2087.cpp" />
|
||||||
<ClCompile Include="Golay24128.cpp" />
|
<ClCompile Include="Golay24128.cpp" />
|
||||||
|
<ClCompile Include="GPSD.cpp" />
|
||||||
<ClCompile Include="Hamming.cpp" />
|
<ClCompile Include="Hamming.cpp" />
|
||||||
<ClCompile Include="I2CController.cpp" />
|
<ClCompile Include="I2CController.cpp" />
|
||||||
<ClCompile Include="LCDproc.cpp" />
|
<ClCompile Include="LCDproc.cpp" />
|
||||||
<ClCompile Include="Log.cpp" />
|
<ClCompile Include="Log.cpp" />
|
||||||
<ClCompile Include="MMDVMHost.cpp" />
|
<ClCompile Include="MMDVMHost.cpp" />
|
||||||
<ClCompile Include="MobileGPS.cpp" />
|
|
||||||
<ClCompile Include="Modem.cpp" />
|
<ClCompile Include="Modem.cpp" />
|
||||||
<ClCompile Include="ModemSerialPort.cpp" />
|
<ClCompile Include="ModemSerialPort.cpp" />
|
||||||
<ClCompile Include="Mutex.cpp" />
|
<ClCompile Include="Mutex.cpp" />
|
||||||
|
|
|
@ -278,9 +278,6 @@
|
||||||
<ClInclude Include="I2CController.h">
|
<ClInclude Include="I2CController.h">
|
||||||
<Filter>Header Files</Filter>
|
<Filter>Header Files</Filter>
|
||||||
</ClInclude>
|
</ClInclude>
|
||||||
<ClInclude Include="MobileGPS.h">
|
|
||||||
<Filter>Header Files</Filter>
|
|
||||||
</ClInclude>
|
|
||||||
<ClInclude Include="NullModem.h">
|
<ClInclude Include="NullModem.h">
|
||||||
<Filter>Header Files</Filter>
|
<Filter>Header Files</Filter>
|
||||||
</ClInclude>
|
</ClInclude>
|
||||||
|
@ -305,6 +302,9 @@
|
||||||
<ClInclude Include="NXDNKenwoodNetwork.h">
|
<ClInclude Include="NXDNKenwoodNetwork.h">
|
||||||
<Filter>Header Files</Filter>
|
<Filter>Header Files</Filter>
|
||||||
</ClInclude>
|
</ClInclude>
|
||||||
|
<ClInclude Include="GPSD.h">
|
||||||
|
<Filter>Header Files</Filter>
|
||||||
|
</ClInclude>
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<ClCompile Include="BPTC19696.cpp">
|
<ClCompile Include="BPTC19696.cpp">
|
||||||
|
@ -547,9 +547,6 @@
|
||||||
<ClCompile Include="I2CController.cpp">
|
<ClCompile Include="I2CController.cpp">
|
||||||
<Filter>Source Files</Filter>
|
<Filter>Source Files</Filter>
|
||||||
</ClCompile>
|
</ClCompile>
|
||||||
<ClCompile Include="MobileGPS.cpp">
|
|
||||||
<Filter>Source Files</Filter>
|
|
||||||
</ClCompile>
|
|
||||||
<ClCompile Include="NullModem.cpp">
|
<ClCompile Include="NullModem.cpp">
|
||||||
<Filter>Source Files</Filter>
|
<Filter>Source Files</Filter>
|
||||||
</ClCompile>
|
</ClCompile>
|
||||||
|
@ -574,5 +571,8 @@
|
||||||
<ClCompile Include="NXDNKenwoodNetwork.cpp">
|
<ClCompile Include="NXDNKenwoodNetwork.cpp">
|
||||||
<Filter>Source Files</Filter>
|
<Filter>Source Files</Filter>
|
||||||
</ClCompile>
|
</ClCompile>
|
||||||
|
<ClCompile Include="GPSD.cpp">
|
||||||
|
<Filter>Source Files</Filter>
|
||||||
|
</ClCompile>
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
</Project>
|
</Project>
|
13
Makefile
13
Makefile
|
@ -2,14 +2,21 @@
|
||||||
|
|
||||||
CC = cc
|
CC = cc
|
||||||
CXX = c++
|
CXX = c++
|
||||||
|
|
||||||
|
# Use the following CFLAGS and LIBS if you don't want to use gpsd.
|
||||||
CFLAGS = -g -O3 -Wall -std=c++0x -pthread
|
CFLAGS = -g -O3 -Wall -std=c++0x -pthread
|
||||||
LIBS = -lpthread
|
LIBS = -lpthread
|
||||||
|
|
||||||
|
# Use the following CFLAGS and LIBS if you do want to use gpsd.
|
||||||
|
#CFLAGS = -g -O3 -Wall -DUSE_GPSD -std=c++0x -pthread
|
||||||
|
#LIBS = -lpthread -lgps
|
||||||
|
|
||||||
LDFLAGS = -g
|
LDFLAGS = -g
|
||||||
|
|
||||||
OBJECTS = \
|
OBJECTS = \
|
||||||
AMBEFEC.o BCH.o BPTC19696.o CASTInfo.o Conf.o CRC.o Display.o DMRControl.o DMRCSBK.o DMRData.o DMRDataHeader.o DMREMB.o DMREmbeddedData.o DMRFullLC.o \
|
AMBEFEC.o BCH.o BPTC19696.o CASTInfo.o Conf.o CRC.o Display.o DMRControl.o DMRCSBK.o DMRData.o DMRDataHeader.o DMREMB.o DMREmbeddedData.o DMRFullLC.o \
|
||||||
DMRLookup.o DMRLC.o DMRNetwork.o DMRShortLC.o DMRSlot.o DMRSlotType.o DMRAccessControl.o DMRTA.o DMRTrellis.o DStarControl.o DStarHeader.o DStarNetwork.o \
|
DMRLookup.o DMRLC.o DMRNetwork.o DMRShortLC.o DMRSlot.o DMRSlotType.o DMRAccessControl.o DMRTA.o DMRTrellis.o DStarControl.o DStarHeader.o DStarNetwork.o \
|
||||||
DStarSlowData.o Golay2087.o Golay24128.o Hamming.o I2CController.o LCDproc.o Log.o MMDVMHost.o MobileGPS.o Modem.o ModemSerialPort.o Mutex.o \
|
DStarSlowData.o Golay2087.o Golay24128.o GPSD.o Hamming.o I2CController.o LCDproc.o Log.o MMDVMHost.o Modem.o ModemSerialPort.o Mutex.o \
|
||||||
NetworkInfo.o Nextion.o NullDisplay.o NullModem.o NXDNAudio.o NXDNControl.o NXDNConvolution.o NXDNCRC.o NXDNFACCH1.o NXDNIcomNetwork.o \
|
NetworkInfo.o Nextion.o NullDisplay.o NullModem.o NXDNAudio.o NXDNControl.o NXDNConvolution.o NXDNCRC.o NXDNFACCH1.o NXDNIcomNetwork.o \
|
||||||
NXDNKenwoodNetwork.o NXDNLayer3.o NXDNLICH.o NXDNLookup.o NXDNNetwork.o NXDNSACCH.o NXDNUDCH.o P25Audio.o P25Control.o P25Data.o P25LowSpeedData.o \
|
NXDNKenwoodNetwork.o NXDNLayer3.o NXDNLICH.o NXDNLookup.o NXDNNetwork.o NXDNSACCH.o NXDNUDCH.o P25Audio.o P25Control.o P25Data.o P25LowSpeedData.o \
|
||||||
P25Network.o P25NID.o P25Trellis.o P25Utils.o POCSAGControl.o POCSAGNetwork.o QR1676.o RemoteControl.o RS129.o RS241213.o RSSIInterpolator.o \
|
P25Network.o P25NID.o P25Trellis.o P25Utils.o POCSAGControl.o POCSAGNetwork.o QR1676.o RemoteControl.o RS129.o RS241213.o RSSIInterpolator.o \
|
||||||
|
@ -27,6 +34,10 @@ RemoteCommand: Log.o RemoteCommand.o UDPSocket.o
|
||||||
%.o: %.cpp
|
%.o: %.cpp
|
||||||
$(CXX) $(CFLAGS) -c -o $@ $<
|
$(CXX) $(CFLAGS) -c -o $@ $<
|
||||||
|
|
||||||
|
install:
|
||||||
|
install -m 755 MMDVMHost /usr/local/bin/
|
||||||
|
install -m 755 RemoteCommand /usr/local/bin/
|
||||||
|
|
||||||
clean:
|
clean:
|
||||||
$(RM) MMDVMHost RemoteCommand *.o *.d *.bak *~ GitVersion.h
|
$(RM) MMDVMHost RemoteCommand *.o *.d *.bak *~ GitVersion.h
|
||||||
|
|
||||||
|
|
12
Makefile.Pi
12
Makefile.Pi
|
@ -2,14 +2,20 @@
|
||||||
|
|
||||||
CC = gcc
|
CC = gcc
|
||||||
CXX = g++
|
CXX = g++
|
||||||
|
# Use the following CFLAGS and LIBS if you don't want to use gpsd.
|
||||||
CFLAGS = -g -O3 -Wall -std=c++0x -pthread -DRASPBERRY_PI -I/usr/local/include
|
CFLAGS = -g -O3 -Wall -std=c++0x -pthread -DRASPBERRY_PI -I/usr/local/include
|
||||||
LIBS = -lwiringPi -lwiringPiDev -lpthread
|
LIBS = -lwiringPi -lwiringPiDev -lpthread
|
||||||
|
|
||||||
|
# Use the following CFLAGS and LIBS if you do want to use gpsd.
|
||||||
|
#CFLAGS = -g -O3 -Wall -DUSE_GPSD -std=c++0x -pthread -DRASPBERRY_PI -I/usr/local/include
|
||||||
|
#LIBS = -lwiringPi -lwiringPiDev -lpthread -lgps
|
||||||
|
|
||||||
LDFLAGS = -g -L/usr/local/lib
|
LDFLAGS = -g -L/usr/local/lib
|
||||||
|
|
||||||
OBJECTS = \
|
OBJECTS = \
|
||||||
AMBEFEC.o BCH.o BPTC19696.o CASTInfo.o Conf.o CRC.o Display.o DMRControl.o DMRCSBK.o DMRData.o DMRDataHeader.o DMREMB.o DMREmbeddedData.o DMRFullLC.o \
|
AMBEFEC.o BCH.o BPTC19696.o CASTInfo.o Conf.o CRC.o Display.o DMRControl.o DMRCSBK.o DMRData.o DMRDataHeader.o DMREMB.o DMREmbeddedData.o DMRFullLC.o \
|
||||||
DMRLookup.o DMRLC.o DMRNetwork.o DMRShortLC.o DMRSlot.o DMRSlotType.o DMRAccessControl.o DMRTA.o DMRTrellis.o DStarControl.o DStarHeader.o DStarNetwork.o \
|
DMRLookup.o DMRLC.o DMRNetwork.o DMRShortLC.o DMRSlot.o DMRSlotType.o DMRAccessControl.o DMRTA.o DMRTrellis.o DStarControl.o DStarHeader.o DStarNetwork.o \
|
||||||
DStarSlowData.o Golay2087.o Golay24128.o Hamming.o I2CController.o LCDproc.o Log.o MMDVMHost.o MobileGPS.o Modem.o ModemSerialPort.o Mutex.o \
|
DStarSlowData.o Golay2087.o Golay24128.o GPSD.o Hamming.o I2CController.o LCDproc.o Log.o MMDVMHost.o Modem.o ModemSerialPort.o Mutex.o \
|
||||||
NetworkInfo.o Nextion.o NullDisplay.o NullModem.o NXDNAudio.o NXDNControl.o NXDNConvolution.o NXDNCRC.o NXDNFACCH1.o NXDNIcomNetwork.o NXDNKenwoodNetwork.o \
|
NetworkInfo.o Nextion.o NullDisplay.o NullModem.o NXDNAudio.o NXDNControl.o NXDNConvolution.o NXDNCRC.o NXDNFACCH1.o NXDNIcomNetwork.o NXDNKenwoodNetwork.o \
|
||||||
NXDNLayer3.o NXDNLICH.o NXDNLookup.o NXDNNetwork.o NXDNSACCH.o NXDNUDCH.o P25Audio.o P25Control.o P25Data.o P25LowSpeedData.o P25Network.o P25NID.o \
|
NXDNLayer3.o NXDNLICH.o NXDNLookup.o NXDNNetwork.o NXDNSACCH.o NXDNUDCH.o P25Audio.o P25Control.o P25Data.o P25LowSpeedData.o P25Network.o P25NID.o \
|
||||||
P25Trellis.o P25Utils.o POCSAGControl.o POCSAGNetwork.o QR1676.o RemoteControl.o RS129.o RS241213.o RSSIInterpolator.o SerialController.o SerialPort.o \
|
P25Trellis.o P25Utils.o POCSAGControl.o POCSAGNetwork.o QR1676.o RemoteControl.o RS129.o RS241213.o RSSIInterpolator.o SerialController.o SerialPort.o \
|
||||||
|
@ -27,6 +33,10 @@ RemoteCommand: Log.o RemoteCommand.o UDPSocket.o
|
||||||
%.o: %.cpp
|
%.o: %.cpp
|
||||||
$(CXX) $(CFLAGS) -c -o $@ $<
|
$(CXX) $(CFLAGS) -c -o $@ $<
|
||||||
|
|
||||||
|
install:
|
||||||
|
install -m 755 MMDVMHost /usr/local/bin/
|
||||||
|
install -m 755 RemoteCommand /usr/local/bin/
|
||||||
|
|
||||||
clean:
|
clean:
|
||||||
$(RM) MMDVMHost RemoteCommand *.o *.d *.bak *~ GitVersion.h
|
$(RM) MMDVMHost RemoteCommand *.o *.d *.bak *~ GitVersion.h
|
||||||
|
|
||||||
|
|
|
@ -3,14 +3,20 @@
|
||||||
|
|
||||||
CC = gcc
|
CC = gcc
|
||||||
CXX = g++
|
CXX = g++
|
||||||
|
# Use the following CFLAGS and LIBS if you don't want to use gpsd.
|
||||||
CFLAGS = -g -O3 -Wall -std=c++0x -pthread -DHD44780 -DADAFRUIT_DISPLAY -I/usr/local/include
|
CFLAGS = -g -O3 -Wall -std=c++0x -pthread -DHD44780 -DADAFRUIT_DISPLAY -I/usr/local/include
|
||||||
LIBS = -lwiringPi -lwiringPiDev -lpthread
|
LIBS = -lwiringPi -lwiringPiDev -lpthread
|
||||||
|
|
||||||
|
# Use the following CFLAGS and LIBS if you do want to use gpsd.
|
||||||
|
#CFLAGS = -g -O3 -Wall -DUSE_GPSD -std=c++0x -pthread -DHD44780 -DADAFRUIT_DISPLAY -I/usr/local/include
|
||||||
|
#LIBS = -lwiringPi -lwiringPiDev -lpthread -lgps
|
||||||
|
|
||||||
LDFLAGS = -g -L/usr/local/lib
|
LDFLAGS = -g -L/usr/local/lib
|
||||||
|
|
||||||
OBJECTS = \
|
OBJECTS = \
|
||||||
AMBEFEC.o BCH.o BPTC19696.o CASTInfo.o Conf.o CRC.o Display.o DMRControl.o DMRCSBK.o DMRData.o DMRDataHeader.o DMREMB.o DMREmbeddedData.o DMRFullLC.o \
|
AMBEFEC.o BCH.o BPTC19696.o CASTInfo.o Conf.o CRC.o Display.o DMRControl.o DMRCSBK.o DMRData.o DMRDataHeader.o DMREMB.o DMREmbeddedData.o DMRFullLC.o \
|
||||||
DMRLookup.o DMRLC.o DMRNetwork.o DMRShortLC.o DMRSlot.o DMRSlotType.o DMRAccessControl.o DMRTA.o DMRTrellis.o DStarControl.o DStarHeader.o DStarNetwork.o \
|
DMRLookup.o DMRLC.o DMRNetwork.o DMRShortLC.o DMRSlot.o DMRSlotType.o DMRAccessControl.o DMRTA.o DMRTrellis.o DStarControl.o DStarHeader.o DStarNetwork.o \
|
||||||
DStarSlowData.o Golay2087.o Golay24128.o Hamming.o HD44780.o I2CController.o LCDproc.o Log.o MMDVMHost.o MobileGPS.o Modem.o ModemSerialPort.o Mutex.o \
|
DStarSlowData.o Golay2087.o Golay24128.o GPSD.o Hamming.o HD44780.o I2CController.o LCDproc.o Log.o MMDVMHost.o Modem.o ModemSerialPort.o Mutex.o \
|
||||||
NetworkInfo.o Nextion.o NullDisplay.o NullModem.o NXDNAudio.o NXDNControl.o NXDNConvolution.o NXDNCRC.o NXDNFACCH1.o NXDNIcomNetwork.o NXDNKenwoodNetwork.o \
|
NetworkInfo.o Nextion.o NullDisplay.o NullModem.o NXDNAudio.o NXDNControl.o NXDNConvolution.o NXDNCRC.o NXDNFACCH1.o NXDNIcomNetwork.o NXDNKenwoodNetwork.o \
|
||||||
NXDNLayer3.o NXDNLICH.o NXDNLookup.o NXDNNetwork.o NXDNSACCH.o NXDNUDCH.o P25Audio.o P25Control.o P25Data.o P25LowSpeedData.o P25Network.o P25NID.o \
|
NXDNLayer3.o NXDNLICH.o NXDNLookup.o NXDNNetwork.o NXDNSACCH.o NXDNUDCH.o P25Audio.o P25Control.o P25Data.o P25LowSpeedData.o P25Network.o P25NID.o \
|
||||||
P25Trellis.o P25Utils.o POCSAGControl.o POCSAGNetwork.o QR1676.o RemoteControl.o RS129.o RS241213.o RSSIInterpolator.o SerialController.o SerialPort.o \
|
P25Trellis.o P25Utils.o POCSAGControl.o POCSAGNetwork.o QR1676.o RemoteControl.o RS129.o RS241213.o RSSIInterpolator.o SerialController.o SerialPort.o \
|
||||||
|
@ -28,6 +34,10 @@ RemoteCommand: Log.o RemoteCommand.o UDPSocket.o
|
||||||
%.o: %.cpp
|
%.o: %.cpp
|
||||||
$(CXX) $(CFLAGS) -c -o $@ $<
|
$(CXX) $(CFLAGS) -c -o $@ $<
|
||||||
|
|
||||||
|
install:
|
||||||
|
install -m 755 MMDVMHost /usr/local/bin/
|
||||||
|
install -m 755 RemoteCommand /usr/local/bin/
|
||||||
|
|
||||||
clean:
|
clean:
|
||||||
$(RM) MMDVMHost RemoteCommand *.o *.d *.bak *~ GitVersion.h
|
$(RM) MMDVMHost RemoteCommand *.o *.d *.bak *~ GitVersion.h
|
||||||
|
|
||||||
|
|
|
@ -2,14 +2,21 @@
|
||||||
|
|
||||||
CC = gcc
|
CC = gcc
|
||||||
CXX = g++
|
CXX = g++
|
||||||
|
|
||||||
|
# Use the following CFLAGS and LIBS if you don't want to use gpsd.
|
||||||
CFLAGS = -g -O3 -Wall -std=c++0x -pthread -DHD44780 -I/usr/local/include
|
CFLAGS = -g -O3 -Wall -std=c++0x -pthread -DHD44780 -I/usr/local/include
|
||||||
LIBS = -lwiringPi -lwiringPiDev -lpthread
|
LIBS = -lwiringPi -lwiringPiDev -lpthread
|
||||||
|
|
||||||
|
# Use the following CFLAGS and LIBS if you do want to use gpsd.
|
||||||
|
#CFLAGS = -g -O3 -Wall -DUSE_GPSD -std=c++0x -pthread -DHD44780 -I/usr/local/include
|
||||||
|
#LIBS = -lwiringPi -lwiringPiDev -lpthread -lgps
|
||||||
|
|
||||||
LDFLAGS = -g -L/usr/local/lib
|
LDFLAGS = -g -L/usr/local/lib
|
||||||
|
|
||||||
OBJECTS = \
|
OBJECTS = \
|
||||||
AMBEFEC.o BCH.o BPTC19696.o CASTInfo.o Conf.o CRC.o Display.o DMRControl.o DMRCSBK.o DMRData.o DMRDataHeader.o DMREMB.o DMREmbeddedData.o DMRFullLC.o \
|
AMBEFEC.o BCH.o BPTC19696.o CASTInfo.o Conf.o CRC.o Display.o DMRControl.o DMRCSBK.o DMRData.o DMRDataHeader.o DMREMB.o DMREmbeddedData.o DMRFullLC.o \
|
||||||
DMRLookup.o DMRLC.o DMRNetwork.o DMRShortLC.o DMRSlot.o DMRSlotType.o DMRAccessControl.o DMRTA.o DMRTrellis.o DStarControl.o DStarHeader.o DStarNetwork.o \
|
DMRLookup.o DMRLC.o DMRNetwork.o DMRShortLC.o DMRSlot.o DMRSlotType.o DMRAccessControl.o DMRTA.o DMRTrellis.o DStarControl.o DStarHeader.o DStarNetwork.o \
|
||||||
DStarSlowData.o Golay2087.o Golay24128.o Hamming.o HD44780.o I2CController.o LCDproc.o Log.o MMDVMHost.o MobileGPS.o Modem.o ModemSerialPort.o Mutex.o \
|
DStarSlowData.o Golay2087.o Golay24128.o GPSD.o Hamming.o HD44780.o I2CController.o LCDproc.o Log.o MMDVMHost.o Modem.o ModemSerialPort.o Mutex.o \
|
||||||
NetworkInfo.o Nextion.o NullDisplay.o NullModem.o NXDNAudio.o NXDNControl.o NXDNConvolution.o NXDNCRC.o NXDNFACCH1.o NXDNIcomNetwork.o NXDNKenwoodNetwork.o \
|
NetworkInfo.o Nextion.o NullDisplay.o NullModem.o NXDNAudio.o NXDNControl.o NXDNConvolution.o NXDNCRC.o NXDNFACCH1.o NXDNIcomNetwork.o NXDNKenwoodNetwork.o \
|
||||||
NXDNLayer3.o NXDNLICH.o NXDNLookup.o NXDNNetwork.o NXDNSACCH.o NXDNUDCH.o P25Audio.o P25Control.o P25Data.o P25LowSpeedData.o P25Network.o P25NID.o \
|
NXDNLayer3.o NXDNLICH.o NXDNLookup.o NXDNNetwork.o NXDNSACCH.o NXDNUDCH.o P25Audio.o P25Control.o P25Data.o P25LowSpeedData.o P25Network.o P25NID.o \
|
||||||
P25Trellis.o P25Utils.o POCSAGControl.o POCSAGNetwork.o QR1676.o RemoteControl.o RS129.o RS241213.o RSSIInterpolator.o SerialController.o SerialPort.o \
|
P25Trellis.o P25Utils.o POCSAGControl.o POCSAGNetwork.o QR1676.o RemoteControl.o RS129.o RS241213.o RSSIInterpolator.o SerialController.o SerialPort.o \
|
||||||
|
@ -27,6 +34,10 @@ RemoteCommand: Log.o RemoteCommand.o UDPSocket.o
|
||||||
%.o: %.cpp
|
%.o: %.cpp
|
||||||
$(CXX) $(CFLAGS) -c -o $@ $<
|
$(CXX) $(CFLAGS) -c -o $@ $<
|
||||||
|
|
||||||
|
install:
|
||||||
|
install -m 755 MMDVMHost /usr/local/bin/
|
||||||
|
install -m 755 RemoteCommand /usr/local/bin/
|
||||||
|
|
||||||
clean:
|
clean:
|
||||||
$(RM) MMDVMHost RemoteCommand *.o *.d *.bak *~ GitVersion.h
|
$(RM) MMDVMHost RemoteCommand *.o *.d *.bak *~ GitVersion.h
|
||||||
|
|
||||||
|
|
|
@ -2,14 +2,21 @@
|
||||||
|
|
||||||
CC = gcc
|
CC = gcc
|
||||||
CXX = g++
|
CXX = g++
|
||||||
|
|
||||||
|
# Use the following CFLAGS and LIBS if you don't want to use gpsd.
|
||||||
CFLAGS = -g -O3 -Wall -std=c++0x -pthread -DOLED -I/usr/local/include
|
CFLAGS = -g -O3 -Wall -std=c++0x -pthread -DOLED -I/usr/local/include
|
||||||
LIBS = -lArduiPi_OLED -lwiringPi -lpthread
|
LIBS = -lArduiPi_OLED -lwiringPi -lpthread
|
||||||
|
|
||||||
|
# Use the following CFLAGS and LIBS if you do want to use gpsd.
|
||||||
|
#CFLAGS = -g -O3 -Wall -DUSE_GPSD -std=c++0x -pthread -DOLED -I/usr/local/include
|
||||||
|
#LIBS = -lArduiPi_OLED -lwiringPi -lpthread -lgps
|
||||||
|
|
||||||
LDFLAGS = -g -L/usr/local/lib
|
LDFLAGS = -g -L/usr/local/lib
|
||||||
|
|
||||||
OBJECTS = \
|
OBJECTS = \
|
||||||
AMBEFEC.o BCH.o BPTC19696.o CASTInfo.o Conf.o CRC.o Display.o DMRControl.o DMRCSBK.o DMRData.o DMRDataHeader.o DMREMB.o DMREmbeddedData.o DMRFullLC.o \
|
AMBEFEC.o BCH.o BPTC19696.o CASTInfo.o Conf.o CRC.o Display.o DMRControl.o DMRCSBK.o DMRData.o DMRDataHeader.o DMREMB.o DMREmbeddedData.o DMRFullLC.o \
|
||||||
DMRLookup.o DMRLC.o DMRNetwork.o DMRShortLC.o DMRSlot.o DMRSlotType.o DMRAccessControl.o DMRTA.o DMRTrellis.o DStarControl.o DStarHeader.o DStarNetwork.o \
|
DMRLookup.o DMRLC.o DMRNetwork.o DMRShortLC.o DMRSlot.o DMRSlotType.o DMRAccessControl.o DMRTA.o DMRTrellis.o DStarControl.o DStarHeader.o DStarNetwork.o \
|
||||||
DStarSlowData.o Golay2087.o Golay24128.o Hamming.o I2CController.o OLED.o LCDproc.o Log.o MMDVMHost.o MobileGPS.o Modem.o ModemSerialPort.o Mutex.o \
|
DStarSlowData.o Golay2087.o Golay24128.o GPSD.o Hamming.o I2CController.o OLED.o LCDproc.o Log.o MMDVMHost.o Modem.o ModemSerialPort.o Mutex.o \
|
||||||
NetworkInfo.o Nextion.o NullDisplay.o NullModem.o NXDNAudio.o NXDNControl.o NXDNConvolution.o NXDNCRC.o NXDNFACCH1.o NXDNIcomNetwork.o NXDNKenwoodNetwork.o \
|
NetworkInfo.o Nextion.o NullDisplay.o NullModem.o NXDNAudio.o NXDNControl.o NXDNConvolution.o NXDNCRC.o NXDNFACCH1.o NXDNIcomNetwork.o NXDNKenwoodNetwork.o \
|
||||||
NXDNLayer3.o NXDNLICH.o NXDNLookup.o NXDNNetwork.o NXDNSACCH.o NXDNUDCH.o P25Audio.o P25Control.o P25Data.o P25LowSpeedData.o P25Network.o P25NID.o \
|
NXDNLayer3.o NXDNLICH.o NXDNLookup.o NXDNNetwork.o NXDNSACCH.o NXDNUDCH.o P25Audio.o P25Control.o P25Data.o P25LowSpeedData.o P25Network.o P25NID.o \
|
||||||
P25Trellis.o P25Utils.o POCSAGControl.o POCSAGNetwork.o QR1676.o RemoteControl.o RS129.o RS241213.o RSSIInterpolator.o SerialController.o SerialPort.o \
|
P25Trellis.o P25Utils.o POCSAGControl.o POCSAGNetwork.o QR1676.o RemoteControl.o RS129.o RS241213.o RSSIInterpolator.o SerialController.o SerialPort.o \
|
||||||
|
@ -27,6 +34,10 @@ RemoteCommand: Log.o RemoteCommand.o UDPSocket.o
|
||||||
%.o: %.cpp
|
%.o: %.cpp
|
||||||
$(CXX) $(CFLAGS) -c -o $@ $<
|
$(CXX) $(CFLAGS) -c -o $@ $<
|
||||||
|
|
||||||
|
install:
|
||||||
|
install -m 755 MMDVMHost /usr/local/bin/
|
||||||
|
install -m 755 RemoteCommand /usr/local/bin/
|
||||||
|
|
||||||
clean:
|
clean:
|
||||||
$(RM) MMDVMHost RemoteCommand *.o *.d *.bak *~ GitVersion.h
|
$(RM) MMDVMHost RemoteCommand *.o *.d *.bak *~ GitVersion.h
|
||||||
|
|
||||||
|
|
|
@ -3,14 +3,21 @@
|
||||||
|
|
||||||
CC = gcc
|
CC = gcc
|
||||||
CXX = g++
|
CXX = g++
|
||||||
|
|
||||||
|
# Use the following CFLAGS and LIBS if you don't want to use gpsd.
|
||||||
CFLAGS = -g -O3 -Wall -std=c++0x -pthread -DHD44780 -DPCF8574_DISPLAY -I/usr/local/include
|
CFLAGS = -g -O3 -Wall -std=c++0x -pthread -DHD44780 -DPCF8574_DISPLAY -I/usr/local/include
|
||||||
LIBS = -lwiringPi -lwiringPiDev -lpthread
|
LIBS = -lwiringPi -lwiringPiDev -lpthread
|
||||||
|
|
||||||
|
# Use the following CFLAGS and LIBS if you do want to use gpsd.
|
||||||
|
#CFLAGS = -g -O3 -Wall -DUSE_GPSD -std=c++0x -pthread -DHD44780 -DPCF8574_DISPLAY -I/usr/local/include
|
||||||
|
#LIBS = -lwiringPi -lwiringPiDev -lpthread -lgps
|
||||||
|
|
||||||
LDFLAGS = -g -L/usr/local/lib
|
LDFLAGS = -g -L/usr/local/lib
|
||||||
|
|
||||||
OBJECTS = \
|
OBJECTS = \
|
||||||
AMBEFEC.o BCH.o BPTC19696.o CASTInfo.o Conf.o CRC.o Display.o DMRControl.o DMRCSBK.o DMRData.o DMRDataHeader.o DMREMB.o DMREmbeddedData.o DMRFullLC.o \
|
AMBEFEC.o BCH.o BPTC19696.o CASTInfo.o Conf.o CRC.o Display.o DMRControl.o DMRCSBK.o DMRData.o DMRDataHeader.o DMREMB.o DMREmbeddedData.o DMRFullLC.o \
|
||||||
DMRLookup.o DMRLC.o DMRNetwork.o DMRShortLC.o DMRSlot.o DMRSlotType.o DMRAccessControl.o DMRTA.o DMRTrellis.o DStarControl.o DStarHeader.o DStarNetwork.o \
|
DMRLookup.o DMRLC.o DMRNetwork.o DMRShortLC.o DMRSlot.o DMRSlotType.o DMRAccessControl.o DMRTA.o DMRTrellis.o DStarControl.o DStarHeader.o DStarNetwork.o \
|
||||||
DStarSlowData.o Golay2087.o Golay24128.o Hamming.o HD44780.o I2CController.o LCDproc.o Log.o MMDVMHost.o MobileGPS.o Modem.o ModemSerialPort.o Mutex.o \
|
DStarSlowData.o Golay2087.o Golay24128.o GPSD.o Hamming.o HD44780.o I2CController.o LCDproc.o Log.o MMDVMHost.o Modem.o ModemSerialPort.o Mutex.o \
|
||||||
NetworkInfo.o Nextion.o NullDisplay.o NullModem.o NXDNAudio.o NXDNControl.o NXDNConvolution.o NXDNCRC.o NXDNFACCH1.o NXDNIcomNetwork.o NXDNKenwoodNetwork.o \
|
NetworkInfo.o Nextion.o NullDisplay.o NullModem.o NXDNAudio.o NXDNControl.o NXDNConvolution.o NXDNCRC.o NXDNFACCH1.o NXDNIcomNetwork.o NXDNKenwoodNetwork.o \
|
||||||
NXDNLayer3.o NXDNLICH.o NXDNLookup.o NXDNNetwork.o NXDNSACCH.o NXDNUDCH.o P25Audio.o P25Control.o P25Data.o P25LowSpeedData.o P25Network.o P25NID.o \
|
NXDNLayer3.o NXDNLICH.o NXDNLookup.o NXDNNetwork.o NXDNSACCH.o NXDNUDCH.o P25Audio.o P25Control.o P25Data.o P25LowSpeedData.o P25Network.o P25NID.o \
|
||||||
P25Trellis.o P25Utils.o POCSAGControl.o POCSAGNetwork.o QR1676.o RemoteControl.o RS129.o RS241213.o RSSIInterpolator.o SerialController.o SerialPort.o \
|
P25Trellis.o P25Utils.o POCSAGControl.o POCSAGNetwork.o QR1676.o RemoteControl.o RS129.o RS241213.o RSSIInterpolator.o SerialController.o SerialPort.o \
|
||||||
|
@ -28,6 +35,10 @@ RemoteCommand: Log.o RemoteCommand.o UDPSocket.o
|
||||||
%.o: %.cpp
|
%.o: %.cpp
|
||||||
$(CXX) $(CFLAGS) -c -o $@ $<
|
$(CXX) $(CFLAGS) -c -o $@ $<
|
||||||
|
|
||||||
|
install:
|
||||||
|
install -m 755 MMDVMHost /usr/local/bin/
|
||||||
|
install -m 755 RemoteCommand /usr/local/bin/
|
||||||
|
|
||||||
clean:
|
clean:
|
||||||
$(RM) MMDVMHost RemoteCommand *.o *.d *.bak *~ GitVersion.h
|
$(RM) MMDVMHost RemoteCommand *.o *.d *.bak *~ GitVersion.h
|
||||||
|
|
||||||
|
|
|
@ -1,39 +0,0 @@
|
||||||
# This makefile is for Solaris using gcc
|
|
||||||
|
|
||||||
CC = gcc
|
|
||||||
CXX = g++
|
|
||||||
CFLAGS = -g -O3 -Wall -std=c++0x -pthread
|
|
||||||
LIBS = -lpthread -lsocket
|
|
||||||
LDFLAGS = -g
|
|
||||||
|
|
||||||
OBJECTS = \
|
|
||||||
AMBEFEC.o BCH.o BPTC19696.o CASTInfo.o Conf.o CRC.o Display.o DMRControl.o DMRCSBK.o DMRData.o DMRDataHeader.o DMREMB.o DMREmbeddedData.o DMRFullLC.o \
|
|
||||||
DMRLookup.o DMRLC.o DMRNetwork.o DMRShortLC.o DMRSlot.o DMRSlotType.o DMRAccessControl.o DMRTA.o DMRTrellis.o DStarControl.o DStarHeader.o DStarNetwork.o \
|
|
||||||
DStarSlowData.o Golay2087.o Golay24128.o Hamming.o LCDproc.o Log.o MMDVMHost.o MobileGPS.o Modem.o ModemSerialPort.o Mutex.o NetworkInfo.o Nextion.o \
|
|
||||||
NullDisplay.o NullModem.o NXDNAudio.o NXDNControl.o NXDNConvolution.o NXDNCRC.o NXDNFACCH1.o NXDNIcomNetwork.o NXDNKenwoodNetwork.o NXDNLayer3.o \
|
|
||||||
NXDNLICH.o NXDNLookup.o NXDNNetwork.o NXDNSACCH.o NXDNUDCH.o P25Audio.o P25Control.o P25Data.o P25LowSpeedData.o P25Network.o P25NID.o P25Trellis.o \
|
|
||||||
P25Utils.o POCSAGControl.o POCSAGNetwork.o QR1676.o RemoteControl.o RS129.o RS241213.o RSSIInterpolator.o SerialController.o SerialPort.o SHA256.o \
|
|
||||||
StopWatch.o Sync.o TFTSerial.o TFTSurenoo.o Thread.o Timer.o UDPSocket.o UMP.o UserDB.o UserDBebtry.o Utils.o YSFControl.o YSFConvolution.o YSFFICH.o \
|
|
||||||
YSFNetwork.o YSFPayload.o
|
|
||||||
|
|
||||||
all: MMDVMHost RemoteCommand
|
|
||||||
|
|
||||||
MMDVMHost: GitVersion.h $(OBJECTS)
|
|
||||||
$(CXX) $(OBJECTS) $(CFLAGS) $(LIBS) -o MMDVMHost
|
|
||||||
|
|
||||||
RemoteCommand: Log.o RemoteCommand.o UDPSocket.o
|
|
||||||
$(CXX) Log.o RemoteCommand.o UDPSocket.o $(CFLAGS) $(LIBS) -o RemoteCommand
|
|
||||||
|
|
||||||
%.o: %.cpp
|
|
||||||
$(CXX) $(CFLAGS) -c -o $@ $<
|
|
||||||
|
|
||||||
clean:
|
|
||||||
$(RM) MMDVMHost RemoteCommand *.o *.d *.bak *~ GitVersion.h
|
|
||||||
|
|
||||||
# Export the current git version if the index file exists, else 000...
|
|
||||||
GitVersion.h:
|
|
||||||
ifneq ("$(wildcard .git/index)","")
|
|
||||||
echo "const char *gitversion = \"$(shell git rev-parse HEAD)\";" > $@
|
|
||||||
else
|
|
||||||
echo "const char *gitversion = \"0000000000000000000000000000000000000000\";" > $@
|
|
||||||
endif
|
|
101
MobileGPS.cpp
101
MobileGPS.cpp
|
@ -1,101 +0,0 @@
|
||||||
/*
|
|
||||||
* Copyright (C) 2018 by Jonathan Naylor G4KLX
|
|
||||||
*
|
|
||||||
* This program is free software; you can redistribute it and/or modify
|
|
||||||
* it under the terms of the GNU General Public License as published by
|
|
||||||
* the Free Software Foundation; either version 2 of the License, or
|
|
||||||
* (at your option) any later version.
|
|
||||||
*
|
|
||||||
* This program is distributed in the hope that it will be useful,
|
|
||||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
||||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
||||||
* GNU General Public License for more details.
|
|
||||||
*
|
|
||||||
* You should have received a copy of the GNU General Public License
|
|
||||||
* along with this program; if not, write to the Free Software
|
|
||||||
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
|
|
||||||
*/
|
|
||||||
|
|
||||||
#include "MobileGPS.h"
|
|
||||||
|
|
||||||
#include <cstdio>
|
|
||||||
#include <cassert>
|
|
||||||
#include <cstring>
|
|
||||||
#include <cmath>
|
|
||||||
|
|
||||||
CMobileGPS::CMobileGPS(const std::string& address, unsigned int port, CDMRNetwork* network) :
|
|
||||||
m_idTimer(1000U, 60U),
|
|
||||||
m_address(),
|
|
||||||
m_port(port),
|
|
||||||
m_socket(),
|
|
||||||
m_network(network)
|
|
||||||
{
|
|
||||||
assert(!address.empty());
|
|
||||||
assert(port > 0U);
|
|
||||||
assert(network != NULL);
|
|
||||||
|
|
||||||
m_address = CUDPSocket::lookup(address);
|
|
||||||
}
|
|
||||||
|
|
||||||
CMobileGPS::~CMobileGPS()
|
|
||||||
{
|
|
||||||
}
|
|
||||||
|
|
||||||
bool CMobileGPS::open()
|
|
||||||
{
|
|
||||||
bool ret = m_socket.open();
|
|
||||||
if (!ret)
|
|
||||||
return false;
|
|
||||||
|
|
||||||
m_idTimer.start();
|
|
||||||
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
|
|
||||||
void CMobileGPS::clock(unsigned int ms)
|
|
||||||
{
|
|
||||||
m_idTimer.clock(ms);
|
|
||||||
|
|
||||||
if (m_idTimer.hasExpired()) {
|
|
||||||
pollGPS();
|
|
||||||
m_idTimer.start();
|
|
||||||
}
|
|
||||||
|
|
||||||
sendReport();
|
|
||||||
}
|
|
||||||
|
|
||||||
void CMobileGPS::close()
|
|
||||||
{
|
|
||||||
m_socket.close();
|
|
||||||
}
|
|
||||||
|
|
||||||
bool CMobileGPS::pollGPS()
|
|
||||||
{
|
|
||||||
return m_socket.write((unsigned char*)"MMDVMHost", 9U, m_address, m_port);
|
|
||||||
}
|
|
||||||
|
|
||||||
void CMobileGPS::sendReport()
|
|
||||||
{
|
|
||||||
// Grab GPS data if it's available
|
|
||||||
unsigned char buffer[200U];
|
|
||||||
in_addr address;
|
|
||||||
unsigned int port;
|
|
||||||
int ret = m_socket.read(buffer, 200U, address, port);
|
|
||||||
if (ret <= 0)
|
|
||||||
return;
|
|
||||||
|
|
||||||
buffer[ret] = '\0';
|
|
||||||
|
|
||||||
// Parse the GPS data
|
|
||||||
char* pLatitude = ::strtok((char*)buffer, ",\n"); // Latitude
|
|
||||||
char* pLongitude = ::strtok(NULL, ",\n"); // Longitude
|
|
||||||
|
|
||||||
if (pLatitude == NULL || pLongitude == NULL)
|
|
||||||
return;
|
|
||||||
|
|
||||||
float latitude = float(::atof(pLatitude));
|
|
||||||
float longitude = float(::atof(pLongitude));
|
|
||||||
|
|
||||||
m_network->writeHomePosition(latitude, longitude);
|
|
||||||
}
|
|
||||||
|
|
12
OLED.cpp
12
OLED.cpp
|
@ -240,7 +240,8 @@ void COLED::setIdleInt()
|
||||||
// m_display.print("Idle");
|
// m_display.print("Idle");
|
||||||
|
|
||||||
// m_display.setTextSize(1);
|
// m_display.setTextSize(1);
|
||||||
m_display.startscrolldiagright(0x00,0x0f); //the MMDVM logo scrolls the whole screen
|
if (m_displayScroll && m_displayLogoScreensaver)
|
||||||
|
m_display.startscrolldiagright(0x00,0x0f); //the MMDVM logo scrolls the whole screen
|
||||||
m_display.display();
|
m_display.display();
|
||||||
|
|
||||||
unsigned char info[100U];
|
unsigned char info[100U];
|
||||||
|
@ -568,7 +569,8 @@ void COLED::writeCWInt()
|
||||||
|
|
||||||
m_display.setTextSize(1);
|
m_display.setTextSize(1);
|
||||||
m_display.display();
|
m_display.display();
|
||||||
m_display.startscrollright(0x02,0x0f);
|
if (m_displayScroll)
|
||||||
|
m_display.startscrollright(0x02,0x0f);
|
||||||
}
|
}
|
||||||
|
|
||||||
void COLED::clearCWInt()
|
void COLED::clearCWInt()
|
||||||
|
@ -581,14 +583,16 @@ void COLED::clearCWInt()
|
||||||
|
|
||||||
m_display.setTextSize(1);
|
m_display.setTextSize(1);
|
||||||
m_display.display();
|
m_display.display();
|
||||||
m_display.startscrollleft(0x02,0x0f);
|
if (m_displayScroll)
|
||||||
|
m_display.startscrollleft(0x02,0x0f);
|
||||||
}
|
}
|
||||||
|
|
||||||
void COLED::close()
|
void COLED::close()
|
||||||
{
|
{
|
||||||
m_display.clearDisplay();
|
m_display.clearDisplay();
|
||||||
m_display.fillRect(0, 0, m_display.width(), 16, BLACK);
|
m_display.fillRect(0, 0, m_display.width(), 16, BLACK);
|
||||||
m_display.startscrollright(0x00,0x01);
|
if (m_displayScroll)
|
||||||
|
m_display.startscrollright(0x00,0x01);
|
||||||
m_display.setCursor(0,00);
|
m_display.setCursor(0,00);
|
||||||
m_display.setTextSize(2);
|
m_display.setTextSize(2);
|
||||||
m_display.print("-CLOSE-");
|
m_display.print("-CLOSE-");
|
||||||
|
|
Loading…
Reference in a new issue