Add XLX options

master
Geoffrey Merck 4 years ago
parent b37078f4f5
commit b41051164a

@ -46,7 +46,8 @@ bool CDStarGatewayConfig::load()
&& loadDextra(cfg)
&& loadDCS(cfg)
&& loadDPlus(cfg)
&& loadRemote(cfg)) {
&& loadRemote(cfg)
&& loadXLX(cfg)) {
//properly size values
m_gateway.callsign.resize(LONG_CALLSIGN_LENGTH - 1U, ' ');
@ -60,6 +61,14 @@ bool CDStarGatewayConfig::load()
return false;
}
bool CDStarGatewayConfig::loadXLX(const Config & cfg)
{
bool ret = get_value(cfg, "xlx.enabled", m_xlx.enabled, true);
ret = get_value(cfg, "xlx.hostfileUrl", m_xlx.url, 0, 1024, "", false) && ret;
return ret;
}
bool CDStarGatewayConfig::loadRemote(const Config & cfg)
{
bool ret = get_value(cfg, "remote.enabled", m_remote.enabled, false);
@ -514,3 +523,8 @@ void CDStarGatewayConfig::getRemote(TRemote & remote) const
{
remote = m_remote;
}
void CDStarGatewayConfig::getXLX(TXLX & xlx) const
{
xlx = m_xlx;
}

@ -101,6 +101,11 @@ typedef struct {
bool enabled;
} TDCS;
typedef struct {
bool enabled;
std::string url;
} TXLX;
typedef struct {
bool enabled;
unsigned int port;
@ -125,6 +130,7 @@ public:
void getDPlus(TDplus & dplus) const;
void getDCS(TDCS & dcs) const;
void getRemote(TRemote & remote) const;
void getXLX(TXLX & xlx) const;
private:
bool open(Config & cfg);
@ -137,6 +143,7 @@ private:
bool loadDPlus(const Config & cfg);
bool loadDCS(const Config & cfg);
bool loadRemote(const Config & cfg);
bool loadXLX(const Config & cfg);
bool get_value(const Config &cfg, const std::string &path, unsigned int &value, unsigned int min, unsigned int max, unsigned int default_value);
bool get_value(const Config &cfg, const std::string &path, int &value, int min, int max, int default_value);
bool get_value(const Config &cfg, const std::string &path, double &value, double min, double max, double default_value);
@ -153,6 +160,7 @@ private:
TDplus m_dplus;
TDCS m_dcs;
TRemote m_remote;
TXLX m_xlx;
std::vector<TRepeater *> m_repeaters;
std::vector<TircDDB *> m_ircDDB;
};

Loading…
Cancel
Save

Powered by TurnKey Linux.