MMDVMHost-Private/Conf.h

342 lines
11 KiB
C
Raw Permalink Normal View History

2016-01-14 19:45:04 +01:00
/*
* Copyright (C) 2015-2021 by Jonathan Naylor G4KLX
2016-01-14 19:45:04 +01: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(CONF_H)
#define CONF_H
#include <string>
2016-04-04 20:03:38 +02:00
#include <vector>
2016-01-14 19:45:04 +01:00
class CConf
{
public:
CConf(const std::string& file);
~CConf();
bool read();
// The General section
std::string getCallsign() const;
2017-08-19 17:23:37 +02:00
unsigned int getId() const;
2016-01-14 19:45:04 +01:00
unsigned int getTimeout() const;
bool getDuplex() const;
std::string getDisplay() const;
bool getDaemon() const;
2016-01-14 19:45:04 +01:00
// The Info section
unsigned int getRXFrequency() const;
unsigned int getTXFrequency() const;
2016-01-14 19:45:04 +01:00
unsigned int getPower() const;
2020-12-09 10:41:11 +01:00
float getLatitude() const;
float getLongitude() const;
int getHeight() const;
std::string getLocation() const;
std::string getDescription() const;
std::string getURL() const;
2016-01-14 19:45:04 +01:00
// The Log section
2016-03-07 19:42:05 +01:00
unsigned int getLogDisplayLevel() const;
unsigned int getLogFileLevel() const;
std::string getLogFilePath() const;
std::string getLogFileRoot() const;
bool getLogFileRotate() const;
2016-01-14 19:45:04 +01:00
2016-05-09 22:55:44 +02:00
// The CW ID section
bool getCWIdEnabled() const;
unsigned int getCWIdTime() const;
std::string getCWIdCallsign() const;
2016-05-09 22:55:44 +02:00
// The DMR Id section
std::string getDMRIdLookupFile() const;
unsigned int getDMRIdLookupTime() const;
2016-01-14 19:45:04 +01:00
// The Modem section
std::string getModemProtocol() const;
std::string getModemUARTPort() const;
unsigned int getModemUARTSpeed() const;
std::string getModemI2CPort() const;
unsigned int getModemI2CAddress() const;
std::string getModemModemAddress() const;
2021-04-25 11:26:57 +02:00
unsigned short getModemModemPort() const;
std::string getModemLocalAddress() const;
2021-04-25 11:26:57 +02:00
unsigned short getModemLocalPort() const;
2016-01-14 19:45:04 +01:00
bool getModemRXInvert() const;
bool getModemTXInvert() const;
bool getModemPTTInvert() const;
unsigned int getModemTXDelay() const;
2016-03-17 19:12:14 +01:00
unsigned int getModemDMRDelay() const;
int getModemTXOffset() const;
int getModemRXOffset() const;
int getModemRXDCOffset() const;
int getModemTXDCOffset() const;
float getModemRFLevel() const;
float getModemRXLevel() const;
float getModemCWIdTXLevel() const;
float getModemDStarTXLevel() const;
float getModemDMRTXLevel() const;
float getModemYSFTXLevel() const;
float getModemP25TXLevel() const;
2018-01-11 20:35:33 +01:00
float getModemNXDNTXLevel() const;
2020-12-15 17:21:07 +01:00
float getModemM17TXLevel() const;
2018-06-07 19:46:03 +02:00
float getModemPOCSAGTXLevel() const;
float getModemFMTXLevel() const;
2020-12-15 17:21:07 +01:00
float getModemAX25TXLevel() const;
std::string getModemRSSIMappingFile() const;
bool getModemUseCOSAsLockout() const;
bool getModemTrace() const;
2016-01-14 19:45:04 +01:00
bool getModemDebug() const;
// The Transparent Data section
bool getTransparentEnabled() const;
std::string getTransparentRemoteAddress() const;
unsigned short getTransparentRemotePort() const;
unsigned short getTransparentLocalPort() const;
unsigned int getTransparentSendFrameType() const;
2022-07-29 18:49:08 +02:00
// The DMR section
2016-01-14 19:45:04 +01:00
bool getDMREnabled() const;
DMR_BEACONS getDMRBeacons() const;
2018-01-16 19:35:29 +01:00
unsigned int getDMRBeaconInterval() const;
unsigned int getDMRBeaconDuration() const;
2016-01-14 19:45:04 +01:00
unsigned int getDMRId() const;
unsigned int getDMRColorCode() const;
bool getDMREmbeddedLCOnly() const;
bool getDMRDumpTAData() const;
bool getDMRSelfOnly() const;
2016-04-04 20:03:38 +02:00
std::vector<unsigned int> getDMRPrefixes() const;
std::vector<unsigned int> getDMRBlackList() const;
std::vector<unsigned int> getDMRWhiteList() const;
2017-01-05 20:15:10 +01:00
std::vector<unsigned int> getDMRSlot1TGWhiteList() const;
std::vector<unsigned int> getDMRSlot2TGWhiteList() const;
unsigned int getDMRCallHang() const;
unsigned int getDMRTXHang() const;
unsigned int getDMRModeHang() const;
2019-11-17 03:57:58 +01:00
DMR_OVCM_TYPES getDMROVCM() const;
2016-01-14 19:45:04 +01:00
2022-07-29 18:49:08 +02:00
// The DMR Network section
2016-01-14 19:45:04 +01:00
bool getDMRNetworkEnabled() const;
std::string getDMRNetworkType() const;
std::string getDMRNetworkRemoteAddress() const;
unsigned short getDMRNetworkRemotePort() const;
std::string getDMRNetworkLocalAddress() const;
unsigned short getDMRNetworkLocalPort() const;
2016-01-14 19:45:04 +01:00
std::string getDMRNetworkPassword() const;
std::string getDMRNetworkOptions() const;
2016-01-14 19:45:04 +01:00
bool getDMRNetworkDebug() const;
2016-09-06 20:42:15 +02:00
unsigned int getDMRNetworkJitter() const;
bool getDMRNetworkSlot1() const;
bool getDMRNetworkSlot2() const;
unsigned int getDMRNetworkModeHang() const;
2016-01-14 19:45:04 +01:00
2022-07-29 18:49:08 +02:00
// The TFTSERIAL section
2016-01-14 19:45:04 +01:00
std::string getTFTSerialPort() const;
unsigned int getTFTSerialBrightness() const;
2016-01-14 19:45:04 +01:00
// The HD44780 section
unsigned int getHD44780Rows() const;
unsigned int getHD44780Columns() const;
std::vector<unsigned int> getHD44780Pins() const;
2016-07-03 12:05:52 +02:00
unsigned int getHD44780i2cAddress() const;
2016-05-03 18:59:21 +02:00
bool getHD44780PWM() const;
2016-05-01 17:59:43 +02:00
unsigned int getHD44780PWMPin() const;
unsigned int getHD44780PWMBright() const;
unsigned int getHD44780PWMDim() const;
bool getHD44780DisplayClock() const;
bool getHD44780UTC() const;
2016-05-01 17:59:43 +02:00
// The Nextion section
std::string getNextionPort() const;
unsigned int getNextionBrightness() const;
bool getNextionDisplayClock() const;
bool getNextionUTC() const;
unsigned int getNextionIdleBrightness() const;
unsigned int getNextionScreenLayout() const;
bool getNextionTempInFahrenheit() const;
2016-05-07 01:03:39 +02:00
// The OLED section
unsigned char getOLEDType() const;
unsigned char getOLEDBrightness() const;
2016-11-03 22:43:29 +01:00
bool getOLEDInvert() const;
bool getOLEDScroll() const;
2018-10-30 15:30:41 +01:00
bool getOLEDRotate() const;
2019-09-27 22:48:57 +02:00
bool getOLEDLogoScreensaver() const;
2016-05-07 01:03:39 +02:00
2016-10-28 14:22:20 +02:00
// The LCDproc section
std::string getLCDprocAddress() const;
unsigned short getLCDprocPort() const;
unsigned short getLCDprocLocalPort() const;
2016-10-28 14:22:20 +02:00
bool getLCDprocDisplayClock() const;
bool getLCDprocUTC() const;
bool getLCDprocDimOnIdle() const;
2016-10-28 14:22:20 +02:00
// The Lock File section
bool getLockFileEnabled() const;
std::string getLockFileName() const;
2019-01-07 12:03:37 +01:00
// The Remote Control section
bool getRemoteControlEnabled() const;
std::string getRemoteControlAddress() const;
unsigned short getRemoteControlPort() const;
2019-01-07 12:03:37 +01:00
2016-01-14 19:45:04 +01:00
private:
std::string m_file;
std::string m_callsign;
unsigned int m_id;
2016-01-14 19:45:04 +01:00
unsigned int m_timeout;
bool m_duplex;
std::string m_display;
bool m_daemon;
2016-01-14 19:45:04 +01:00
unsigned int m_rxFrequency;
unsigned int m_txFrequency;
unsigned int m_power;
2020-12-09 10:41:11 +01:00
float m_latitude;
float m_longitude;
int m_height;
std::string m_location;
std::string m_description;
std::string m_url;
2016-01-14 19:45:04 +01:00
2016-03-07 19:42:05 +01:00
unsigned int m_logDisplayLevel;
unsigned int m_logFileLevel;
std::string m_logFilePath;
std::string m_logFileRoot;
bool m_logFileRotate;
2016-01-14 19:45:04 +01:00
2016-05-09 22:55:44 +02:00
bool m_cwIdEnabled;
unsigned int m_cwIdTime;
std::string m_cwIdCallsign;
2016-05-09 22:55:44 +02:00
std::string m_dmrIdLookupFile;
unsigned int m_dmrIdLookupTime;
2018-01-17 22:21:25 +01:00
std::string m_nxdnIdLookupFile;
unsigned int m_nxdnIdLookupTime;
std::string m_modemProtocol;
std::string m_modemUARTPort;
unsigned int m_modemUARTSpeed;
std::string m_modemI2CPort;
unsigned int m_modemI2CAddress;
std::string m_modemModemAddress;
2021-04-25 11:26:57 +02:00
unsigned short m_modemModemPort;
std::string m_modemLocalAddress;
2021-04-25 11:26:57 +02:00
unsigned short m_modemLocalPort;
2016-01-14 19:45:04 +01:00
bool m_modemRXInvert;
bool m_modemTXInvert;
bool m_modemPTTInvert;
unsigned int m_modemTXDelay;
2016-03-17 19:12:14 +01:00
unsigned int m_modemDMRDelay;
int m_modemTXOffset;
int m_modemRXOffset;
int m_modemRXDCOffset;
int m_modemTXDCOffset;
float m_modemRFLevel;
float m_modemRXLevel;
float m_modemCWIdTXLevel;
float m_modemDMRTXLevel;
std::string m_modemRSSIMappingFile;
bool m_modemUseCOSAsLockout;
bool m_modemTrace;
2016-01-14 19:45:04 +01:00
bool m_modemDebug;
bool m_transparentEnabled;
std::string m_transparentRemoteAddress;
unsigned short m_transparentRemotePort;
unsigned short m_transparentLocalPort;
unsigned int m_transparentSendFrameType;
2016-01-14 19:45:04 +01:00
bool m_dmrEnabled;
2019-11-05 12:50:59 +01:00
DMR_BEACONS m_dmrBeacons;
2018-01-16 19:35:29 +01:00
unsigned int m_dmrBeaconInterval;
unsigned int m_dmrBeaconDuration;
2016-01-14 19:45:04 +01:00
unsigned int m_dmrId;
unsigned int m_dmrColorCode;
bool m_dmrSelfOnly;
bool m_dmrEmbeddedLCOnly;
bool m_dmrDumpTAData;
2016-04-04 20:03:38 +02:00
std::vector<unsigned int> m_dmrPrefixes;
std::vector<unsigned int> m_dmrBlackList;
std::vector<unsigned int> m_dmrWhiteList;
2017-01-05 20:15:10 +01:00
std::vector<unsigned int> m_dmrSlot1TGWhiteList;
std::vector<unsigned int> m_dmrSlot2TGWhiteList;
unsigned int m_dmrCallHang;
unsigned int m_dmrTXHang;
unsigned int m_dmrModeHang;
2019-11-17 03:57:58 +01:00
DMR_OVCM_TYPES m_dmrOVCM;
2016-01-14 19:45:04 +01:00
bool m_dmrNetworkEnabled;
std::string m_dmrNetworkType;
std::string m_dmrNetworkRemoteAddress;
unsigned short m_dmrNetworkRemotePort;
std::string m_dmrNetworkLocalAddress;
unsigned short m_dmrNetworkLocalPort;
2016-01-14 19:45:04 +01:00
std::string m_dmrNetworkPassword;
std::string m_dmrNetworkOptions;
2016-01-14 19:45:04 +01:00
bool m_dmrNetworkDebug;
2016-09-06 20:42:15 +02:00
unsigned int m_dmrNetworkJitter;
bool m_dmrNetworkSlot1;
bool m_dmrNetworkSlot2;
unsigned int m_dmrNetworkModeHang;
2016-01-14 19:45:04 +01:00
2022-07-29 18:49:08 +02:00
std::string m_tftSerialPort;
unsigned int m_tftSerialBrightness;
unsigned int m_hd44780Rows;
unsigned int m_hd44780Columns;
std::vector<unsigned int> m_hd44780Pins;
2016-07-03 12:05:52 +02:00
unsigned int m_hd44780i2cAddress;
2016-05-03 18:59:21 +02:00
bool m_hd44780PWM;
2016-05-01 17:59:43 +02:00
unsigned int m_hd44780PWMPin;
unsigned int m_hd44780PWMBright;
unsigned int m_hd44780PWMDim;
bool m_hd44780DisplayClock;
bool m_hd44780UTC;
2016-05-01 17:59:43 +02:00
std::string m_nextionPort;
unsigned int m_nextionBrightness;
bool m_nextionDisplayClock;
bool m_nextionUTC;
unsigned int m_nextionIdleBrightness;
unsigned int m_nextionScreenLayout;
bool m_nextionTempInFahrenheit;
2016-05-07 01:03:39 +02:00
unsigned char m_oledType;
unsigned char m_oledBrightness;
2016-11-03 22:43:29 +01:00
bool m_oledInvert;
bool m_oledScroll;
2018-10-30 15:30:41 +01:00
bool m_oledRotate;
2019-09-27 22:48:57 +02:00
bool m_oledLogoScreensaver;
2016-10-28 14:22:20 +02:00
std::string m_lcdprocAddress;
unsigned short m_lcdprocPort;
unsigned short m_lcdprocLocalPort;
2016-10-28 14:22:20 +02:00
bool m_lcdprocDisplayClock;
bool m_lcdprocUTC;
bool m_lcdprocDimOnIdle;
bool m_lockFileEnabled;
std::string m_lockFileName;
2018-11-06 13:14:57 +01:00
2019-01-07 12:03:37 +01:00
bool m_remoteControlEnabled;
std::string m_remoteControlAddress;
unsigned short m_remoteControlPort;
2016-01-14 19:45:04 +01:00
};
#endif