Skip to content

Commit

Permalink
Merge branch 'M17' into M17_AX25_FM
Browse files Browse the repository at this point in the history
  • Loading branch information
g4klx committed Nov 6, 2020
2 parents 72654cf + 18c8b95 commit d8677b4
Show file tree
Hide file tree
Showing 67 changed files with 3,146 additions and 88 deletions.
10 changes: 10 additions & 0 deletions CASTInfo.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -130,6 +130,16 @@ void CCASTInfo::clearNXDNInt()
{
}

void CCASTInfo::writeM17Int(const char* source, const char* dest, const char* type)
{
if (m_modem != NULL)
m_modem->writeM17Info(source, dest, type);
}

void CCASTInfo::clearM17Int()
{
}

void CCASTInfo::writePOCSAGInt(uint32_t ric, const std::string& message)
{
if (m_modem != NULL)
Expand Down
3 changes: 3 additions & 0 deletions CASTInfo.h
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,9 @@ class CCASTInfo : public CDisplay
virtual void writeNXDNInt(const char* source, bool group, unsigned int dest, const char* type);
virtual void clearNXDNInt();

virtual void writeM17Int(const char* source, const char* dest, const char* type);
virtual void clearM17Int();

virtual void writePOCSAGInt(uint32_t ric, const std::string& message);
virtual void clearPOCSAGInt();

Expand Down
125 changes: 114 additions & 11 deletions Conf.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -43,13 +43,15 @@ enum SECTION {
SECTION_FUSION,
SECTION_P25,
SECTION_NXDN,
SECTION_M17,
SECTION_POCSAG,
SECTION_FM,
SECTION_DSTAR_NETWORK,
SECTION_DMR_NETWORK,
SECTION_FUSION_NETWORK,
SECTION_P25_NETWORK,
SECTION_NXDN_NETWORK,
SECTION_M17_NETWORK,
SECTION_POCSAG_NETWORK,
SECTION_TFTSERIAL,
SECTION_HD44780,
Expand Down Expand Up @@ -103,6 +105,7 @@ m_modemDMRTXLevel(50.0F),
m_modemYSFTXLevel(50.0F),
m_modemP25TXLevel(50.0F),
m_modemNXDNTXLevel(50.0F),
m_modemM17TXLevel(50.0F),
m_modemPOCSAGTXLevel(50.0F),
m_modemFMTXLevel(50.0F),
m_modemRSSIMappingFile(),
Expand Down Expand Up @@ -166,6 +169,11 @@ m_nxdnSelfOnly(false),
m_nxdnRemoteGateway(false),
m_nxdnTXHang(5U),
m_nxdnModeHang(10U),
m_m17Enabled(false),
m_m17SelfOnly(false),
m_m17AllowEncryption(false),
m_m17TXHang(5U),
m_m17ModeHang(10U),
m_pocsagEnabled(false),
m_pocsagFrequency(0U),
m_fmEnabled(false),
Expand Down Expand Up @@ -237,6 +245,12 @@ m_nxdnLocalAddress(),
m_nxdnLocalPort(0U),
m_nxdnNetworkModeHang(3U),
m_nxdnNetworkDebug(false),
m_m17NetworkEnabled(false),
m_m17GatewayAddress(),
m_m17GatewayPort(0U),
m_m17LocalPort(0U),
m_m17NetworkModeHang(3U),
m_m17NetworkDebug(false),
m_pocsagNetworkEnabled(false),
m_pocsagGatewayAddress(),
m_pocsagGatewayPort(0U),
Expand Down Expand Up @@ -331,6 +345,8 @@ bool CConf::read()
section = SECTION_P25;
else if (::strncmp(buffer, "[NXDN]", 6U) == 0)
section = SECTION_NXDN;
else if (::strncmp(buffer, "[M17]", 5U) == 0)
section = SECTION_M17;
else if (::strncmp(buffer, "[POCSAG]", 8U) == 0)
section = SECTION_POCSAG;
else if (::strncmp(buffer, "[FM]", 4U) == 0)
Expand All @@ -345,6 +361,8 @@ bool CConf::read()
section = SECTION_P25_NETWORK;
else if (::strncmp(buffer, "[NXDN Network]", 14U) == 0)
section = SECTION_NXDN_NETWORK;
else if (::strncmp(buffer, "[M17 Network]", 13U) == 0)
section = SECTION_M17_NETWORK;
else if (::strncmp(buffer, "[POCSAG Network]", 16U) == 0)
section = SECTION_POCSAG_NETWORK;
else if (::strncmp(buffer, "[TFT Serial]", 12U) == 0)
Expand Down Expand Up @@ -406,12 +424,12 @@ bool CConf::read()
else if (::strcmp(key, "Duplex") == 0)
m_duplex = ::atoi(value) == 1;
else if (::strcmp(key, "ModeHang") == 0)
m_dstarNetworkModeHang = m_dmrNetworkModeHang = m_fusionNetworkModeHang = m_p25NetworkModeHang =
m_dstarModeHang = m_dmrModeHang = m_fusionModeHang = m_p25ModeHang = (unsigned int)::atoi(value);
m_dstarNetworkModeHang = m_dmrNetworkModeHang = m_fusionNetworkModeHang = m_p25NetworkModeHang = m_nxdnNetworkModeHang = m_m17NetworkModeHang =
m_dstarModeHang = m_dmrModeHang = m_fusionModeHang = m_p25ModeHang = m_nxdnModeHang = m_m17ModeHang = (unsigned int)::atoi(value);
else if (::strcmp(key, "RFModeHang") == 0)
m_dstarModeHang = m_dmrModeHang = m_fusionModeHang = m_p25ModeHang = (unsigned int)::atoi(value);
m_dstarModeHang = m_dmrModeHang = m_fusionModeHang = m_p25ModeHang = m_nxdnModeHang = m_m17ModeHang = (unsigned int)::atoi(value);
else if (::strcmp(key, "NetModeHang") == 0)
m_dstarNetworkModeHang = m_dmrNetworkModeHang = m_fusionNetworkModeHang = m_p25NetworkModeHang = (unsigned int)::atoi(value);
m_dstarNetworkModeHang = m_dmrNetworkModeHang = m_fusionNetworkModeHang = m_p25NetworkModeHang = m_nxdnNetworkModeHang = m_m17NetworkModeHang = (unsigned int)::atoi(value);
else if (::strcmp(key, "Display") == 0)
m_display = value;
else if (::strcmp(key, "Daemon") == 0)
Expand Down Expand Up @@ -485,7 +503,7 @@ bool CConf::read()
else if (::strcmp(key, "RXLevel") == 0)
m_modemRXLevel = float(::atof(value));
else if (::strcmp(key, "TXLevel") == 0)
m_modemFMTXLevel = m_modemCWIdTXLevel = m_modemDStarTXLevel = m_modemDMRTXLevel = m_modemYSFTXLevel = m_modemP25TXLevel = m_modemNXDNTXLevel = float(::atof(value));
m_modemFMTXLevel = m_modemCWIdTXLevel = m_modemDStarTXLevel = m_modemDMRTXLevel = m_modemYSFTXLevel = m_modemP25TXLevel = m_modemNXDNTXLevel = m_modemM17TXLevel = float(::atof(value));
else if (::strcmp(key, "CWIdTXLevel") == 0)
m_modemCWIdTXLevel = float(::atof(value));
else if (::strcmp(key, "D-StarTXLevel") == 0)
Expand All @@ -498,6 +516,8 @@ bool CConf::read()
m_modemP25TXLevel = float(::atof(value));
else if (::strcmp(key, "NXDNTXLevel") == 0)
m_modemNXDNTXLevel = float(::atof(value));
else if (::strcmp(key, "M17TXLevel") == 0)
m_modemM17TXLevel = float(::atof(value));
else if (::strcmp(key, "POCSAGTXLevel") == 0)
m_modemPOCSAGTXLevel = float(::atof(value));
else if (::strcmp(key, "FMTXLevel") == 0)
Expand Down Expand Up @@ -698,13 +718,23 @@ bool CConf::read()
m_nxdnTXHang = (unsigned int)::atoi(value);
else if (::strcmp(key, "ModeHang") == 0)
m_nxdnModeHang = (unsigned int)::atoi(value);
} else if (section == SECTION_M17) {
if (::strcmp(key, "Enable") == 0)
m_m17Enabled = ::atoi(value) == 1;
else if (::strcmp(key, "SelfOnly") == 0)
m_m17SelfOnly = ::atoi(value) == 1;
else if (::strcmp(key, "AllowEncryption") == 0)
m_m17AllowEncryption = ::atoi(value) == 1;
else if (::strcmp(key, "TXHang") == 0)
m_m17TXHang = (unsigned int)::atoi(value);
else if (::strcmp(key, "ModeHang") == 0)
m_m17ModeHang = (unsigned int)::atoi(value);
} else if (section == SECTION_POCSAG) {
if (::strcmp(key, "Enable") == 0)
m_pocsagEnabled = ::atoi(value) == 1;
else if (::strcmp(key, "Frequency") == 0)
m_pocsagFrequency = (unsigned int)::atoi(value);
}
else if (section == SECTION_FM) {
if (::strcmp(key, "Enable") == 0)
m_pocsagEnabled = ::atoi(value) == 1;
else if (::strcmp(key, "Frequency") == 0)
m_pocsagFrequency = (unsigned int)::atoi(value);
} else if (section == SECTION_FM) {
if (::strcmp(key, "Enable") == 0)
m_fmEnabled = ::atoi(value) == 1;
else if (::strcmp(key, "Callsign") == 0) {
Expand Down Expand Up @@ -859,6 +889,19 @@ bool CConf::read()
m_nxdnNetworkModeHang = (unsigned int)::atoi(value);
else if (::strcmp(key, "Debug") == 0)
m_nxdnNetworkDebug = ::atoi(value) == 1;
} else if (section == SECTION_M17_NETWORK) {
if (::strcmp(key, "Enable") == 0)
m_m17NetworkEnabled = ::atoi(value) == 1;
else if (::strcmp(key, "LocalPort") == 0)
m_m17LocalPort = (unsigned int)::atoi(value);
else if (::strcmp(key, "GatewayAddress") == 0)
m_m17GatewayAddress = value;
else if (::strcmp(key, "GatewayPort") == 0)
m_m17GatewayPort = (unsigned int)::atoi(value);
else if (::strcmp(key, "ModeHang") == 0)
m_m17NetworkModeHang = (unsigned int)::atoi(value);
else if (::strcmp(key, "Debug") == 0)
m_m17NetworkDebug = ::atoi(value) == 1;
} else if (section == SECTION_POCSAG_NETWORK) {
if (::strcmp(key, "Enable") == 0)
m_pocsagNetworkEnabled = ::atoi(value) == 1;
Expand Down Expand Up @@ -1172,6 +1215,11 @@ float CConf::getModemNXDNTXLevel() const
return m_modemNXDNTXLevel;
}

float CConf::getModemM17TXLevel() const
{
return m_modemM17TXLevel;
}

float CConf::getModemPOCSAGTXLevel() const
{
return m_modemPOCSAGTXLevel;
Expand Down Expand Up @@ -1487,6 +1535,31 @@ unsigned int CConf::getNXDNModeHang() const
return m_nxdnModeHang;
}

bool CConf::getM17Enabled() const
{
return m_m17Enabled;
}

bool CConf::getM17SelfOnly() const
{
return m_m17SelfOnly;
}

bool CConf::getM17AllowEncryption() const
{
return m_m17AllowEncryption;
}

unsigned int CConf::getM17TXHang() const
{
return m_m17TXHang;
}

unsigned int CConf::getM17ModeHang() const
{
return m_m17ModeHang;
}

bool CConf::getPOCSAGEnabled() const
{
return m_pocsagEnabled;
Expand Down Expand Up @@ -1842,6 +1915,36 @@ bool CConf::getNXDNNetworkDebug() const
return m_nxdnNetworkDebug;
}

bool CConf::getM17NetworkEnabled() const
{
return m_m17NetworkEnabled;
}

std::string CConf::getM17GatewayAddress() const
{
return m_m17GatewayAddress;
}

unsigned int CConf::getM17GatewayPort() const
{
return m_m17GatewayPort;
}

unsigned int CConf::getM17LocalPort() const
{
return m_m17LocalPort;
}

unsigned int CConf::getM17NetworkModeHang() const
{
return m_m17NetworkModeHang;
}

bool CConf::getM17NetworkDebug() const
{
return m_m17NetworkDebug;
}

bool CConf::getPOCSAGNetworkEnabled() const
{
return m_pocsagNetworkEnabled;
Expand Down
30 changes: 30 additions & 0 deletions Conf.h
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,7 @@ class CConf
float getModemYSFTXLevel() const;
float getModemP25TXLevel() const;
float getModemNXDNTXLevel() const;
float getModemM17TXLevel() const;
float getModemPOCSAGTXLevel() const;
float getModemFMTXLevel() const;
std::string getModemRSSIMappingFile() const;
Expand Down Expand Up @@ -162,6 +163,13 @@ class CConf
unsigned int getNXDNTXHang() const;
unsigned int getNXDNModeHang() const;

// The M17 section
bool getM17Enabled() const;
bool getM17SelfOnly() const;
bool getM17AllowEncryption() const;
unsigned int getM17TXHang() const;
unsigned int getM17ModeHang() const;

// The POCSAG section
bool getPOCSAGEnabled() const;
unsigned int getPOCSAGFrequency() const;
Expand Down Expand Up @@ -247,6 +255,14 @@ class CConf
unsigned int getNXDNNetworkModeHang() const;
bool getNXDNNetworkDebug() const;

// The M17 Network section
bool getM17NetworkEnabled() const;
std::string getM17GatewayAddress() const;
unsigned int getM17GatewayPort() const;
unsigned int getM17LocalPort() const;
unsigned int getM17NetworkModeHang() const;
bool getM17NetworkDebug() const;

// The POCSAG Network section
bool getPOCSAGNetworkEnabled() const;
std::string getPOCSAGGatewayAddress() const;
Expand Down Expand Up @@ -355,6 +371,7 @@ class CConf
float m_modemYSFTXLevel;
float m_modemP25TXLevel;
float m_modemNXDNTXLevel;
float m_modemM17TXLevel;
float m_modemPOCSAGTXLevel;
float m_modemFMTXLevel;
std::string m_modemRSSIMappingFile;
Expand Down Expand Up @@ -426,6 +443,12 @@ class CConf
unsigned int m_nxdnTXHang;
unsigned int m_nxdnModeHang;

bool m_m17Enabled;
bool m_m17SelfOnly;
bool m_m17AllowEncryption;
unsigned int m_m17TXHang;
unsigned int m_m17ModeHang;

bool m_pocsagEnabled;
unsigned int m_pocsagFrequency;

Expand Down Expand Up @@ -504,6 +527,13 @@ class CConf
unsigned int m_nxdnNetworkModeHang;
bool m_nxdnNetworkDebug;

bool m_m17NetworkEnabled;
std::string m_m17GatewayAddress;
unsigned int m_m17GatewayPort;
unsigned int m_m17LocalPort;
unsigned int m_m17NetworkModeHang;
bool m_m17NetworkDebug;

bool m_pocsagNetworkEnabled;
std::string m_pocsagGatewayAddress;
unsigned int m_pocsagGatewayPort;
Expand Down
3 changes: 2 additions & 1 deletion Defines.h
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (C) 2015,2016,2017,2018 by Jonathan Naylor G4KLX
* Copyright (C) 2015,2016,2017,2018,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 All @@ -26,6 +26,7 @@ const unsigned char MODE_YSF = 3U;
const unsigned char MODE_P25 = 4U;
const unsigned char MODE_NXDN = 5U;
const unsigned char MODE_POCSAG = 6U;
const unsigned char MODE_M17 = 7U;

const unsigned char MODE_FM = 10U;

Expand Down
Loading

0 comments on commit d8677b4

Please sign in to comment.