Skip to content

Commit

Permalink
nitial commit of POCSAG files.
Browse files Browse the repository at this point in the history
  • Loading branch information
g4klx committed Jun 7, 2018
1 parent 86630e2 commit 2a0364a
Show file tree
Hide file tree
Showing 23 changed files with 808 additions and 108 deletions.
80 changes: 80 additions & 0 deletions Conf.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -43,11 +43,13 @@ enum SECTION {
SECTION_FUSION,
SECTION_P25,
SECTION_NXDN,
SECTION_POCSAG,
SECTION_DSTAR_NETWORK,
SECTION_DMR_NETWORK,
SECTION_FUSION_NETWORK,
SECTION_P25_NETWORK,
SECTION_NXDN_NETWORK,
SECTION_POCSAG_NETWORK,
SECTION_TFTSERIAL,
SECTION_HD44780,
SECTION_NEXTION,
Expand Down Expand Up @@ -102,6 +104,7 @@ m_modemDMRTXLevel(50.0F),
m_modemYSFTXLevel(50.0F),
m_modemP25TXLevel(50.0F),
m_modemNXDNTXLevel(50.0F),
m_modemPOCSAGTXLevel(50.0F),
m_modemRSSIMappingFile(),
m_modemTrace(false),
m_modemDebug(false),
Expand Down Expand Up @@ -158,6 +161,7 @@ m_nxdnRAN(1U),
m_nxdnSelfOnly(false),
m_nxdnRemoteGateway(false),
m_nxdnModeHang(10U),
m_pocsagEnabled(false),
m_dstarNetworkEnabled(false),
m_dstarGatewayAddress(),
m_dstarGatewayPort(0U),
Expand Down Expand Up @@ -195,6 +199,13 @@ m_nxdnLocalAddress(),
m_nxdnLocalPort(0U),
m_nxdnNetworkModeHang(3U),
m_nxdnNetworkDebug(false),
m_pocsagNetworkEnabled(false),
m_pocsagGatewayAddress(),
m_pocsagGatewayPort(0U),
m_pocsagLocalAddress(),
m_pocsagLocalPort(0U),
m_pocsagNetworkModeHang(3U),
m_pocsagNetworkDebug(false),
m_tftSerialPort("/dev/ttyAMA0"),
m_tftSerialBrightness(50U),
m_hd44780Rows(2U),
Expand Down Expand Up @@ -273,6 +284,8 @@ bool CConf::read()
section = SECTION_P25;
else if (::strncmp(buffer, "[NXDN]", 6U) == 0)
section = SECTION_NXDN;
else if (::strncmp(buffer, "[POCSAG]", 8U) == 0)
section = SECTION_POCSAG;
else if (::strncmp(buffer, "[D-Star Network]", 16U) == 0)
section = SECTION_DSTAR_NETWORK;
else if (::strncmp(buffer, "[DMR Network]", 13U) == 0)
Expand All @@ -283,6 +296,8 @@ bool CConf::read()
section = SECTION_P25_NETWORK;
else if (::strncmp(buffer, "[NXDN Network]", 14U) == 0)
section = SECTION_NXDN_NETWORK;
else if (::strncmp(buffer, "[POCSAG Network]", 16U) == 0)
section = SECTION_POCSAG_NETWORK;
else if (::strncmp(buffer, "[TFT Serial]", 12U) == 0)
section = SECTION_TFTSERIAL;
else if (::strncmp(buffer, "[HD44780]", 9U) == 0)
Expand Down Expand Up @@ -425,6 +440,8 @@ bool CConf::read()
m_modemP25TXLevel = float(::atof(value));
else if (::strcmp(key, "NXDNTXLevel") == 0)
m_modemNXDNTXLevel = float(::atof(value));
else if (::strcmp(key, "POCSAGTXLevel") == 0)
m_modemPOCSAGTXLevel = float(::atof(value));
else if (::strcmp(key, "RSSIMappingFile") == 0)
m_modemRSSIMappingFile = value;
else if (::strcmp(key, "Trace") == 0)
Expand Down Expand Up @@ -586,6 +603,9 @@ bool CConf::read()
m_nxdnRemoteGateway = ::atoi(value) == 1;
else if (::strcmp(key, "ModeHang") == 0)
m_nxdnModeHang = (unsigned int)::atoi(value);
} else if (section == SECTION_POCSAG) {
if (::strcmp(key, "Enable") == 0)
m_pocsagEnabled = ::atoi(value) == 1;
} else if (section == SECTION_DSTAR_NETWORK) {
if (::strcmp(key, "Enable") == 0)
m_dstarNetworkEnabled = ::atoi(value) == 1;
Expand Down Expand Up @@ -665,6 +685,21 @@ bool CConf::read()
m_nxdnNetworkModeHang = (unsigned int)::atoi(value);
else if (::strcmp(key, "Debug") == 0)
m_nxdnNetworkDebug = ::atoi(value) == 1;
} else if (section == SECTION_POCSAG_NETWORK) {
if (::strcmp(key, "Enable") == 0)
m_pocsagNetworkEnabled = ::atoi(value) == 1;
else if (::strcmp(key, "LocalAddress") == 0)
m_pocsagLocalAddress = value;
else if (::strcmp(key, "LocalPort") == 0)
m_pocsagLocalPort = (unsigned int)::atoi(value);
else if (::strcmp(key, "GatewayAddress") == 0)
m_pocsagGatewayAddress = value;
else if (::strcmp(key, "GatewayPort") == 0)
m_pocsagGatewayPort = (unsigned int)::atoi(value);
else if (::strcmp(key, "ModeHang") == 0)
m_pocsagNetworkModeHang = (unsigned int)::atoi(value);
else if (::strcmp(key, "Debug") == 0)
m_pocsagNetworkDebug = ::atoi(value) == 1;
} else if (section == SECTION_TFTSERIAL) {
if (::strcmp(key, "Port") == 0)
m_tftSerialPort = value;
Expand Down Expand Up @@ -960,6 +995,11 @@ float CConf::getModemNXDNTXLevel() const
return m_modemNXDNTXLevel;
}

