YSFClients/YSFGateway/YSFGateway.h

79 lines
2.1 KiB
C
Raw Normal View History

2016-05-27 18:55:44 +02:00
/*
2020-04-05 15:58:35 +02:00
* Copyright (C) 2016,2017,2018,2020 by Jonathan Naylor G4KLX
2016-05-27 18:55:44 +02: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.
*/
#if !defined(YSFGateway_H)
#define YSFGateway_H
2018-02-21 19:41:24 +01:00
#include "YSFNetwork.h"
2018-03-05 21:00:29 +01:00
#include "YSFReflectors.h"
2018-02-21 20:46:21 +01:00
#include "FCSNetwork.h"
#include "APRSWriter.h"
2016-05-27 18:55:44 +02:00
#include "WiresX.h"
#include "Timer.h"
2016-05-27 18:55:44 +02:00
#include "Conf.h"
2017-08-15 21:57:17 +02:00
#include "DTMF.h"
2016-05-27 18:55:44 +02:00
#include "GPS.h"
#include <string>
enum LINK_TYPE {
LINK_NONE,
LINK_YSF,
LINK_FCS
};
2016-05-27 18:55:44 +02:00
class CYSFGateway
{
public:
CYSFGateway(const std::string& configFile);
~CYSFGateway();
int run();
private:
2018-03-05 21:00:29 +01:00
std::string m_callsign;
std::string m_suffix;
CConf m_conf;
CAPRSWriter* m_writer;
2018-03-05 21:00:29 +01:00
CGPS* m_gps;
CYSFReflectors* m_reflectors;
CWiresX* m_wiresX;
CDTMF m_dtmf;
CYSFNetwork* m_ysfNetwork;
CFCSNetwork* m_fcsNetwork;
LINK_TYPE m_linkType;
std::string m_current;
std::string m_startup;
bool m_exclude;
CTimer m_inactivityTimer;
CTimer m_lostTimer;
2018-05-13 19:40:31 +02:00
bool m_fcsNetworkEnabled;
2020-04-05 15:58:35 +02:00
CUDPSocket* m_remoteSocket;
2016-05-27 18:55:44 +02:00
2018-02-22 21:14:49 +01:00
void startupLinking();
2018-02-22 20:11:21 +01:00
std::string calculateLocator();
void processWiresX(const unsigned char* buffer, unsigned char fi, unsigned char dt, unsigned char fn, unsigned char ft, bool dontProcessWiresXLocal, bool wiresXCommandPassthrough);
2018-02-23 09:06:54 +01:00
void processDTMF(unsigned char* buffer, unsigned char dt);
void createWiresX(CYSFNetwork* rptNetwork);
2016-05-27 18:55:44 +02:00
void createGPS();
2018-05-09 21:04:09 +02:00
void readFCSRoomsFile(const std::string& filename);
2020-04-05 15:58:35 +02:00
void processRemoteCommands();
2016-05-27 18:55:44 +02:00
};
#endif