2016-01-14 18:45:04 +00:00
|
|
|
/*
|
|
|
|
* Copyright (C) 2015,2016 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>
|
2016-04-04 18:03:38 +00:00
|
|
|
#include <vector>
|
2016-01-14 18:45:04 +00:00
|
|
|
|
|
|
|
class CConf
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
CConf(const std::string& file);
|
|
|
|
~CConf();
|
|
|
|
|
|
|
|
bool read();
|
|
|
|
|
|
|
|
// The General section
|
|
|
|
std::string getCallsign() const;
|
|
|
|
unsigned int getTimeout() const;
|
|
|
|
bool getDuplex() const;
|
|
|
|
unsigned int getModeHang() const;
|
|
|
|
std::string getDisplay() const;
|
2016-05-03 22:01:49 +00:00
|
|
|
bool getDaemon() const;
|
2016-01-14 18:45:04 +00:00
|
|
|
|
|
|
|
// The Info section
|
|
|
|
unsigned int getRxFrequency() const;
|
|
|
|
unsigned int getTxFrequency() const;
|
|
|
|
unsigned int getPower() const;
|
|
|
|
float getLatitude() const;
|
|
|
|
float getLongitude() const;
|
|
|
|
int getHeight() const;
|
|
|
|
std::string getLocation() const;
|
|
|
|
std::string getDescription() const;
|
|
|
|
std::string getURL() const;
|
|
|
|
|
|
|
|
// The Log section
|
2016-03-07 18:42:05 +00:00
|
|
|
unsigned int getLogDisplayLevel() const;
|
|
|
|
unsigned int getLogFileLevel() const;
|
|
|
|
std::string getLogFilePath() const;
|
|
|
|
std::string getLogFileRoot() const;
|
2016-01-14 18:45:04 +00:00
|
|
|
|
2016-05-09 20:55:44 +00:00
|
|
|
// The CW ID section
|
|
|
|
bool getCWIdEnabled() const;
|
|
|
|
unsigned int getCWIdTime() const;
|
|
|
|
|
2016-01-14 18:45:04 +00:00
|
|
|
// The Modem section
|
|
|
|
std::string getModemPort() const;
|
|
|
|
bool getModemRXInvert() const;
|
|
|
|
bool getModemTXInvert() const;
|
|
|
|
bool getModemPTTInvert() const;
|
|
|
|
unsigned int getModemTXDelay() const;
|
2016-03-17 18:12:14 +00:00
|
|
|
unsigned int getModemDMRDelay() const;
|
2016-01-14 18:45:04 +00:00
|
|
|
unsigned int getModemRXLevel() const;
|
|
|
|
unsigned int getModemTXLevel() const;
|
2016-03-21 21:50:45 +00:00
|
|
|
int getModemOscOffset() const;
|
2016-01-14 18:45:04 +00:00
|
|
|
bool getModemDebug() const;
|
|
|
|
|
|
|
|
// The D-Star section
|
|
|
|
bool getDStarEnabled() const;
|
|
|
|
std::string getDStarModule() const;
|
2016-04-04 16:40:05 +00:00
|
|
|
bool getDStarSelfOnly() const;
|
2016-04-06 17:46:05 +00:00
|
|
|
std::vector<std::string> getDStarBlackList() const;
|
2016-01-14 18:45:04 +00:00
|
|
|
|
|
|
|
// The DMR section
|
|
|
|
bool getDMREnabled() const;
|
2016-01-14 19:58:16 +00:00
|
|
|
bool getDMRBeacons() const;
|
2016-01-14 18:45:04 +00:00
|
|
|
unsigned int getDMRId() const;
|
|
|
|
unsigned int getDMRColorCode() const;
|
2016-04-04 16:40:05 +00:00
|
|
|
bool getDMRSelfOnly() const;
|
2016-04-04 18:03:38 +00:00
|
|
|
std::vector<unsigned int> getDMRPrefixes() const;
|
2016-04-06 17:46:05 +00:00
|
|
|
std::vector<unsigned int> getDMRBlackList() const;
|
2016-06-07 14:33:41 +00:00
|
|
|
std::vector<unsigned int> getDMRDstIdBlacklistSlot1() const;
|
|
|
|
std::vector<unsigned int> getDMRDstIdBlacklistSlot2() const;
|
|
|
|
std::vector<unsigned int> getDMRDstIdWhitelistSlot1() const;
|
|
|
|
std::vector<unsigned int> getDMRDstIdWhitelistSlot2() const;
|
2016-04-12 17:26:13 +00:00
|
|
|
std::string getDMRLookupFile() const;
|
2016-05-05 16:56:18 +00:00
|
|
|
unsigned int getDMRTXHang() const;
|
2016-01-14 18:45:04 +00:00
|
|
|
|
|
|
|
// The System Fusion section
|
|
|
|
bool getFusionEnabled() const;
|
|
|
|
|
|
|
|
// The D-Star Network section
|
|
|
|
bool getDStarNetworkEnabled() const;
|
|
|
|
std::string getDStarGatewayAddress() const;
|
|
|
|
unsigned int getDStarGatewayPort() const;
|
|
|
|
unsigned int getDStarLocalPort() const;
|
|
|
|
bool getDStarNetworkDebug() const;
|
|
|
|
|
|
|
|
// The DMR Network section
|
|
|
|
bool getDMRNetworkEnabled() const;
|
|
|
|
std::string getDMRNetworkAddress() const;
|
|
|
|
unsigned int getDMRNetworkPort() const;
|
2016-04-03 18:11:45 +00:00
|
|
|
unsigned int getDMRNetworkLocal() const;
|
2016-01-14 18:45:04 +00:00
|
|
|
std::string getDMRNetworkPassword() const;
|
|
|
|
bool getDMRNetworkDebug() const;
|
2016-02-15 20:36:05 +00:00
|
|
|
bool getDMRNetworkSlot1() const;
|
|
|
|
bool getDMRNetworkSlot2() const;
|
2016-01-14 18:45:04 +00:00
|
|
|
|
|
|
|
// The System Fusion Network section
|
|
|
|
bool getFusionNetworkEnabled() const;
|
2016-06-07 20:17:57 +00:00
|
|
|
std::string getFusionNetworkMyAddress() const;
|
|
|
|
unsigned int getFusionNetworkMyPort() const;
|
|
|
|
std::string getFusionNetworkGwyAddress() const;
|
|
|
|
unsigned int getFusionNetworkGwyPort() const;
|
2016-01-14 18:45:04 +00:00
|
|
|
bool getFusionNetworkDebug() const;
|
|
|
|
|
|
|
|
// The TFTSERIAL section
|
|
|
|
std::string getTFTSerialPort() const;
|
2016-02-16 18:30:12 +00:00
|
|
|
unsigned int getTFTSerialBrightness() const;
|
2016-01-14 18:45:04 +00:00
|
|
|
|
2016-03-14 22:58:09 +00:00
|
|
|
// The HD44780 section
|
|
|
|
unsigned int getHD44780Rows() const;
|
|
|
|
unsigned int getHD44780Columns() const;
|
2016-04-06 16:43:20 +00:00
|
|
|
std::vector<unsigned int> getHD44780Pins() const;
|
2016-05-03 16:59:21 +00:00
|
|
|
bool getHD44780PWM() const;
|
2016-05-01 15:59:43 +00:00
|
|
|
unsigned int getHD44780PWMPin() const;
|
|
|
|
unsigned int getHD44780PWMBright() const;
|
|
|
|
unsigned int getHD44780PWMDim() const;
|
2016-06-01 10:55:24 +00:00
|
|
|
bool getHD44780DisplayClock() const;
|
|
|
|
bool getHD44780UTC() const;
|
2016-05-01 15:59:43 +00:00
|
|
|
|
2016-04-06 18:53:25 +00:00
|
|
|
// The Nextion section
|
|
|
|
std::string getNextionPort() const;
|
|
|
|
unsigned int getNextionBrightness() const;
|
2016-06-01 10:55:24 +00:00
|
|
|
bool getNextionDisplayClock() const;
|
|
|
|
bool getNextionUTC() const;
|
2016-04-06 18:53:25 +00:00
|
|
|
|
2016-05-06 23:03:39 +00:00
|
|
|
// The OLED section
|
|
|
|
unsigned char getOLEDType() const;
|
|
|
|
unsigned char getOLEDBrightness() const;
|
|
|
|
unsigned char getOLEDInvert() const;
|
|
|
|
|
2016-01-14 18:45:04 +00:00
|
|
|
private:
|
|
|
|
std::string m_file;
|
|
|
|
std::string m_callsign;
|
|
|
|
unsigned int m_timeout;
|
|
|
|
bool m_duplex;
|
|
|
|
unsigned int m_modeHang;
|
|
|
|
std::string m_display;
|
2016-05-03 22:01:49 +00:00
|
|
|
bool m_daemon;
|
2016-01-14 18:45:04 +00:00
|
|
|
|
|
|
|
unsigned int m_rxFrequency;
|
|
|
|
unsigned int m_txFrequency;
|
|
|
|
unsigned int m_power;
|
|
|
|
float m_latitude;
|
|
|
|
float m_longitude;
|
|
|
|
int m_height;
|
|
|
|
std::string m_location;
|
|
|
|
std::string m_description;
|
|
|
|
std::string m_url;
|
|
|
|
|
2016-03-07 18:42:05 +00:00
|
|
|
unsigned int m_logDisplayLevel;
|
|
|
|
unsigned int m_logFileLevel;
|
|
|
|
std::string m_logFilePath;
|
|
|
|
std::string m_logFileRoot;
|
2016-01-14 18:45:04 +00:00
|
|
|
|
2016-05-09 20:55:44 +00:00
|
|
|
bool m_cwIdEnabled;
|
|
|
|
unsigned int m_cwIdTime;
|
|
|
|
|
2016-01-14 18:45:04 +00:00
|
|
|
std::string m_modemPort;
|
|
|
|
bool m_modemRXInvert;
|
|
|
|
bool m_modemTXInvert;
|
|
|
|
bool m_modemPTTInvert;
|
|
|
|
unsigned int m_modemTXDelay;
|
2016-03-17 18:12:14 +00:00
|
|
|
unsigned int m_modemDMRDelay;
|
2016-01-14 18:45:04 +00:00
|
|
|
unsigned int m_modemRXLevel;
|
|
|
|
unsigned int m_modemTXLevel;
|
2016-03-21 21:50:45 +00:00
|
|
|
int m_modemOscOffset;
|
2016-01-14 18:45:04 +00:00
|
|
|
bool m_modemDebug;
|
|
|
|
|
|
|
|
bool m_dstarEnabled;
|
|
|
|
std::string m_dstarModule;
|
2016-04-04 16:40:05 +00:00
|
|
|
bool m_dstarSelfOnly;
|
2016-04-06 17:46:05 +00:00
|
|
|
std::vector<std::string> m_dstarBlackList;
|
2016-01-14 18:45:04 +00:00
|
|
|
|
|
|
|
bool m_dmrEnabled;
|
2016-01-14 19:58:16 +00:00
|
|
|
bool m_dmrBeacons;
|
2016-01-14 18:45:04 +00:00
|
|
|
unsigned int m_dmrId;
|
|
|
|
unsigned int m_dmrColorCode;
|
2016-04-04 16:40:05 +00:00
|
|
|
bool m_dmrSelfOnly;
|
2016-04-04 18:03:38 +00:00
|
|
|
std::vector<unsigned int> m_dmrPrefixes;
|
2016-04-06 17:46:05 +00:00
|
|
|
std::vector<unsigned int> m_dmrBlackList;
|
2016-06-07 14:33:41 +00:00
|
|
|
std::vector<unsigned int> m_dmrDstIdBlacklistSlot1;
|
|
|
|
std::vector<unsigned int> m_dmrDstIdBlacklistSlot2;
|
|
|
|
std::vector<unsigned int> m_dmrDstIdWhitelistSlot1;
|
|
|
|
std::vector<unsigned int> m_dmrDstIdWhitelistSlot2;
|
2016-04-12 17:26:13 +00:00
|
|
|
std::string m_dmrLookupFile;
|
2016-05-05 16:56:18 +00:00
|
|
|
unsigned int m_dmrTXHang;
|
2016-01-14 18:45:04 +00:00
|
|
|
|
|
|
|
bool m_fusionEnabled;
|
|
|
|
|
|
|
|
bool m_dstarNetworkEnabled;
|
|
|
|
std::string m_dstarGatewayAddress;
|
|
|
|
unsigned int m_dstarGatewayPort;
|
|
|
|
unsigned int m_dstarLocalPort;
|
|
|
|
bool m_dstarNetworkDebug;
|
|
|
|
|
|
|
|
bool m_dmrNetworkEnabled;
|
|
|
|
std::string m_dmrNetworkAddress;
|
|
|
|
unsigned int m_dmrNetworkPort;
|
2016-04-03 18:11:45 +00:00
|
|
|
unsigned int m_dmrNetworkLocal;
|
2016-01-14 18:45:04 +00:00
|
|
|
std::string m_dmrNetworkPassword;
|
|
|
|
bool m_dmrNetworkDebug;
|
2016-02-15 20:36:05 +00:00
|
|
|
bool m_dmrNetworkSlot1;
|
|
|
|
bool m_dmrNetworkSlot2;
|
2016-01-14 18:45:04 +00:00
|
|
|
|
|
|
|
bool m_fusionNetworkEnabled;
|
2016-06-07 20:17:57 +00:00
|
|
|
std::string m_fusionNetworkMyAddress;
|
|
|
|
unsigned int m_fusionNetworkMyPort;
|
|
|
|
std::string m_fusionNetworkGwyAddress;
|
|
|
|
unsigned int m_fusionNetworkGwyPort;
|
2016-01-14 18:45:04 +00:00
|
|
|
bool m_fusionNetworkDebug;
|
|
|
|
|
|
|
|
std::string m_tftSerialPort;
|
2016-02-16 18:30:12 +00:00
|
|
|
unsigned int m_tftSerialBrightness;
|
2016-03-14 22:58:09 +00:00
|
|
|
|
|
|
|
unsigned int m_hd44780Rows;
|
|
|
|
unsigned int m_hd44780Columns;
|
2016-04-06 16:43:20 +00:00
|
|
|
std::vector<unsigned int> m_hd44780Pins;
|
2016-05-03 16:59:21 +00:00
|
|
|
bool m_hd44780PWM;
|
2016-05-01 15:59:43 +00:00
|
|
|
unsigned int m_hd44780PWMPin;
|
|
|
|
unsigned int m_hd44780PWMBright;
|
|
|
|
unsigned int m_hd44780PWMDim;
|
2016-06-01 10:55:24 +00:00
|
|
|
bool m_hd44780DisplayClock;
|
|
|
|
bool m_hd44780UTC;
|
2016-05-01 15:59:43 +00:00
|
|
|
|
2016-04-06 18:53:25 +00:00
|
|
|
std::string m_nextionPort;
|
|
|
|
unsigned int m_nextionBrightness;
|
2016-06-01 10:55:24 +00:00
|
|
|
bool m_nextionDisplayClock;
|
|
|
|
bool m_nextionUTC;
|
2016-05-06 23:03:39 +00:00
|
|
|
|
|
|
|
unsigned char m_oledType;
|
|
|
|
unsigned char m_oledBrightness;
|
|
|
|
unsigned char m_oledInvert;
|
2016-01-14 18:45:04 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
#endif
|