float CConf::getModemPOCSAGTXLevel() const
{
return m_modemPOCSAGTXLevel;
}

std::string CConf::getModemRSSIMappingFile () const
{
return m_modemRSSIMappingFile;
Expand Down Expand Up @@ -1240,6 +1280,11 @@ unsigned int CConf::getNXDNModeHang() const
return m_nxdnModeHang;
}

bool CConf::getPOCSAGEnabled() const
{
return m_pocsagEnabled;
}

bool CConf::getDStarNetworkEnabled() const
{
return m_dstarNetworkEnabled;
Expand Down Expand Up @@ -1425,6 +1470,41 @@ bool CConf::getNXDNNetworkDebug() const
return m_nxdnNetworkDebug;
}

bool CConf::getPOCSAGNetworkEnabled() const
{
return m_pocsagNetworkEnabled;
}

std::string CConf::getPOCSAGGatewayAddress() const
{
return m_pocsagGatewayAddress;
}

unsigned int CConf::getPOCSAGGatewayPort() const
{
return m_pocsagGatewayPort;
}

std::string CConf::getPOCSAGLocalAddress() const
{
return m_pocsagLocalAddress;
}

unsigned int CConf::getPOCSAGLocalPort() const
{
return m_pocsagLocalPort;
}

unsigned int CConf::getPOCSAGNetworkModeHang() const
{
return m_pocsagNetworkModeHang;
}

bool CConf::getPOCSAGNetworkDebug() const
{
return m_pocsagNetworkDebug;
}

