Skip to content

Commit

Permalink
Allow optional direct connections to masters again.
Browse files Browse the repository at this point in the history
  • Loading branch information
g4klx committed Dec 6, 2020
1 parent 1b0caaa commit 136deac
Show file tree
Hide file tree
Showing 26 changed files with 1,865 additions and 527 deletions.
8 changes: 8 additions & 0 deletions Conf.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -206,6 +206,7 @@ m_dstarLocalPort(0U),
m_dstarNetworkModeHang(3U),
m_dstarNetworkDebug(false),
m_dmrNetworkEnabled(false),
m_dmrNetworkType("Gateway"),
m_dmrNetworkAddress(),
m_dmrNetworkPort(0U),
m_dmrNetworkLocal(0U),
Expand Down Expand Up @@ -794,6 +795,8 @@ bool CConf::read()
} else if (section == SECTION_DMR_NETWORK) {
if (::strcmp(key, "Enable") == 0)
m_dmrNetworkEnabled = ::atoi(value) == 1;
else if (::strcmp(key, "Type") == 0)
m_dmrNetworkType = value;
else if (::strcmp(key, "Address") == 0)
m_dmrNetworkAddress = value;
else if (::strcmp(key, "Port") == 0)
Expand Down Expand Up @@ -1687,6 +1690,11 @@ bool CConf::getDMRNetworkEnabled() const
return m_dmrNetworkEnabled;
}

std::string CConf::getDMRNetworkType() const
{
return m_dmrNetworkType;
}

std::string CConf::getDMRNetworkAddress() const
{
return m_dmrNetworkAddress;
Expand Down
2 changes: 2 additions & 0 deletions Conf.h
Original file line number Diff line number Diff line change
Expand Up @@ -209,6 +209,7 @@ class CConf

// The DMR Network section
bool getDMRNetworkEnabled() const;
std::string getDMRNetworkType() const;
std::string getDMRNetworkAddress() const;
unsigned int getDMRNetworkPort() const;
unsigned int getDMRNetworkLocal() const;
Expand Down Expand Up @@ -469,6 +470,7 @@ class CConf
bool m_dstarNetworkDebug;

bool m_dmrNetworkEnabled;
std::string m_dmrNetworkType;
std::string m_dmrNetworkAddress;
unsigned int m_dmrNetworkPort;
unsigned int m_dmrNetworkLocal;
Expand Down
4 changes: 2 additions & 2 deletions DMRControl.cpp
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (C) 2015-2019 Jonathan Naylor, G4KLX
* Copyright (C) 2015-2020 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
Expand All @@ -21,7 +21,7 @@
#include <cassert>
#include <algorithm>

CDMRControl::CDMRControl(unsigned int id, unsigned int colorCode, unsigned int callHang, bool selfOnly, bool embeddedLCOnly, bool dumpTAData, const std::vector<unsigned int>& prefixes, const std::vector<unsigned int>& blacklist, const std::vector<unsigned int>& whitelist, const std::vector<unsigned int>& slot1TGWhitelist, const std::vector<unsigned int>& slot2TGWhitelist, unsigned int timeout, CModem* modem, CDMRNetwork* network, CDisplay* display, bool duplex, CDMRLookup* lookup, CRSSIInterpolator* rssi, unsigned int jitter, DMR_OVCM_TYPES ovcm) :
CDMRControl::CDMRControl(unsigned int id, unsigned int colorCode, unsigned int callHang, bool selfOnly, bool embeddedLCOnly, bool dumpTAData, const std::vector<unsigned int>& prefixes, const std::vector<unsigned int>& blacklist, const std::vector<unsigned int>& whitelist, const std::vector<unsigned int>& slot1TGWhitelist, const std::vector<unsigned int>& slot2TGWhitelist, unsigned int timeout, CModem* modem, IDMRNetwork* network, CDisplay* display, bool duplex, CDMRLookup* lookup, CRSSIInterpolator* rssi, unsigned int jitter, DMR_OVCM_TYPES ovcm) :
m_colorCode(colorCode),
m_modem(modem),
m_network(network),
Expand Down
6 changes: 3 additions & 3 deletions DMRControl.h
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (C) 2015-2019 by Jonathan Naylor G4KLX
* Copyright (C) 2015-2020 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
Expand Down Expand Up @@ -31,7 +31,7 @@

class CDMRControl {
public:
CDMRControl(unsigned int id, unsigned int colorCode, unsigned int callHang, bool selfOnly, bool embeddedLCOnly, bool dumpTAData, const std::vector<unsigned int>& prefixes, const std::vector<unsigned int>& blacklist, const std::vector<unsigned int>& whitelist, const std::vector<unsigned int>& slot1TGWhitelist, const std::vector<unsigned int>& slot2TGWhitelist, unsigned int timeout, CModem* modem, CDMRNetwork* network, CDisplay* display, bool duplex, CDMRLookup* lookup, CRSSIInterpolator* rssi, unsigned int jitter, DMR_OVCM_TYPES ovcm);
CDMRControl(unsigned int id, unsigned int colorCode, unsigned int callHang, bool selfOnly, bool embeddedLCOnly, bool dumpTAData, const std::vector<unsigned int>& prefixes, const std::vector<unsigned int>& blacklist, const std::vector<unsigned int>& whitelist, const std::vector<unsigned int>& slot1TGWhitelist, const std::vector<unsigned int>& slot2TGWhitelist, unsigned int timeout, CModem* modem, IDMRNetwork* network, CDisplay* display, bool duplex, CDMRLookup* lookup, CRSSIInterpolator* rssi, unsigned int jitter, DMR_OVCM_TYPES ovcm);
~CDMRControl();

bool processWakeup(const unsigned char* data);
Expand All @@ -51,7 +51,7 @@ class CDMRControl {
private:
unsigned int m_colorCode;
CModem* m_modem;
CDMRNetwork* m_network;
IDMRNetwork* m_network;
CDMRSlot m_slot1;
CDMRSlot m_slot2;
CDMRLookup* m_lookup;
Expand Down
Loading

0 comments on commit 136deac

Please sign in to comment.