2017-04-20 21:51:30 +02:00
|
|
|
/*
|
2025-03-15 18:03:06 +01:00
|
|
|
* Copyright (C) 2015-2020,2025 by Jonathan Naylor G4KLX
|
2017-04-20 21:51:30 +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.
|
|
|
|
|
*/
|
|
|
|
|
|
|
|
|
|
#include "Conf.h"
|
|
|
|
|
#include "Log.h"
|
|
|
|
|
|
|
|
|
|
#include <cstdio>
|
|
|
|
|
#include <cstdlib>
|
|
|
|
|
#include <cstring>
|
|
|
|
|
#include <cctype>
|
2025-06-01 16:43:06 +02:00
|
|
|
#include <cassert>
|
2017-04-20 21:51:30 +02:00
|
|
|
|
|
|
|
|
const int BUFFER_SIZE = 500;
|
|
|
|
|
|
2025-03-15 18:03:06 +01:00
|
|
|
enum class SECTION {
|
|
|
|
|
NONE,
|
|
|
|
|
GENERAL,
|
|
|
|
|
LOG,
|
|
|
|
|
VOICE,
|
|
|
|
|
INFO,
|
2025-06-01 16:43:06 +02:00
|
|
|
DMR_NETWORK_N,
|
2025-03-15 18:03:06 +01:00
|
|
|
XLX_NETWORK,
|
|
|
|
|
GPSD,
|
|
|
|
|
APRS,
|
|
|
|
|
DYNAMIC_TG_CONTROL,
|
|
|
|
|
REMOTE_CONTROL
|
2017-04-20 21:51:30 +02:00
|
|
|
};
|
|
|
|
|
|
|
|
|
|
CConf::CConf(const std::string& file) :
|
|
|
|
|
m_file(file),
|
|
|
|
|
m_daemon(false),
|
2017-04-23 21:17:25 +02:00
|
|
|
m_rptAddress("127.0.0.1"),
|
|
|
|
|
m_rptPort(62032U),
|
|
|
|
|
m_localAddress("127.0.0.1"),
|
|
|
|
|
m_localPort(62031U),
|
2017-09-22 22:03:44 +02:00
|
|
|
m_rfTimeout(10U),
|
|
|
|
|
m_netTimeout(10U),
|
2017-06-04 16:17:43 +02:00
|
|
|
m_ruleTrace(false),
|
2017-04-23 21:17:25 +02:00
|
|
|
m_debug(false),
|
2017-05-06 18:17:34 +02:00
|
|
|
m_voiceEnabled(true),
|
|
|
|
|
m_voiceLanguage("en_GB"),
|
|
|
|
|
m_voiceDirectory(),
|
2017-04-20 21:51:30 +02:00
|
|
|
m_logDisplayLevel(0U),
|
|
|
|
|
m_logFileLevel(0U),
|
|
|
|
|
m_logFilePath(),
|
|
|
|
|
m_logFileRoot(),
|
2020-10-31 23:45:54 +01:00
|
|
|
m_logFileRotate(true),
|
2017-10-08 15:13:52 +02:00
|
|
|
m_infoLatitude(0.0F),
|
|
|
|
|
m_infoLongitude(0.0F),
|
|
|
|
|
m_infoHeight(0),
|
2020-08-27 11:37:26 +02:00
|
|
|
m_infoLocation(),
|
2017-10-08 15:13:52 +02:00
|
|
|
m_infoDescription(),
|
|
|
|
|
m_infoURL(),
|
2025-06-01 16:43:06 +02:00
|
|
|
m_dmrNetworks(),
|
2017-08-20 22:48:49 +02:00
|
|
|
m_xlxNetworkEnabled(false),
|
|
|
|
|
m_xlxNetworkId(0U),
|
|
|
|
|
m_xlxNetworkFile(),
|
2017-09-26 14:08:35 +02:00
|
|
|
m_xlxNetworkReloadTime(0U),
|
2017-09-26 15:58:22 +02:00
|
|
|
m_xlxNetworkPort(62030U),
|
|
|
|
|
m_xlxNetworkPassword("passw0rd"),
|
2017-08-20 22:48:49 +02:00
|
|
|
m_xlxNetworkLocal(0U),
|
|
|
|
|
m_xlxNetworkSlot(1U),
|
|
|
|
|
m_xlxNetworkTG(8U),
|
|
|
|
|
m_xlxNetworkBase(84000U),
|
2022-02-17 10:36:23 +01:00
|
|
|
m_xlxNetworkStartup("4000"),
|
2017-08-20 22:48:49 +02:00
|
|
|
m_xlxNetworkRelink(0U),
|
2018-10-21 11:18:55 +02:00
|
|
|
m_xlxNetworkDebug(false),
|
2018-10-21 16:26:54 +02:00
|
|
|
m_xlxNetworkUserControl(true),
|
2020-04-13 15:15:21 +02:00
|
|
|
m_xlxNetworkModule(),
|
2020-08-26 15:20:04 +02:00
|
|
|
m_gpsdEnabled(false),
|
|
|
|
|
m_gpsdAddress(),
|
2020-08-28 16:15:25 +02:00
|
|
|
m_gpsdPort(),
|
|
|
|
|
m_aprsEnabled(false),
|
|
|
|
|
m_aprsAddress(),
|
|
|
|
|
m_aprsPort(0U),
|
|
|
|
|
m_aprsSuffix(),
|
|
|
|
|
m_aprsDescription(),
|
2023-02-13 02:27:45 +01:00
|
|
|
m_aprsSymbol(),
|
2020-08-28 16:15:25 +02:00
|
|
|
m_dynamicTGControlEnabled(false),
|
2021-03-20 13:03:19 +01:00
|
|
|
m_dynamicTGControlPort(3769U),
|
|
|
|
|
m_remoteControlEnabled(false),
|
|
|
|
|
m_remoteControlAddress("127.0.0.1"),
|
|
|
|
|
m_remoteControlPort(0U)
|
2017-04-20 21:51:30 +02:00
|
|
|
{
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
CConf::~CConf()
|
|
|
|
|
{
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
bool CConf::read()
|
|
|
|
|
{
|
2025-06-01 16:04:44 +02:00
|
|
|
FILE* fp = ::fopen(m_file.c_str(), "rt");
|
|
|
|
|
if (fp == nullptr) {
|
|
|
|
|
::fprintf(stderr, "Couldn't open the .ini file - %s\n", m_file.c_str());
|
|
|
|
|
return false;
|
2017-05-01 15:46:43 +02:00
|
|
|
}
|
2017-04-20 21:51:30 +02:00
|
|
|
|
2025-06-01 16:04:44 +02:00
|
|
|
SECTION section = SECTION::NONE;
|
2025-06-01 16:43:06 +02:00
|
|
|
CDMRNetConfStruct *lastDmrNet = nullptr;
|
2025-06-01 16:04:44 +02:00
|
|
|
|
|
|
|
|
char buffer[BUFFER_SIZE];
|
|
|
|
|
while (::fgets(buffer, BUFFER_SIZE, fp) != nullptr) {
|
|
|
|
|
if (buffer[0U] == '#')
|
|
|
|
|
continue;
|
|
|
|
|
|
|
|
|
|
if (buffer[0U] == '[') {
|
2025-06-01 16:43:06 +02:00
|
|
|
if (::strncmp(buffer, "[General]", 9U) == 0) {
|
2025-06-01 16:04:44 +02:00
|
|
|
section = SECTION::GENERAL;
|
2025-06-01 16:43:06 +02:00
|
|
|
} else if (::strncmp(buffer, "[Log]", 5U) == 0) {
|
2025-06-01 16:04:44 +02:00
|
|
|
section = SECTION::LOG;
|
2025-06-01 16:43:06 +02:00
|
|
|
} else if (::strncmp(buffer, "[Voice]", 7U) == 0) {
|
2025-06-01 16:04:44 +02:00
|
|
|
section = SECTION::VOICE;
|
2025-06-01 16:43:06 +02:00
|
|
|
} else if (::strncmp(buffer, "[Info]", 6U) == 0) {
|
2025-06-01 16:04:44 +02:00
|
|
|
section = SECTION::INFO;
|
2025-06-01 16:43:06 +02:00
|
|
|
} else if (::strncmp(buffer, "[XLX Network]", 13U) == 0) {
|
2025-06-01 16:04:44 +02:00
|
|
|
section = SECTION::XLX_NETWORK;
|
2025-06-01 16:43:06 +02:00
|
|
|
} else if (::strncmp(buffer, "[DMR Network", 12U) == 0) {
|
|
|
|
|
section = SECTION::DMR_NETWORK_N;
|
|
|
|
|
lastDmrNet = addDMRNetwork();
|
|
|
|
|
} else if (::strncmp(buffer, "[GPSD]", 6U) == 0) {
|
2025-06-01 16:04:44 +02:00
|
|
|
section = SECTION::GPSD;
|
2025-06-01 16:43:06 +02:00
|
|
|
} else if (::strncmp(buffer, "[APRS]", 6U) == 0) {
|
2025-06-01 16:04:44 +02:00
|
|
|
section = SECTION::APRS;
|
2025-06-01 16:43:06 +02:00
|
|
|
} else if (::strncmp(buffer, "[Dynamic TG Control]", 20U) == 0) {
|
2025-06-01 16:04:44 +02:00
|
|
|
section = SECTION::DYNAMIC_TG_CONTROL;
|
2025-06-01 16:43:06 +02:00
|
|
|
} else if (::strncmp(buffer, "[Remote Control]", 16U) == 0) {
|
2025-06-01 16:04:44 +02:00
|
|
|
section = SECTION::REMOTE_CONTROL;
|
2025-06-01 16:43:06 +02:00
|
|
|
} else {
|
2025-06-01 16:04:44 +02:00
|
|
|
section = SECTION::NONE;
|
2025-06-01 16:43:06 +02:00
|
|
|
}
|
2025-06-01 16:04:44 +02:00
|
|
|
|
|
|
|
|
continue;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
char* key = ::strtok(buffer, " \t=\r\n");
|
|
|
|
|
if (key == nullptr)
|
|
|
|
|
continue;
|
|
|
|
|
|
|
|
|
|
char* value = ::strtok(nullptr, "\r\n");
|
|
|
|
|
if (value == nullptr)
|
|
|
|
|
continue;
|
|
|
|
|
|
|
|
|
|
// Remove quotes from the value
|
|
|
|
|
size_t len = ::strlen(value);
|
|
|
|
|
if (len > 1U && *value == '"' && value[len - 1U] == '"') {
|
|
|
|
|
value[len - 1U] = '\0';
|
|
|
|
|
value++;
|
|
|
|
|
} else {
|
|
|
|
|
char *p;
|
|
|
|
|
|
|
|
|
|
// if value is not quoted, remove after # (to make comment)
|
|
|
|
|
if ((p = strchr(value, '#')) != nullptr)
|
|
|
|
|
*p = '\0';
|
|
|
|
|
|
|
|
|
|
// remove trailing tab/space
|
|
|
|
|
for (p = value + strlen(value) - 1U; p >= value && (*p == '\t' || *p == ' '); p--)
|
|
|
|
|
*p = '\0';
|
|
|
|
|
}
|
2018-02-07 22:36:44 +01:00
|
|
|
|
2025-06-01 16:04:44 +02:00
|
|
|
if (section == SECTION::GENERAL) {
|
2017-04-20 21:51:30 +02:00
|
|
|
if (::strcmp(key, "Daemon") == 0)
|
|
|
|
|
m_daemon = ::atoi(value) == 1;
|
|
|
|
|
else if (::strcmp(key, "Timeout") == 0)
|
2017-09-22 22:03:44 +02:00
|
|
|
m_rfTimeout = m_netTimeout = (unsigned int)::atoi(value);
|
|
|
|
|
else if (::strcmp(key, "RFTimeout") == 0)
|
|
|
|
|
m_rfTimeout = (unsigned int)::atoi(value);
|
|
|
|
|
else if (::strcmp(key, "NetTimeout") == 0)
|
|
|
|
|
m_netTimeout = (unsigned int)::atoi(value);
|
2017-04-23 21:17:25 +02:00
|
|
|
else if (::strcmp(key, "RptAddress") == 0)
|
|
|
|
|
m_rptAddress = value;
|
|
|
|
|
else if (::strcmp(key, "RptPort") == 0)
|
2021-04-25 07:44:55 +02:00
|
|
|
m_rptPort = (unsigned short)::atoi(value);
|
2017-04-23 21:17:25 +02:00
|
|
|
else if (::strcmp(key, "LocalAddress") == 0)
|
|
|
|
|
m_localAddress = value;
|
|
|
|
|
else if (::strcmp(key, "LocalPort") == 0)
|
2021-04-25 07:44:55 +02:00
|
|
|
m_localPort = (unsigned short)::atoi(value);
|
2017-06-04 16:17:43 +02:00
|
|
|
else if (::strcmp(key, "RuleTrace") == 0)
|
|
|
|
|
m_ruleTrace = ::atoi(value) == 1;
|
2017-04-23 21:17:25 +02:00
|
|
|
else if (::strcmp(key, "Debug") == 0)
|
|
|
|
|
m_debug = ::atoi(value) == 1;
|
2025-03-15 18:03:06 +01:00
|
|
|
} else if (section == SECTION::LOG) {
|
2017-04-28 17:45:05 +02:00
|
|
|
if (::strcmp(key, "FilePath") == 0)
|
|
|
|
|
m_logFilePath = value;
|
|
|
|
|
else if (::strcmp(key, "FileRoot") == 0)
|
|
|
|
|
m_logFileRoot = value;
|
|
|
|
|
else if (::strcmp(key, "FileLevel") == 0)
|
|
|
|
|
m_logFileLevel = (unsigned int)::atoi(value);
|
|
|
|
|
else if (::strcmp(key, "DisplayLevel") == 0)
|
|
|
|
|
m_logDisplayLevel = (unsigned int)::atoi(value);
|
2020-10-31 23:45:54 +01:00
|
|
|
else if (::strcmp(key, "FileRotate") == 0)
|
|
|
|
|
m_logFileRotate = ::atoi(value) == 1;
|
2025-03-15 18:03:06 +01:00
|
|
|
} else if (section == SECTION::VOICE) {
|
2017-05-01 15:46:43 +02:00
|
|
|
if (::strcmp(key, "Enabled") == 0)
|
|
|
|
|
m_voiceEnabled = ::atoi(value) == 1;
|
|
|
|
|
else if (::strcmp(key, "Language") == 0)
|
|
|
|
|
m_voiceLanguage = value;
|
2017-05-01 21:05:41 +02:00
|
|
|
else if (::strcmp(key, "Directory") == 0)
|
|
|
|
|
m_voiceDirectory = value;
|
2025-03-15 18:03:06 +01:00
|
|
|
} else if (section == SECTION::INFO) {
|
2020-08-26 15:20:04 +02:00
|
|
|
if (::strcmp(key, "Latitude") == 0)
|
2017-10-08 15:13:52 +02:00
|
|
|
m_infoLatitude = float(::atof(value));
|
|
|
|
|
else if (::strcmp(key, "Longitude") == 0)
|
|
|
|
|
m_infoLongitude = float(::atof(value));
|
|
|
|
|
else if (::strcmp(key, "Height") == 0)
|
|
|
|
|
m_infoHeight = ::atoi(value);
|
2020-08-27 11:37:26 +02:00
|
|
|
else if (::strcmp(key, "Location") == 0)
|
2025-06-01 16:43:06 +02:00
|
|
|
m_infoLocation = value;
|
|
|
|
|
else if (::strcmp(key, "Description") == 0)
|
|
|
|
|
m_infoDescription = value;
|
|
|
|
|
else if (::strcmp(key, "URL") == 0)
|
|
|
|
|
m_infoURL = value;
|
|
|
|
|
} else if (section == SECTION::XLX_NETWORK) {
|
|
|
|
|
if (::strcmp(key, "Enabled") == 0)
|
|
|
|
|
m_xlxNetworkEnabled = ::atoi(value) == 1;
|
|
|
|
|
else if (::strcmp(key, "Id") == 0)
|
|
|
|
|
m_xlxNetworkId = (unsigned int)::atoi(value);
|
|
|
|
|
else if (::strcmp(key, "File") == 0)
|
|
|
|
|
m_xlxNetworkFile = value;
|
|
|
|
|
else if (::strcmp(key, "ReloadTime") == 0)
|
|
|
|
|
m_xlxNetworkReloadTime = (unsigned int)::atoi(value);
|
|
|
|
|
else if (::strcmp(key, "Port") == 0)
|
|
|
|
|
m_xlxNetworkPort = (unsigned short)::atoi(value);
|
|
|
|
|
else if (::strcmp(key, "Password") == 0)
|
|
|
|
|
m_xlxNetworkPassword = value;
|
|
|
|
|
else if (::strcmp(key, "Local") == 0)
|
|
|
|
|
m_xlxNetworkLocal = (unsigned short)::atoi(value);
|
|
|
|
|
else if (::strcmp(key, "Slot") == 0)
|
|
|
|
|
m_xlxNetworkSlot = (unsigned int)::atoi(value);
|
|
|
|
|
else if (::strcmp(key, "TG") == 0)
|
|
|
|
|
m_xlxNetworkTG = (unsigned int)::atoi(value);
|
|
|
|
|
else if (::strcmp(key, "Base") == 0)
|
|
|
|
|
m_xlxNetworkBase = (unsigned int)::atoi(value);
|
|
|
|
|
else if (::strcmp(key, "Startup") == 0) {
|
|
|
|
|
char buffer[16];
|
|
|
|
|
char *p = buffer;
|
|
|
|
|
|
|
|
|
|
// Right align, then pads with zeros, as XLX IDs are 3 characters length
|
|
|
|
|
snprintf(buffer, sizeof(buffer), "%3s", value);
|
|
|
|
|
while ((*p != '\0') && (*p == ' '))
|
|
|
|
|
*p++ = '0';
|
|
|
|
|
|
|
|
|
|
m_xlxNetworkStartup = std::string(buffer);
|
2019-03-16 11:08:32 +01:00
|
|
|
}
|
2025-06-01 16:43:06 +02:00
|
|
|
else if (::strcmp(key, "Relink") == 0)
|
|
|
|
|
m_xlxNetworkRelink = (unsigned int)::atoi(value);
|
|
|
|
|
else if (::strcmp(key, "Debug") == 0)
|
|
|
|
|
m_xlxNetworkDebug = ::atoi(value) == 1;
|
|
|
|
|
else if (::strcmp(key, "UserControl") == 0)
|
|
|
|
|
m_xlxNetworkUserControl = ::atoi(value) ==1;
|
|
|
|
|
else if (::strcmp(key, "Module") == 0)
|
|
|
|
|
m_xlxNetworkModule = ::toupper(value[0]);
|
|
|
|
|
} else if (section == SECTION::DMR_NETWORK_N) {
|
|
|
|
|
assert(lastDmrNet != nullptr);
|
2019-07-17 09:21:52 +02:00
|
|
|
if (::strcmp(key, "Enabled") == 0)
|
2025-06-01 16:43:06 +02:00
|
|
|
lastDmrNet->m_Enabled = ::atoi(value) == 1;
|
2019-07-17 09:21:52 +02:00
|
|
|
else if (::strcmp(key, "Name") == 0)
|
2025-06-01 16:43:06 +02:00
|
|
|
lastDmrNet->m_Name = value;
|
2019-07-17 09:21:52 +02:00
|
|
|
else if (::strcmp(key, "Id") == 0)
|
2025-06-01 16:43:06 +02:00
|
|
|
lastDmrNet->m_Id = (unsigned int)::atoi(value);
|
2019-07-17 09:21:52 +02:00
|
|
|
else if (::strcmp(key, "Address") == 0)
|
2025-06-01 16:43:06 +02:00
|
|
|
lastDmrNet->m_Address = value;
|
2019-07-17 09:21:52 +02:00
|
|
|
else if (::strcmp(key, "Port") == 0)
|
2025-06-01 16:43:06 +02:00
|
|
|
lastDmrNet->m_Port = (unsigned short)::atoi(value);
|
2019-07-17 09:21:52 +02:00
|
|
|
else if (::strcmp(key, "Local") == 0)
|
2025-06-01 16:43:06 +02:00
|
|
|
lastDmrNet->m_Local = (unsigned short)::atoi(value);
|
2019-07-17 09:21:52 +02:00
|
|
|
else if (::strcmp(key, "Password") == 0)
|
2025-06-01 16:43:06 +02:00
|
|
|
lastDmrNet->m_Password = value;
|
2019-07-17 09:21:52 +02:00
|
|
|
else if (::strcmp(key, "Options") == 0)
|
2025-06-01 16:43:06 +02:00
|
|
|
lastDmrNet->m_Options = value;
|
2019-07-17 09:21:52 +02:00
|
|
|
else if (::strcmp(key, "Location") == 0)
|
2025-06-01 16:43:06 +02:00
|
|
|
lastDmrNet->m_Location = ::atoi(value) == 1;
|
2019-07-17 09:21:52 +02:00
|
|
|
else if (::strcmp(key, "Debug") == 0)
|
2025-06-01 16:43:06 +02:00
|
|
|
lastDmrNet->m_Debug = ::atoi(value) == 1;
|
2019-07-17 09:21:52 +02:00
|
|
|
else if (::strncmp(key, "TGRewrite", 9U) == 0) {
|
|
|
|
|
char* p1 = ::strtok(value, ", ");
|
2025-03-15 18:03:06 +01:00
|
|
|
char* p2 = ::strtok(nullptr, ", ");
|
|
|
|
|
char* p3 = ::strtok(nullptr, ", ");
|
|
|
|
|
char* p4 = ::strtok(nullptr, ", ");
|
|
|
|
|
char* p5 = ::strtok(nullptr, " \r\n");
|
|
|
|
|
if (p1 != nullptr && p2 != nullptr && p3 != nullptr && p4 != nullptr && p5 != nullptr) {
|
2019-07-17 09:21:52 +02:00
|
|
|
CTGRewriteStruct rewrite;
|
|
|
|
|
rewrite.m_fromSlot = ::atoi(p1);
|
|
|
|
|
rewrite.m_fromTG = ::atoi(p2);
|
|
|
|
|
rewrite.m_toSlot = ::atoi(p3);
|
|
|
|
|
rewrite.m_toTG = ::atoi(p4);
|
|
|
|
|
rewrite.m_range = ::atoi(p5);
|
2025-06-01 16:43:06 +02:00
|
|
|
lastDmrNet->m_TGRewrites.push_back(rewrite);
|
2019-07-17 09:21:52 +02:00
|
|
|
}
|
|
|
|
|
} else if (::strncmp(key, "PCRewrite", 9U) == 0) {
|
|
|
|
|
char* p1 = ::strtok(value, ", ");
|
2025-03-15 18:03:06 +01:00
|
|
|
char* p2 = ::strtok(nullptr, ", ");
|
|
|
|
|
char* p3 = ::strtok(nullptr, ", ");
|
|
|
|
|
char* p4 = ::strtok(nullptr, ", ");
|
|
|
|
|
char* p5 = ::strtok(nullptr, " \r\n");
|
|
|
|
|
if (p1 != nullptr && p2 != nullptr && p3 != nullptr && p4 != nullptr && p5 != nullptr) {
|
2019-07-17 09:21:52 +02:00
|
|
|
CPCRewriteStruct rewrite;
|
|
|
|
|
rewrite.m_fromSlot = ::atoi(p1);
|
|
|
|
|
rewrite.m_fromId = ::atoi(p2);
|
|
|
|
|
rewrite.m_toSlot = ::atoi(p3);
|
|
|
|
|
rewrite.m_toId = ::atoi(p4);
|
|
|
|
|
rewrite.m_range = ::atoi(p5);
|
2025-06-01 16:43:06 +02:00
|
|
|
lastDmrNet->m_PCRewrites.push_back(rewrite);
|
2019-07-17 09:21:52 +02:00
|
|
|
}
|
|
|
|
|
} else if (::strncmp(key, "TypeRewrite", 11U) == 0) {
|
|
|
|
|
char* p1 = ::strtok(value, ", ");
|
2025-03-15 18:03:06 +01:00
|
|
|
char* p2 = ::strtok(nullptr, ", ");
|
|
|
|
|
char* p3 = ::strtok(nullptr, ", ");
|
|
|
|
|
char* p4 = ::strtok(nullptr, ", \r\n");
|
|
|
|
|
if (p1 != nullptr && p2 != nullptr && p3 != nullptr && p4 != nullptr) {
|
2019-07-17 09:21:52 +02:00
|
|
|
CTypeRewriteStruct rewrite;
|
|
|
|
|
rewrite.m_fromSlot = ::atoi(p1);
|
|
|
|
|
rewrite.m_fromTG = ::atoi(p2);
|
|
|
|
|
rewrite.m_toSlot = ::atoi(p3);
|
|
|
|
|
rewrite.m_toId = ::atoi(p4);
|
2025-03-15 18:03:06 +01:00
|
|
|
char* p5 = ::strtok(nullptr, " \r\n");
|
|
|
|
|
rewrite.m_range = p5 != nullptr ? ::atoi(p5) : 1;
|
2025-06-01 16:43:06 +02:00
|
|
|
lastDmrNet->m_TypeRewrites.push_back(rewrite);
|
2019-07-17 09:21:52 +02:00
|
|
|
}
|
|
|
|
|
} else if (::strncmp(key, "SrcRewrite", 10U) == 0) {
|
|
|
|
|
char* p1 = ::strtok(value, ", ");
|
2025-03-15 18:03:06 +01:00
|
|
|
char* p2 = ::strtok(nullptr, ", ");
|
|
|
|
|
char* p3 = ::strtok(nullptr, ", ");
|
|
|
|
|
char* p4 = ::strtok(nullptr, ", ");
|
|
|
|
|
char* p5 = ::strtok(nullptr, " \r\n");
|
|
|
|
|
if (p1 != nullptr && p2 != nullptr && p3 != nullptr && p4 != nullptr && p5 != nullptr) {
|
2019-07-17 09:21:52 +02:00
|
|
|
CSrcRewriteStruct rewrite;
|
|
|
|
|
rewrite.m_fromSlot = ::atoi(p1);
|
|
|
|
|
rewrite.m_fromId = ::atoi(p2);
|
|
|
|
|
rewrite.m_toSlot = ::atoi(p3);
|
|
|
|
|
rewrite.m_toTG = ::atoi(p4);
|
|
|
|
|
rewrite.m_range = ::atoi(p5);
|
2025-06-01 16:43:06 +02:00
|
|
|
lastDmrNet->m_SrcRewrites.push_back(rewrite);
|
2019-07-17 09:21:52 +02:00
|
|
|
}
|
2020-04-01 23:22:12 +02:00
|
|
|
} else if (::strncmp(key, "TGDynRewrite", 12U) == 0) {
|
2020-04-08 00:03:27 +02:00
|
|
|
std::vector<char*> p7;
|
2020-04-01 23:22:12 +02:00
|
|
|
char* p1 = ::strtok(value, ", ");
|
2025-03-15 18:03:06 +01:00
|
|
|
char* p2 = ::strtok(nullptr, ", ");
|
|
|
|
|
char* p3 = ::strtok(nullptr, ", ");
|
|
|
|
|
char* p4 = ::strtok(nullptr, ", ");
|
|
|
|
|
char* p5 = ::strtok(nullptr, ", ");
|
|
|
|
|
char* p6 = ::strtok(nullptr, ", \r\n");
|
2020-04-08 00:03:27 +02:00
|
|
|
char* p;
|
2025-03-15 18:03:06 +01:00
|
|
|
while ((p = ::strtok(nullptr, ", \r\n")) != nullptr)
|
2020-04-08 00:03:27 +02:00
|
|
|
p7.push_back(p);
|
2025-03-15 18:03:06 +01:00
|
|
|
if (p1 != nullptr && p2 != nullptr && p3 != nullptr && p4 != nullptr && p5 != nullptr && p6 != nullptr) {
|
2020-04-01 23:22:12 +02:00
|
|
|
CTGDynRewriteStruct rewrite;
|
2020-04-03 17:54:35 +02:00
|
|
|
rewrite.m_slot = ::atoi(p1);
|
|
|
|
|
rewrite.m_fromTG = ::atoi(p2);
|
2020-04-05 14:43:57 +02:00
|
|
|
rewrite.m_discPC = ::atoi(p3);
|
|
|
|
|
rewrite.m_statusPC = ::atoi(p4);
|
2020-04-03 17:54:35 +02:00
|
|
|
rewrite.m_toTG = ::atoi(p5);
|
|
|
|
|
rewrite.m_range = ::atoi(p6);
|
2020-04-08 00:03:27 +02:00
|
|
|
for (std::vector<char*>::const_iterator it = p7.cbegin(); it != p7.cend(); ++it) {
|
|
|
|
|
unsigned int tg = ::atoi(*it);
|
|
|
|
|
rewrite.m_exclTGs.push_back(tg);
|
|
|
|
|
}
|
2025-06-01 16:43:06 +02:00
|
|
|
lastDmrNet->m_TGDynRewrites.push_back(rewrite);
|
2020-04-01 23:22:12 +02:00
|
|
|
}
|
2019-07-17 09:21:52 +02:00
|
|
|
} else if (::strncmp(key, "IdRewrite", 9U) == 0) {
|
|
|
|
|
char* rfId = ::strtok(value, ", ");
|
2025-03-15 18:03:06 +01:00
|
|
|
char* netId = ::strtok(nullptr, " \r\n");
|
|
|
|
|
if (rfId != nullptr && netId != nullptr) {
|
2019-07-17 09:21:52 +02:00
|
|
|
CIdRewriteStruct rewrite;
|
|
|
|
|
rewrite.m_rfId = ::atoi(rfId);
|
|
|
|
|
rewrite.m_netId = ::atoi(netId);
|
2025-06-01 16:43:06 +02:00
|
|
|
lastDmrNet->m_IdRewrites.push_back(rewrite);
|
2019-07-17 09:21:52 +02:00
|
|
|
}
|
|
|
|
|
} else if (::strncmp(key, "PassAllPC", 9U) == 0) {
|
|
|
|
|
unsigned int slotNo = (unsigned int)::atoi(value);
|
2025-06-01 16:43:06 +02:00
|
|
|
lastDmrNet->m_PassAllPC.push_back(slotNo);
|
2019-07-17 09:21:52 +02:00
|
|
|
} else if (::strncmp(key, "PassAllTG", 9U) == 0) {
|
|
|
|
|
unsigned int slotNo = (unsigned int)::atoi(value);
|
2025-06-01 16:43:06 +02:00
|
|
|
lastDmrNet->m_PassAllTG.push_back(slotNo);
|
2019-07-17 09:21:52 +02:00
|
|
|
}
|
2025-03-15 18:03:06 +01:00
|
|
|
} else if (section == SECTION::GPSD) {
|
2020-08-26 15:20:04 +02:00
|
|
|
if (::strcmp(key, "Enable") == 0)
|
|
|
|
|
m_gpsdEnabled = ::atoi(value) == 1;
|
|
|
|
|
else if (::strcmp(key, "Address") == 0)
|
|
|
|
|
m_gpsdAddress = value;
|
|
|
|
|
else if (::strcmp(key, "Port") == 0)
|
|
|
|
|
m_gpsdPort = value;
|
2025-03-15 18:03:06 +01:00
|
|
|
} else if (section == SECTION::APRS) {
|
2020-08-28 16:15:25 +02:00
|
|
|
if (::strcmp(key, "Enable") == 0)
|
|
|
|
|
m_aprsEnabled = ::atoi(value) == 1;
|
|
|
|
|
else if (::strcmp(key, "Address") == 0)
|
|
|
|
|
m_aprsAddress = value;
|
|
|
|
|
else if (::strcmp(key, "Port") == 0)
|
2021-04-25 07:44:55 +02:00
|
|
|
m_aprsPort = (unsigned short)::atoi(value);
|
2020-08-28 16:15:25 +02:00
|
|
|
else if (::strcmp(key, "Suffix") == 0)
|
|
|
|
|
m_aprsSuffix = value;
|
2021-07-14 14:07:16 +02:00
|
|
|
else if (::strcmp(key, "Description") == 0)
|
|
|
|
|
m_aprsDescription = value;
|
2025-06-01 16:04:44 +02:00
|
|
|
else if (::strcmp(key, "Symbol") == 0)
|
|
|
|
|
m_aprsSymbol = value;
|
2025-03-15 18:03:06 +01:00
|
|
|
} else if (section == SECTION::DYNAMIC_TG_CONTROL) {
|
2020-08-28 16:15:25 +02:00
|
|
|
if (::strcmp(key, "Enabled") == 0)
|
|
|
|
|
m_dynamicTGControlEnabled = ::atoi(value) == 1;
|
|
|
|
|
else if (::strcmp(key, "Port") == 0)
|
2021-04-25 07:44:55 +02:00
|
|
|
m_dynamicTGControlPort = (unsigned short)::atoi(value);
|
2025-03-15 18:03:06 +01:00
|
|
|
} else if (section == SECTION::REMOTE_CONTROL) {
|
2021-03-20 13:03:19 +01:00
|
|
|
if (::strcmp(key, "Enable") == 0)
|
|
|
|
|
m_remoteControlEnabled = ::atoi(value) == 1;
|
|
|
|
|
else if (::strcmp(key, "Address") == 0)
|
|
|
|
|
m_remoteControlAddress = value;
|
|
|
|
|
else if (::strcmp(key, "Port") == 0)
|
2021-04-25 07:44:55 +02:00
|
|
|
m_remoteControlPort = (unsigned short)::atoi(value);
|
2017-04-28 17:45:05 +02:00
|
|
|
}
|
|
|
|
|
}
|
2017-04-20 21:51:30 +02:00
|
|
|
|
2017-04-28 17:45:05 +02:00
|
|
|
::fclose(fp);
|
2017-04-20 21:51:30 +02:00
|
|
|
|
2017-04-28 17:45:05 +02:00
|
|
|
return true;
|
2017-04-20 21:51:30 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
bool CConf::getDaemon() const
|
|
|
|
|
{
|
|
|
|
|
return m_daemon;
|
|
|
|
|
}
|
|
|
|
|
|
2017-04-23 21:17:25 +02:00
|
|
|
std::string CConf::getRptAddress() const
|
2017-04-20 21:51:30 +02:00
|
|
|
{
|
2017-04-23 21:17:25 +02:00
|
|
|
return m_rptAddress;
|
2017-04-20 21:51:30 +02:00
|
|
|
}
|
|
|
|
|
|
2021-04-25 07:44:55 +02:00
|
|
|
unsigned short CConf::getRptPort() const
|
2017-04-20 21:51:30 +02:00
|
|
|
{
|
2017-04-23 21:17:25 +02:00
|
|
|
return m_rptPort;
|
2017-04-20 21:51:30 +02:00
|
|
|
}
|
|
|
|
|
|
2017-04-23 21:17:25 +02:00
|
|
|
std::string CConf::getLocalAddress() const
|
2017-04-20 21:51:30 +02:00
|
|
|
{
|
2017-04-23 21:17:25 +02:00
|
|
|
return m_localAddress;
|
2017-04-20 21:51:30 +02:00
|
|
|
}
|
|
|
|
|
|
2021-04-25 07:44:55 +02:00
|
|
|
unsigned short CConf::getLocalPort() const
|
2017-04-20 21:51:30 +02:00
|
|
|
{
|
2017-04-23 21:17:25 +02:00
|
|
|
return m_localPort;
|
2017-04-20 21:51:30 +02:00
|
|
|
}
|
|
|
|
|
|
2017-09-22 22:03:44 +02:00
|
|
|
unsigned int CConf::getRFTimeout() const
|
2017-04-20 21:51:30 +02:00
|
|
|
{
|
2017-09-22 22:03:44 +02:00
|
|
|
return m_rfTimeout;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
unsigned int CConf::getNetTimeout() const
|
|
|
|
|
{
|
|
|
|
|
return m_netTimeout;
|
2017-04-20 21:51:30 +02:00
|
|
|
}
|
|
|
|
|
|
2017-06-04 16:17:43 +02:00
|
|
|
bool CConf::getRuleTrace() const
|
|
|
|
|
{
|
|
|
|
|
return m_ruleTrace;
|
|
|
|
|
}
|
|
|
|
|
|
2017-04-23 21:17:25 +02:00
|
|
|
bool CConf::getDebug() const
|
2017-04-20 21:51:30 +02:00
|
|
|
{
|
2017-04-23 21:17:25 +02:00
|
|
|
return m_debug;
|
2017-04-20 21:51:30 +02:00
|
|
|
}
|
|
|
|
|
|
2017-04-23 21:17:25 +02:00
|
|
|
unsigned int CConf::getLogDisplayLevel() const
|
2017-04-20 21:51:30 +02:00
|
|
|
{
|
2017-04-23 21:17:25 +02:00
|
|
|
return m_logDisplayLevel;
|
2017-04-20 21:51:30 +02:00
|
|
|
}
|
|
|
|
|
|
2017-04-23 21:17:25 +02:00
|
|
|
unsigned int CConf::getLogFileLevel() const
|
2017-04-20 21:51:30 +02:00
|
|
|
{
|
2017-04-23 21:17:25 +02:00
|
|
|
return m_logFileLevel;
|
2017-04-20 21:51:30 +02:00
|
|
|
}
|
|
|
|
|
|
2017-04-23 21:17:25 +02:00
|
|
|
std::string CConf::getLogFilePath() const
|
2017-04-20 21:51:30 +02:00
|
|
|
{
|
2017-04-23 21:17:25 +02:00
|
|
|
return m_logFilePath;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
std::string CConf::getLogFileRoot() const
|
|
|
|
|
{
|
|
|
|
|
return m_logFileRoot;
|
2017-04-20 21:51:30 +02:00
|
|
|
}
|
|
|
|
|
|
2020-10-31 23:45:54 +01:00
|
|
|
bool CConf::getLogFileRotate() const
|
|
|
|
|
{
|
|
|
|
|
return m_logFileRotate;
|
|
|
|
|
}
|
|
|
|
|
|
2017-05-01 15:46:43 +02:00
|
|
|
bool CConf::getVoiceEnabled() const
|
|
|
|
|
{
|
|
|
|
|
return m_voiceEnabled;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
std::string CConf::getVoiceLanguage() const
|
|
|
|
|
{
|
|
|
|
|
return m_voiceLanguage;
|
|
|
|
|
}
|
|
|
|
|
|
2017-05-01 21:05:41 +02:00
|
|
|
std::string CConf::getVoiceDirectory() const
|
|
|
|
|
{
|
|
|
|
|
return m_voiceDirectory;
|
|
|
|
|
}
|
|
|
|
|
|
2017-10-08 15:13:52 +02:00
|
|
|
float CConf::getInfoLatitude() const
|
|
|
|
|
{
|
|
|
|
|
return m_infoLatitude;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
float CConf::getInfoLongitude() const
|
|
|
|
|
{
|
|
|
|
|
return m_infoLongitude;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
int CConf::getInfoHeight() const
|
|
|
|
|
{
|
|
|
|
|
return m_infoHeight;
|
|
|
|
|
}
|
|
|
|
|
|
2020-08-27 11:37:26 +02:00
|
|
|
std::string CConf::getInfoLocation() const
|
|
|
|
|
{
|
|
|
|
|
return m_infoLocation;
|
|
|
|
|
}
|
|
|
|
|
|
2017-10-08 15:13:52 +02:00
|
|
|
std::string CConf::getInfoDescription() const
|
|
|
|
|
{
|
|
|
|
|
return m_infoDescription;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
std::string CConf::getInfoURL() const
|
|
|
|
|
{
|
|
|
|
|
return m_infoURL;
|
|
|
|
|
}
|
|
|
|
|
|
2017-08-20 22:48:49 +02:00
|
|
|
bool CConf::getXLXNetworkEnabled() const
|
2017-04-20 21:51:30 +02:00
|
|
|
{
|
2017-08-20 22:48:49 +02:00
|
|
|
return m_xlxNetworkEnabled;
|
2017-04-20 21:51:30 +02:00
|
|
|
}
|
|
|
|
|
|
2017-08-20 22:48:49 +02:00
|
|
|
unsigned int CConf::getXLXNetworkId() const
|
2017-04-20 21:51:30 +02:00
|
|
|
{
|
2017-08-20 22:48:49 +02:00
|
|
|
return m_xlxNetworkId;
|
2017-04-20 21:51:30 +02:00
|
|
|
}
|
|
|
|
|
|
2017-08-20 22:48:49 +02:00
|
|
|
std::string CConf::getXLXNetworkFile() const
|
2017-05-03 18:48:55 +02:00
|
|
|
{
|
2017-08-20 22:48:49 +02:00
|
|
|
return m_xlxNetworkFile;
|
2017-05-03 18:48:55 +02:00
|
|
|
}
|
|
|
|
|
|
2017-09-26 14:08:35 +02:00
|
|
|
unsigned int CConf::getXLXNetworkReloadTime() const
|
|
|
|
|
{
|
2025-06-01 16:04:44 +02:00
|
|
|
return m_xlxNetworkReloadTime;
|
2017-09-26 14:08:35 +02:00
|
|
|
}
|
|
|
|
|
|
2021-04-25 07:44:55 +02:00
|
|
|
unsigned short CConf::getXLXNetworkPort() const
|
2017-09-26 15:58:22 +02:00
|
|
|
{
|
2025-06-01 16:04:44 +02:00
|
|
|
return m_xlxNetworkPort;
|
2017-09-26 15:58:22 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
std::string CConf::getXLXNetworkPassword() const
|
|
|
|
|
{
|
2025-06-01 16:04:44 +02:00
|
|
|
return m_xlxNetworkPassword;
|
2017-09-26 15:58:22 +02:00
|
|
|
}
|
|
|
|
|
|
2021-04-25 07:44:55 +02:00
|
|
|
unsigned short CConf::getXLXNetworkLocal() const
|
2017-05-03 18:48:55 +02:00
|
|
|
{
|
2017-08-20 22:48:49 +02:00
|
|
|
return m_xlxNetworkLocal;
|
2017-05-03 18:48:55 +02:00
|
|
|
}
|
|
|
|
|
|
2017-08-20 22:48:49 +02:00
|
|
|
unsigned int CConf::getXLXNetworkSlot() const
|
2017-05-25 19:24:05 +02:00
|
|
|
{
|
2017-08-20 22:48:49 +02:00
|
|
|
return m_xlxNetworkSlot;
|
2017-05-25 19:24:05 +02:00
|
|
|
}
|
|
|
|
|
|
2017-08-20 22:48:49 +02:00
|
|
|
unsigned int CConf::getXLXNetworkTG() const
|
2017-05-30 14:42:30 +02:00
|
|
|
{
|
2017-08-20 22:48:49 +02:00
|
|
|
return m_xlxNetworkTG;
|
2017-05-30 14:42:30 +02:00
|
|
|
}
|
|
|
|
|
|
2017-08-20 22:48:49 +02:00
|
|
|
unsigned int CConf::getXLXNetworkBase() const
|
2017-06-20 14:48:01 +02:00
|
|
|
{
|
2017-08-20 22:48:49 +02:00
|
|
|
return m_xlxNetworkBase;
|
2017-06-20 14:48:01 +02:00
|
|
|
}
|
|
|
|
|
|
2022-02-17 10:36:23 +01:00
|
|
|
std::string CConf::getXLXNetworkStartup() const
|
2017-04-20 21:51:30 +02:00
|
|
|
{
|
2017-08-20 22:48:49 +02:00
|
|
|
return m_xlxNetworkStartup;
|
2017-04-20 21:51:30 +02:00
|
|
|
}
|
|
|
|
|
|
2017-08-20 22:48:49 +02:00
|
|
|
unsigned int CConf::getXLXNetworkRelink() const
|
2017-04-20 21:51:30 +02:00
|
|
|
{
|
2017-08-20 22:48:49 +02:00
|
|
|
return m_xlxNetworkRelink;
|
2017-04-20 21:51:30 +02:00
|
|
|
}
|
|
|
|
|
|
2017-08-20 22:48:49 +02:00
|
|
|
bool CConf::getXLXNetworkDebug() const
|
2017-04-20 21:51:30 +02:00
|
|
|
{
|
2017-08-20 22:48:49 +02:00
|
|
|
return m_xlxNetworkDebug;
|
2017-04-20 21:51:30 +02:00
|
|
|
}
|
2018-10-21 11:18:55 +02:00
|
|
|
bool CConf::getXLXNetworkUserControl() const
|
|
|
|
|
{
|
|
|
|
|
return m_xlxNetworkUserControl;
|
|
|
|
|
}
|
2018-10-21 16:26:54 +02:00
|
|
|
char CConf::getXLXNetworkModule() const
|
|
|
|
|
{
|
|
|
|
|
return m_xlxNetworkModule;
|
|
|
|
|
}
|
2017-04-20 21:51:30 +02:00
|
|
|
|
2025-06-01 16:43:06 +02:00
|
|
|
CDMRNetConfStruct *CConf::addDMRNetwork()
|
2019-03-16 11:08:32 +01:00
|
|
|
{
|
2025-06-01 16:43:06 +02:00
|
|
|
m_dmrNetworks.emplace_back();
|
|
|
|
|
CDMRNetConfStruct& dmrNetwork = m_dmrNetworks.back();
|
2020-04-01 23:22:12 +02:00
|
|
|
|
2025-06-01 16:43:06 +02:00
|
|
|
// set defaults
|
|
|
|
|
dmrNetwork.m_Enabled = false;
|
|
|
|
|
dmrNetwork.m_Id = 0U;
|
|
|
|
|
dmrNetwork.m_Port = 0U;
|
|
|
|
|
dmrNetwork.m_Local = 0U;
|
|
|
|
|
dmrNetwork.m_Location = true;
|
|
|
|
|
dmrNetwork.m_Debug = false;
|
2019-05-19 08:56:39 +02:00
|
|
|
|
2025-06-01 16:43:06 +02:00
|
|
|
return &dmrNetwork;
|
2019-03-16 11:08:32 +01:00
|
|
|
}
|
|
|
|
|
|
2025-06-01 16:43:06 +02:00
|
|
|
unsigned int CConf::getDMRNetworksCount() const
|
2019-03-16 11:08:32 +01:00
|
|
|
{
|
2025-06-01 16:43:06 +02:00
|
|
|
return m_dmrNetworks.size();
|
2019-03-16 11:08:32 +01:00
|
|
|
}
|
2019-07-17 09:21:52 +02:00
|
|
|
|
2025-06-01 16:43:06 +02:00
|
|
|
bool CConf::getDMRNetworkEnabled(unsigned int index) const
|
2019-07-17 09:21:52 +02:00
|
|
|
{
|
2025-06-01 16:43:06 +02:00
|
|
|
return m_dmrNetworks[index].m_Enabled;
|
2019-07-17 09:21:52 +02:00
|
|
|
}
|
|
|
|
|
|
2025-06-01 16:43:06 +02:00
|
|
|
std::string CConf::getDMRNetworkName(unsigned int index) const
|
2019-07-17 09:21:52 +02:00
|
|
|
{
|
2025-06-01 16:43:06 +02:00
|
|
|
if (m_dmrNetworks[index].m_Name.empty())
|
|
|
|
|
return "DMR-" + std::to_string(index + 1);
|
2019-07-17 09:21:52 +02:00
|
|
|
else
|
2025-06-01 16:43:06 +02:00
|
|
|
return m_dmrNetworks[index].m_Name;
|
2019-07-17 09:21:52 +02:00
|
|
|
}
|
|
|
|
|
|
2025-06-01 16:43:06 +02:00
|
|
|
unsigned int CConf::getDMRNetworkId(unsigned int index) const
|
2019-07-17 09:21:52 +02:00
|
|
|
{
|
2025-06-01 16:43:06 +02:00
|
|
|
return m_dmrNetworks[index].m_Id;
|
2019-07-17 09:21:52 +02:00
|
|
|
}
|
|
|
|
|
|
2025-06-01 16:43:06 +02:00
|
|
|
std::string CConf::getDMRNetworkAddress(unsigned int index) const
|
2019-07-17 09:21:52 +02:00
|
|
|
{
|
2025-06-01 16:43:06 +02:00
|
|
|
return m_dmrNetworks[index].m_Address;
|
2019-07-17 09:21:52 +02:00
|
|
|
}
|
|
|
|
|
|
2025-06-01 16:43:06 +02:00
|
|
|
unsigned short CConf::getDMRNetworkPort(unsigned int index) const
|
2019-07-17 09:21:52 +02:00
|
|
|
{
|
2025-06-01 16:43:06 +02:00
|
|
|
return m_dmrNetworks[index].m_Port;
|
2019-07-17 09:21:52 +02:00
|
|
|
}
|
|
|
|
|
|
2025-06-01 16:43:06 +02:00
|
|
|
unsigned short CConf::getDMRNetworkLocal(unsigned int index) const
|
2019-07-17 09:21:52 +02:00
|
|
|
{
|
2025-06-01 16:43:06 +02:00
|
|
|
return m_dmrNetworks[index].m_Local;
|
2019-07-17 09:21:52 +02:00
|
|
|
}
|
|
|
|
|
|
2025-06-01 16:43:06 +02:00
|
|
|
std::string CConf::getDMRNetworkPassword(unsigned int index) const
|
2019-07-17 09:21:52 +02:00
|
|
|
{
|
2025-06-01 16:43:06 +02:00
|
|
|
return m_dmrNetworks[index].m_Password;
|
2019-07-17 09:21:52 +02:00
|
|
|
}
|
|
|
|
|
|
2025-06-01 16:43:06 +02:00
|
|
|
std::string CConf::getDMRNetworkOptions(unsigned int index) const
|
2019-07-17 09:21:52 +02:00
|
|
|
{
|
2025-06-01 16:43:06 +02:00
|
|
|
return m_dmrNetworks[index].m_Options;
|
2019-07-17 09:21:52 +02:00
|
|
|
}
|
|
|
|
|
|
2025-06-01 16:43:06 +02:00
|
|
|
bool CConf::getDMRNetworkLocation(unsigned int index) const
|
2019-07-17 09:21:52 +02:00
|
|
|
{
|
2025-06-01 16:43:06 +02:00
|
|
|
return m_dmrNetworks[index].m_Location;
|
2019-07-17 09:21:52 +02:00
|
|
|
}
|
|
|
|
|
|
2025-06-01 16:43:06 +02:00
|
|
|
bool CConf::getDMRNetworkDebug(unsigned int index) const
|
2019-07-17 09:21:52 +02:00
|
|
|
{
|
2025-06-01 16:43:06 +02:00
|
|
|
return m_dmrNetworks[index].m_Debug;
|
2019-07-17 09:21:52 +02:00
|
|
|
}
|
|
|
|
|
|
2025-06-01 16:43:06 +02:00
|
|
|
std::vector<CTGRewriteStruct> CConf::getDMRNetworkTGRewrites(unsigned int index) const
|
2019-07-17 09:21:52 +02:00
|
|
|
{
|
2025-06-01 16:43:06 +02:00
|
|
|
return m_dmrNetworks[index].m_TGRewrites;
|
2019-07-17 09:21:52 +02:00
|
|
|
}
|
|
|
|
|
|
2025-06-01 16:43:06 +02:00
|
|
|
std::vector<CPCRewriteStruct> CConf::getDMRNetworkPCRewrites(unsigned int index) const
|
2019-07-17 09:21:52 +02:00
|
|
|
{
|
2025-06-01 16:43:06 +02:00
|
|
|
return m_dmrNetworks[index].m_PCRewrites;
|
2019-07-17 09:21:52 +02:00
|
|
|
}
|
|
|
|
|
|
2025-06-01 16:43:06 +02:00
|
|
|
std::vector<CTypeRewriteStruct> CConf::getDMRNetworkTypeRewrites(unsigned int index) const
|
2019-07-17 09:21:52 +02:00
|
|
|
{
|
2025-06-01 16:43:06 +02:00
|
|
|
return m_dmrNetworks[index].m_TypeRewrites;
|
2019-07-17 09:21:52 +02:00
|
|
|
}
|
|
|
|
|
|
2025-06-01 16:43:06 +02:00
|
|
|
std::vector<CSrcRewriteStruct> CConf::getDMRNetworkSrcRewrites(unsigned int index) const
|
2019-07-17 09:21:52 +02:00
|
|
|
{
|
2025-06-01 16:43:06 +02:00
|
|
|
return m_dmrNetworks[index].m_SrcRewrites;
|
2019-07-17 09:21:52 +02:00
|
|
|
}
|
|
|
|
|
|
2025-06-01 16:43:06 +02:00
|
|
|
std::vector<CTGDynRewriteStruct> CConf::getDMRNetworkTGDynRewrites(unsigned int index) const
|
2020-04-01 23:22:12 +02:00
|
|
|
{
|
2025-06-01 16:43:06 +02:00
|
|
|
return m_dmrNetworks[index].m_TGDynRewrites;
|
2020-04-01 23:22:12 +02:00
|
|
|
}
|
|
|
|
|
|
2025-06-01 16:43:06 +02:00
|
|
|
std::vector<CIdRewriteStruct> CConf::getDMRNetworkIdRewrites(unsigned int index) const
|
2019-07-17 09:21:52 +02:00
|
|
|
{
|
2025-06-01 16:43:06 +02:00
|
|
|
return m_dmrNetworks[index].m_IdRewrites;
|
2019-07-17 09:21:52 +02:00
|
|
|
}
|
|
|
|
|
|
2025-06-01 16:43:06 +02:00
|
|
|
std::vector<unsigned int> CConf::getDMRNetworkPassAllPC(unsigned int index) const
|
2019-07-17 09:21:52 +02:00
|
|
|
{
|
2025-06-01 16:43:06 +02:00
|
|
|
return m_dmrNetworks[index].m_PassAllPC;
|
2019-07-17 09:21:52 +02:00
|
|
|
}
|
|
|
|
|
|
2025-06-01 16:43:06 +02:00
|
|
|
std::vector<unsigned int> CConf::getDMRNetworkPassAllTG(unsigned int index) const
|
2019-07-17 09:21:52 +02:00
|
|
|
{
|
2025-06-01 16:43:06 +02:00
|
|
|
return m_dmrNetworks[index].m_PassAllTG;
|
2019-07-17 09:21:52 +02:00
|
|
|
}
|
2020-04-13 15:15:21 +02:00
|
|
|
|
2020-08-26 15:20:04 +02:00
|
|
|
bool CConf::getGPSDEnabled() const
|
|
|
|
|
{
|
|
|
|
|
return m_gpsdEnabled;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
std::string CConf::getGPSDAddress() const
|
|
|
|
|
{
|
|
|
|
|
return m_gpsdAddress;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
std::string CConf::getGPSDPort() const
|
|
|
|
|
{
|
|
|
|
|
return m_gpsdPort;
|
|
|
|
|
}
|
2020-08-28 16:15:25 +02:00
|
|
|
|
|
|
|
|
bool CConf::getAPRSEnabled() const
|
|
|
|
|
{
|
|
|
|
|
return m_aprsEnabled;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
std::string CConf::getAPRSAddress() const
|
|
|
|
|
{
|
|
|
|
|
return m_aprsAddress;
|
|
|
|
|
}
|
|
|
|
|
|
2021-04-25 07:44:55 +02:00
|
|
|
unsigned short CConf::getAPRSPort() const
|
2020-08-28 16:15:25 +02:00
|
|
|
{
|
|
|
|
|
return m_aprsPort;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
std::string CConf::getAPRSSuffix() const
|
|
|
|
|
{
|
|
|
|
|
return m_aprsSuffix;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
std::string CConf::getAPRSDescription() const
|
|
|
|
|
{
|
|
|
|
|
return m_aprsDescription;
|
|
|
|
|
}
|
|
|
|
|
|
2023-02-13 02:27:45 +01:00
|
|
|
std::string CConf::getAPRSSymbol() const
|
|
|
|
|
{
|
2025-06-01 16:04:44 +02:00
|
|
|
return m_aprsSymbol;
|
2023-02-13 02:27:45 +01:00
|
|
|
}
|
|
|
|
|
|
2020-08-28 16:15:25 +02:00
|
|
|
bool CConf::getDynamicTGControlEnabled() const
|
|
|
|
|
{
|
|
|
|
|
return m_dynamicTGControlEnabled;
|
|
|
|
|
}
|
|
|
|
|
|
2021-04-25 07:44:55 +02:00
|
|
|
unsigned short CConf::getDynamicTGControlPort() const
|
2020-08-28 16:15:25 +02:00
|
|
|
{
|
|
|
|
|
return m_dynamicTGControlPort;
|
|
|
|
|
}
|
2021-03-20 13:03:19 +01:00
|
|
|
|
|
|
|
|
bool CConf::getRemoteControlEnabled() const
|
|
|
|
|
{
|
|
|
|
|
return m_remoteControlEnabled;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
std::string CConf::getRemoteControlAddress() const
|
|
|
|
|
{
|
|
|
|
|
return m_remoteControlAddress;
|
|
|
|
|
}
|
|
|
|
|
|
2021-04-25 07:44:55 +02:00
|
|
|
unsigned short CConf::getRemoteControlPort() const
|
2021-03-20 13:03:19 +01:00
|
|
|
{
|
|
|
|
|
return m_remoteControlPort;
|
|
|
|
|
}
|