std::string CConf::getTFTSerialPort() const
{
return m_tftSerialPort;
Expand Down
24 changes: 24 additions & 0 deletions Conf.h
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,7 @@ class CConf
float getModemYSFTXLevel() const;
float getModemP25TXLevel() const;
float getModemNXDNTXLevel() const;
float getModemPOCSAGTXLevel() const;
std::string getModemRSSIMappingFile() const;
bool getModemTrace() const;
bool getModemDebug() const;
Expand Down Expand Up @@ -158,6 +159,9 @@ class CConf
bool getNXDNRemoteGateway() const;
unsigned int getNXDNModeHang() const;

// The POCSAG section
bool getPOCSAGEnabled() const;

// The D-Star Network section
bool getDStarNetworkEnabled() const;
std::string getDStarGatewayAddress() const;
Expand Down Expand Up @@ -205,6 +209,15 @@ class CConf
unsigned int getNXDNNetworkModeHang() const;
bool getNXDNNetworkDebug() const;

// The POCSAG Network section
bool getPOCSAGNetworkEnabled() const;
std::string getPOCSAGGatewayAddress() const;
unsigned int getPOCSAGGatewayPort() const;
std::string getPOCSAGLocalAddress() const;
unsigned int getPOCSAGLocalPort() const;
unsigned int getPOCSAGNetworkModeHang() const;
bool getPOCSAGNetworkDebug() const;

// The TFTSERIAL section
std::string getTFTSerialPort() const;
unsigned int getTFTSerialBrightness() const;
Expand Down Expand Up @@ -295,6 +308,7 @@ class CConf
float m_modemYSFTXLevel;
float m_modemP25TXLevel;
float m_modemNXDNTXLevel;
float m_modemPOCSAGTXLevel;
std::string m_modemRSSIMappingFile;
bool m_modemTrace;
bool m_modemDebug;
Expand Down Expand Up @@ -359,6 +373,8 @@ class CConf
bool m_nxdnRemoteGateway;
unsigned int m_nxdnModeHang;

bool m_pocsagEnabled;

bool m_dstarNetworkEnabled;
std::string m_dstarGatewayAddress;
unsigned int m_dstarGatewayPort;
Expand Down Expand Up @@ -401,6 +417,14 @@ class CConf
unsigned int m_nxdnNetworkModeHang;
bool m_nxdnNetworkDebug;

bool m_pocsagNetworkEnabled;
std::string m_pocsagGatewayAddress;
unsigned int m_pocsagGatewayPort;
std::string m_pocsagLocalAddress;
unsigned int m_pocsagLocalPort;
unsigned int m_pocsagNetworkModeHang;
bool m_pocsagNetworkDebug;

std::string m_tftSerialPort;
unsigned int m_tftSerialBrightness;

Expand Down
1 change: 1 addition & 0 deletions Defines.h
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ const unsigned char MODE_DMR = 2U;
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_CW = 98U;
const unsigned char MODE_LOCKOUT = 99U;
const unsigned char MODE_ERROR = 100U;
Expand Down
13 changes: 13 additions & 0 deletions MMDVM.ini
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,7 @@ RFLevel=100
# YSFTXLevel=50
# P25TXLevel=50
# NXDNTXLevel=50
# POCSAGTXLevel=50
RSSIMappingFile=RSSI.dat
Trace=0
Debug=0
Expand Down Expand Up @@ -127,6 +128,9 @@ SelfOnly=0
RemoteGateway=0
# ModeHang=10

[POCSAG]
Enable=1

[D-Star Network]
Enable=1
GatewayAddress=127.0.0.1
Expand Down Expand Up @@ -174,6 +178,15 @@ GatewayPort=14020
# ModeHang=3
Debug=0

[POCSAG Network]
Enable=1
LocalAddress=127.0.0.1
LocalPort=3800
GatewayAddress=127.0.0.1
GatewayPort=4800
# ModeHang=3
Debug=0

[TFT Serial]
# Port=modem
Port=/dev/ttyAMA0
Expand Down
Loading

0 comments on commit 2a0364a

Please sign in to comment.