2018-11-06 12:14:57 +00:00
|
|
|
/*
|
2020-06-29 10:25:10 +00:00
|
|
|
* Copyright (C) 2018,2020 by Jonathan Naylor G4KLX
|
2018-11-06 12:14:57 +00:00
|
|
|
*
|
|
|
|
* 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.
|
|
|
|
*/
|
|
|
|
|
2020-06-29 10:25:10 +00:00
|
|
|
#ifndef GPSD_H
|
|
|
|
#define GPSD_H
|
|
|
|
|
2020-06-30 10:38:25 +00:00
|
|
|
#if defined(USE_GPSD)
|
2018-11-06 12:14:57 +00:00
|
|
|
|
|
|
|
#include "DMRNetwork.h"
|
|
|
|
#include "Timer.h"
|
|
|
|
|
|
|
|
#include <string>
|
|
|
|
|
2020-06-29 10:25:10 +00:00
|
|
|
#include <gps.h>
|
2018-11-06 12:14:57 +00:00
|
|
|
|
2020-06-29 10:25:10 +00:00
|
|
|
class CGPSD {
|
2018-11-06 12:14:57 +00:00
|
|
|
public:
|
2020-06-29 10:25:10 +00:00
|
|
|
CGPSD(const std::string& address, const std::string& port, CDMRNetwork* network);
|
|
|
|
~CGPSD();
|
2018-11-06 12:14:57 +00:00
|
|
|
|
|
|
|
bool open();
|
|
|
|
|
|
|
|
void clock(unsigned int ms);
|
|
|
|
|
|
|
|
void close();
|
|
|
|
|
|
|
|
private:
|
2020-06-29 10:25:10 +00:00
|
|
|
std::string m_gpsdAddress;
|
|
|
|
std::string m_gpsdPort;
|
|
|
|
CDMRNetwork* m_network;
|
|
|
|
struct gps_data_t m_gpsdData;
|
|
|
|
CTimer m_idTimer;
|
2018-11-06 12:14:57 +00:00
|
|
|
|
|
|
|
void sendReport();
|
|
|
|
};
|
|
|
|
|
|
|
|
#endif
|
2020-06-29 10:25:10 +00:00
|
|
|
|
|
|
|
#endif
|