DMRGateway/Conf.h

150 lines
4.5 KiB
C
Raw Normal View History

2017-04-20 21:51:30 +02:00
/*
* Copyright (C) 2015,2016,2017 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.
*/
#if !defined(CONF_H)
#define CONF_H
#include <string>
#include <vector>
struct CRewriteStruct {
unsigned int m_fromSlot;
unsigned int m_fromTG;
unsigned int m_toSlot;
unsigned int m_toTG;
};
2017-04-20 21:51:30 +02:00
class CConf
{
public:
2017-04-23 21:17:25 +02:00
CConf(const std::string& file);
~CConf();
2017-04-20 21:51:30 +02:00
2017-04-23 21:17:25 +02:00
bool read();
2017-04-20 21:51:30 +02:00
2017-04-23 21:17:25 +02:00
// The General section
bool getDaemon() const;
2017-04-20 21:51:30 +02:00
unsigned int getTimeout() const;
2017-04-23 21:17:25 +02:00
std::string getRptAddress() const;
unsigned int getRptPort() const;
std::string getLocalAddress() const;
unsigned int getLocalPort() const;
bool getDebug() const;
2017-04-20 21:51:30 +02:00
2017-04-23 21:17:25 +02:00
// The Log section
unsigned int getLogDisplayLevel() const;
unsigned int getLogFileLevel() const;
std::string getLogFilePath() const;
std::string getLogFileRoot() const;
2017-04-20 21:51:30 +02:00
2017-05-01 15:46:43 +02:00
// The Voice section
bool getVoiceEnabled() const;
std::string getVoiceLanguage() const;
2017-05-01 21:05:41 +02:00
std::string getVoiceDirectory() const;
2017-05-01 15:46:43 +02:00
// The DMR Network 1 section
bool getDMRNetwork1Enabled() const;
2017-05-06 10:57:17 +02:00
unsigned int getDMRNetwork1Id() const;
std::string getDMRNetwork1Address() const;
unsigned int getDMRNetwork1Port() const;
unsigned int getDMRNetwork1Local() const;
std::string getDMRNetwork1Password() const;
bool getDMRNetwork1Debug() const;
2017-05-13 18:55:20 +02:00
std::vector<CRewriteStruct> getDMRNetwork1TGRewrites() const;
bool getDMRNetwork1PrivateSlot1() const;
bool getDMRNetwork1PrivateSlot2() const;
// The DMR Network 2 section
bool getDMRNetwork2Enabled() const;
2017-05-06 10:57:17 +02:00
unsigned int getDMRNetwork2Id() const;
std::string getDMRNetwork2Address() const;
unsigned int getDMRNetwork2Port() const;
unsigned int getDMRNetwork2Local() const;
std::string getDMRNetwork2Password() const;
bool getDMRNetwork2Debug() const;
2017-05-13 18:55:20 +02:00
std::vector<CRewriteStruct> getDMRNetwork2TGRewrites() const;
bool getDMRNetwork2PrivateSlot1() const;
bool getDMRNetwork2PrivateSlot2() const;
2017-04-20 21:51:30 +02:00
// The XLX Network section
bool getXLXNetworkEnabled() const;
2017-05-06 10:57:17 +02:00
unsigned int getXLXNetworkId() const;
2017-04-20 21:51:30 +02:00
std::string getXLXNetworkAddress() const;
unsigned int getXLXNetworkPort() const;
unsigned int getXLXNetworkLocal() const;
std::string getXLXNetworkPassword() const;
unsigned int getXLXNetworkSlot() const;
unsigned int getXLXNetworkTG() const;
2017-04-20 21:51:30 +02:00
std::string getXLXNetworkOptions() const;
bool getXLXNetworkDebug() const;
private:
2017-04-23 21:17:25 +02:00
std::string m_file;
bool m_daemon;
std::string m_rptAddress;
unsigned int m_rptPort;
std::string m_localAddress;
unsigned int m_localPort;
2017-04-20 21:51:30 +02:00
unsigned int m_timeout;
2017-04-23 21:17:25 +02:00
bool m_debug;
2017-04-20 21:51:30 +02:00
2017-05-01 15:46:43 +02:00
bool m_voiceEnabled;
std::string m_voiceLanguage;
2017-05-01 21:05:41 +02:00
std::string m_voiceDirectory;
2017-05-01 15:46:43 +02:00
2017-04-23 21:17:25 +02:00
unsigned int m_logDisplayLevel;
unsigned int m_logFileLevel;
std::string m_logFilePath;
std::string m_logFileRoot;
2017-04-20 21:51:30 +02:00
bool m_dmrNetwork1Enabled;
2017-05-06 10:57:17 +02:00
unsigned int m_dmrNetwork1Id;
std::string m_dmrNetwork1Address;
unsigned int m_dmrNetwork1Port;
unsigned int m_dmrNetwork1Local;
std::string m_dmrNetwork1Password;
bool m_dmrNetwork1Debug;
2017-05-13 18:55:20 +02:00
std::vector<CRewriteStruct> m_dmrNetwork1TGRewrites;
2017-05-06 18:17:34 +02:00
bool m_dmrNetwork1PrivateSlot1;
bool m_dmrNetwork1PrivateSlot2;
bool m_dmrNetwork2Enabled;
2017-05-06 10:57:17 +02:00
unsigned int m_dmrNetwork2Id;
std::string m_dmrNetwork2Address;
unsigned int m_dmrNetwork2Port;
unsigned int m_dmrNetwork2Local;
std::string m_dmrNetwork2Password;
bool m_dmrNetwork2Debug;
2017-05-13 18:55:20 +02:00
std::vector<CRewriteStruct> m_dmrNetwork2TGRewrites;
2017-05-06 18:17:34 +02:00
bool m_dmrNetwork2PrivateSlot1;
bool m_dmrNetwork2PrivateSlot2;
2017-04-20 21:51:30 +02:00
bool m_xlxNetworkEnabled;
2017-05-06 10:57:17 +02:00
unsigned int m_xlxNetworkId;
2017-04-20 21:51:30 +02:00
std::string m_xlxNetworkAddress;
unsigned int m_xlxNetworkPort;
unsigned int m_xlxNetworkLocal;
std::string m_xlxNetworkPassword;
unsigned int m_xlxNetworkSlot;
unsigned int m_xlxNetworkTG;
2017-04-20 21:51:30 +02:00
std::string m_xlxNetworkOptions;
bool m_xlxNetworkDebug;
};
#endif