Add explicit support for YCS reflectors.
This commit is contained in:
parent
5a44d85c0f
commit
977a344da3
6 changed files with 63 additions and 36 deletions
|
@ -58,7 +58,6 @@ m_power(0U),
|
||||||
m_latitude(0.0F),
|
m_latitude(0.0F),
|
||||||
m_longitude(0.0F),
|
m_longitude(0.0F),
|
||||||
m_height(0),
|
m_height(0),
|
||||||
m_name(),
|
|
||||||
m_description(),
|
m_description(),
|
||||||
m_logDisplayLevel(0U),
|
m_logDisplayLevel(0U),
|
||||||
m_logFileLevel(0U),
|
m_logFileLevel(0U),
|
||||||
|
@ -197,8 +196,6 @@ bool CConf::read()
|
||||||
m_longitude = float(::atof(value));
|
m_longitude = float(::atof(value));
|
||||||
else if (::strcmp(key, "Height") == 0)
|
else if (::strcmp(key, "Height") == 0)
|
||||||
m_height = ::atoi(value);
|
m_height = ::atoi(value);
|
||||||
else if (::strcmp(key, "Name") == 0)
|
|
||||||
m_name = value;
|
|
||||||
else if (::strcmp(key, "Description") == 0)
|
else if (::strcmp(key, "Description") == 0)
|
||||||
m_description = value;
|
m_description = value;
|
||||||
} else if (section == SECTION_LOG) {
|
} else if (section == SECTION_LOG) {
|
||||||
|
@ -374,11 +371,6 @@ int CConf::getHeight() const
|
||||||
return m_height;
|
return m_height;
|
||||||
}
|
}
|
||||||
|
|
||||||
std::string CConf::getName() const
|
|
||||||
{
|
|
||||||
return m_name;
|
|
||||||
}
|
|
||||||
|
|
||||||
std::string CConf::getDescription() const
|
std::string CConf::getDescription() const
|
||||||
{
|
{
|
||||||
return m_description;
|
return m_description;
|
||||||
|
|
|
@ -68,7 +68,6 @@ public:
|
||||||
float getLatitude() const;
|
float getLatitude() const;
|
||||||
float getLongitude() const;
|
float getLongitude() const;
|
||||||
int getHeight() const;
|
int getHeight() const;
|
||||||
std::string getName() const;
|
|
||||||
std::string getDescription() const;
|
std::string getDescription() const;
|
||||||
|
|
||||||
// The Log section
|
// The Log section
|
||||||
|
@ -115,7 +114,6 @@ private:
|
||||||
float m_latitude;
|
float m_latitude;
|
||||||
float m_longitude;
|
float m_longitude;
|
||||||
int m_height;
|
int m_height;
|
||||||
std::string m_name;
|
|
||||||
std::string m_description;
|
std::string m_description;
|
||||||
|
|
||||||
unsigned int m_logDisplayLevel;
|
unsigned int m_logDisplayLevel;
|
||||||
|
|
|
@ -261,12 +261,17 @@ int CDGIdGateway::run()
|
||||||
LogWarning("Unknown YSF reflector: %s", name.c_str());
|
LogWarning("Unknown YSF reflector: %s", name.c_str());
|
||||||
}
|
}
|
||||||
} else if (type == "YCS") {
|
} else if (type == "YCS") {
|
||||||
std::string name = (*it)->m_name;
|
std::string name = (*it)->m_name;
|
||||||
unsigned int local = (*it)->m_local;
|
unsigned int local = (*it)->m_local;
|
||||||
|
unsigned int txFrequency = m_conf.getTxFrequency();
|
||||||
|
unsigned int rxFrequency = m_conf.getRxFrequency();
|
||||||
|
std::string locator = calculateLocator();
|
||||||
|
std::string description = m_conf.getDescription();
|
||||||
|
unsigned int id = m_conf.getId();
|
||||||
|
|
||||||
CYSFReflector* reflector = reflectors->findByName(name);
|
CYSFReflector* reflector = reflectors->findByName(name);
|
||||||
if (reflector != NULL) {
|
if (reflector != NULL) {
|
||||||
dgIdNetwork[dgid] = new CYSFNetwork(local, reflector->m_name, reflector->m_addr, reflector->m_addrLen, m_callsign, (*it)->m_netDGId, debug);
|
dgIdNetwork[dgid] = new CYSFNetwork(local, reflector->m_name, reflector->m_addr, reflector->m_addrLen, m_callsign, rxFrequency, txFrequency, locator, description, id, (*it)->m_netDGId, debug);
|
||||||
dgIdNetwork[dgid]->m_modes = DT_VD_MODE1 | DT_VD_MODE2 | DT_VOICE_FR_MODE | DT_DATA_FR_MODE;
|
dgIdNetwork[dgid]->m_modes = DT_VD_MODE1 | DT_VD_MODE2 | DT_VOICE_FR_MODE | DT_DATA_FR_MODE;
|
||||||
dgIdNetwork[dgid]->m_static = statc;
|
dgIdNetwork[dgid]->m_static = statc;
|
||||||
dgIdNetwork[dgid]->m_rfHangTime = rfHangTime;
|
dgIdNetwork[dgid]->m_rfHangTime = rfHangTime;
|
||||||
|
@ -520,7 +525,7 @@ int CDGIdGateway::run()
|
||||||
state = DS_NOTLINKED;
|
state = DS_NOTLINKED;
|
||||||
currentDGId = 0U;
|
currentDGId = 0U;
|
||||||
inactivityTimer.stop();
|
inactivityTimer.stop();
|
||||||
nPips = 2U;
|
sendPips(2U);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (dgIdNetwork[currentDGId] != NULL) {
|
if (dgIdNetwork[currentDGId] != NULL) {
|
||||||
|
|
|
@ -16,11 +16,10 @@ Daemon=0
|
||||||
RXFrequency=430475000
|
RXFrequency=430475000
|
||||||
TXFrequency=439475000
|
TXFrequency=439475000
|
||||||
Power=1
|
Power=1
|
||||||
Latitude=0.0
|
Latitude=50.9
|
||||||
Longitude=0.0
|
Longitude=-0.5
|
||||||
Height=0
|
Height=0
|
||||||
Name=Nowhere
|
Description=Nowhere
|
||||||
Description=Multi-Mode Repeater
|
|
||||||
|
|
||||||
[Log]
|
[Log]
|
||||||
# Logging levels, 0=No logging
|
# Logging levels, 0=No logging
|
||||||
|
@ -50,7 +49,7 @@ Debug=0
|
||||||
[DGId=1]
|
[DGId=1]
|
||||||
# YSF Local Parrot
|
# YSF Local Parrot
|
||||||
Type=Parrot
|
Type=Parrot
|
||||||
Static=1
|
Static=0
|
||||||
Address=127.0.0.1
|
Address=127.0.0.1
|
||||||
Port=42012
|
Port=42012
|
||||||
Local=42013
|
Local=42013
|
||||||
|
@ -61,7 +60,7 @@ Debug=0
|
||||||
[DGId=10]
|
[DGId=10]
|
||||||
# Local YSF2DMR TG23590
|
# Local YSF2DMR TG23590
|
||||||
Type=YSF2DMR
|
Type=YSF2DMR
|
||||||
Static=1
|
Static=0
|
||||||
Address=127.0.0.1
|
Address=127.0.0.1
|
||||||
Port=42014
|
Port=42014
|
||||||
Local=42015
|
Local=42015
|
||||||
|
@ -72,7 +71,7 @@ Debug=0
|
||||||
[DGId=11]
|
[DGId=11]
|
||||||
# Local YSF2DMR TG23510
|
# Local YSF2DMR TG23510
|
||||||
Type=YSF2DMR
|
Type=YSF2DMR
|
||||||
Static=1
|
Static=0
|
||||||
Address=127.0.0.1
|
Address=127.0.0.1
|
||||||
Port=42016
|
Port=42016
|
||||||
Local=42017
|
Local=42017
|
||||||
|
@ -83,7 +82,7 @@ Debug=0
|
||||||
[DGId=20]
|
[DGId=20]
|
||||||
# Local YSF2NXDN TG65000
|
# Local YSF2NXDN TG65000
|
||||||
Type=YSF2NXDN
|
Type=YSF2NXDN
|
||||||
Static=1
|
Static=0
|
||||||
Address=127.0.0.1
|
Address=127.0.0.1
|
||||||
Port=42018
|
Port=42018
|
||||||
Local=42019
|
Local=42019
|
||||||
|
@ -94,7 +93,7 @@ Debug=0
|
||||||
[DGId=30]
|
[DGId=30]
|
||||||
# Local YSF2P25 TG10200
|
# Local YSF2P25 TG10200
|
||||||
Type=YSF2P25
|
Type=YSF2P25
|
||||||
Static=1
|
Static=0
|
||||||
Address=127.0.0.1
|
Address=127.0.0.1
|
||||||
Port=42020
|
Port=42020
|
||||||
Local=42021
|
Local=42021
|
||||||
|
@ -105,9 +104,9 @@ Debug=0
|
||||||
[DGId=40]
|
[DGId=40]
|
||||||
# YSF Reflector CQ-UK
|
# YSF Reflector CQ-UK
|
||||||
Type=YSF
|
Type=YSF
|
||||||
Static=0
|
Static=1
|
||||||
Name=0-0-CQ-UK-ROOM
|
Name=0-0-CQ-UK-C4FM
|
||||||
Local=42023
|
Local=42022
|
||||||
#RFHangTime=120
|
#RFHangTime=120
|
||||||
#NetHangTime=60
|
#NetHangTime=60
|
||||||
Debug=0
|
Debug=0
|
||||||
|
@ -117,7 +116,7 @@ Debug=0
|
||||||
Type=YSF
|
Type=YSF
|
||||||
Static=0
|
Static=0
|
||||||
Name=Alabama-Link
|
Name=Alabama-Link
|
||||||
Local=42024
|
Local=42023
|
||||||
#RFHangTime=120
|
#RFHangTime=120
|
||||||
#NetHangTime=60
|
#NetHangTime=60
|
||||||
Debug=0
|
Debug=0
|
||||||
|
@ -127,18 +126,18 @@ Debug=0
|
||||||
Type=FCS
|
Type=FCS
|
||||||
Static=0
|
Static=0
|
||||||
Name=FCS00420
|
Name=FCS00420
|
||||||
Local=42001
|
Local=42024
|
||||||
#RFHangTime=120
|
#RFHangTime=120
|
||||||
#NetHangTime=60
|
#NetHangTime=60
|
||||||
Debug=0
|
Debug=0
|
||||||
|
|
||||||
[DGId=55]
|
[DGId=55]
|
||||||
# YCS Reflector YCS310 (DG-ID 2)
|
# YCS Reflector YCS310 (DG-ID 80)
|
||||||
Type=YCS
|
Type=YCS
|
||||||
Static=1
|
Static=1
|
||||||
Name=US-C4FM-NA
|
Name=US-C4FM-NA
|
||||||
Local=42002
|
Local=42025
|
||||||
DGId=2
|
DGId=80
|
||||||
#RFHangTime=120
|
#RFHangTime=120
|
||||||
#NetHangTime=60
|
#NetHangTime=60
|
||||||
Debug=0
|
Debug=0
|
||||||
|
|
|
@ -34,6 +34,7 @@ m_addr(addr),
|
||||||
m_addrLen(addrLen),
|
m_addrLen(addrLen),
|
||||||
m_poll(NULL),
|
m_poll(NULL),
|
||||||
m_options(NULL),
|
m_options(NULL),
|
||||||
|
m_info(NULL),
|
||||||
m_unlink(NULL),
|
m_unlink(NULL),
|
||||||
m_buffer(1000U, "YSF Network Buffer"),
|
m_buffer(1000U, "YSF Network Buffer"),
|
||||||
m_pollTimer(1000U, 5U),
|
m_pollTimer(1000U, 5U),
|
||||||
|
@ -52,6 +53,9 @@ m_dgId(0U)
|
||||||
m_options = new unsigned char[50U];
|
m_options = new unsigned char[50U];
|
||||||
::memcpy(m_options + 0U, "YSFO", 4U);
|
::memcpy(m_options + 0U, "YSFO", 4U);
|
||||||
|
|
||||||
|
m_info = new unsigned char[80U];
|
||||||
|
::memcpy(m_info + 0U, "YSFI", 4U);
|
||||||
|
|
||||||
std::string node = callsign;
|
std::string node = callsign;
|
||||||
node.resize(YSF_CALLSIGN_LENGTH, ' ');
|
node.resize(YSF_CALLSIGN_LENGTH, ' ');
|
||||||
|
|
||||||
|
@ -59,6 +63,7 @@ m_dgId(0U)
|
||||||
m_poll[i + 4U] = node.at(i);
|
m_poll[i + 4U] = node.at(i);
|
||||||
m_unlink[i + 4U] = node.at(i);
|
m_unlink[i + 4U] = node.at(i);
|
||||||
m_options[i + 4U] = node.at(i);
|
m_options[i + 4U] = node.at(i);
|
||||||
|
m_info[i + 4U] = node.at(i);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -69,6 +74,7 @@ m_addr(addr),
|
||||||
m_addrLen(addrLen),
|
m_addrLen(addrLen),
|
||||||
m_poll(NULL),
|
m_poll(NULL),
|
||||||
m_options(NULL),
|
m_options(NULL),
|
||||||
|
m_info(NULL),
|
||||||
m_unlink(NULL),
|
m_unlink(NULL),
|
||||||
m_buffer(1000U, "YSF Network Buffer"),
|
m_buffer(1000U, "YSF Network Buffer"),
|
||||||
m_pollTimer(1000U, 5U),
|
m_pollTimer(1000U, 5U),
|
||||||
|
@ -87,6 +93,9 @@ m_dgId(0U)
|
||||||
m_options = new unsigned char[50U];
|
m_options = new unsigned char[50U];
|
||||||
::memcpy(m_options + 0U, "YSFO", 4U);
|
::memcpy(m_options + 0U, "YSFO", 4U);
|
||||||
|
|
||||||
|
m_info = new unsigned char[80U];
|
||||||
|
::memcpy(m_info + 0U, "YSFI", 4U);
|
||||||
|
|
||||||
std::string node = callsign;
|
std::string node = callsign;
|
||||||
node.resize(YSF_CALLSIGN_LENGTH, ' ');
|
node.resize(YSF_CALLSIGN_LENGTH, ' ');
|
||||||
|
|
||||||
|
@ -94,16 +103,18 @@ m_dgId(0U)
|
||||||
m_poll[i + 4U] = node.at(i);
|
m_poll[i + 4U] = node.at(i);
|
||||||
m_unlink[i + 4U] = node.at(i);
|
m_unlink[i + 4U] = node.at(i);
|
||||||
m_options[i + 4U] = node.at(i);
|
m_options[i + 4U] = node.at(i);
|
||||||
|
m_info[i + 4U] = node.at(i);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
CYSFNetwork::CYSFNetwork(unsigned int localPort, const std::string& name, const sockaddr_storage& addr, unsigned int addrLen, const std::string& callsign, unsigned int dgId, bool debug) :
|
CYSFNetwork::CYSFNetwork(unsigned int localPort, const std::string& name, const sockaddr_storage& addr, unsigned int addrLen, const std::string& callsign, unsigned int rxFrequency, unsigned int txFrequency, const std::string& locator, const std::string& description, unsigned int id, unsigned int dgId, bool debug) :
|
||||||
m_socket(localPort),
|
m_socket(localPort),
|
||||||
m_debug(debug),
|
m_debug(debug),
|
||||||
m_addr(addr),
|
m_addr(addr),
|
||||||
m_addrLen(addrLen),
|
m_addrLen(addrLen),
|
||||||
m_poll(NULL),
|
m_poll(NULL),
|
||||||
m_options(NULL),
|
m_options(NULL),
|
||||||
|
m_info(NULL),
|
||||||
m_unlink(NULL),
|
m_unlink(NULL),
|
||||||
m_buffer(1000U, "YCS Network Buffer"),
|
m_buffer(1000U, "YCS Network Buffer"),
|
||||||
m_pollTimer(1000U, 5U),
|
m_pollTimer(1000U, 5U),
|
||||||
|
@ -122,20 +133,31 @@ m_dgId(dgId)
|
||||||
m_options = new unsigned char[50U];
|
m_options = new unsigned char[50U];
|
||||||
::memcpy(m_options + 0U, "YSFO", 4U);
|
::memcpy(m_options + 0U, "YSFO", 4U);
|
||||||
|
|
||||||
|
m_info = new unsigned char[80U];
|
||||||
|
::memcpy(m_info + 0U, "YSFI", 4U);
|
||||||
|
|
||||||
std::string node = callsign;
|
std::string node = callsign;
|
||||||
node.resize(YSF_CALLSIGN_LENGTH, ' ');
|
node.resize(YSF_CALLSIGN_LENGTH, ' ');
|
||||||
|
|
||||||
for (unsigned int i = 0U; i < YSF_CALLSIGN_LENGTH; i++) {
|
for (unsigned int i = 0U; i < YSF_CALLSIGN_LENGTH; i++) {
|
||||||
m_poll[i + 4U] = node.at(i);
|
m_poll[i + 4U] = node.at(i);
|
||||||
m_unlink[i + 4U] = node.at(i);
|
m_unlink[i + 4U] = node.at(i);
|
||||||
m_options[i + 4U] = node.at(i);
|
m_options[i + 4U] = node.at(i);
|
||||||
|
m_info[i + 4U] = node.at(i);
|
||||||
}
|
}
|
||||||
|
|
||||||
char text[101U];
|
char text[101U];
|
||||||
::sprintf(text, "Options=%u ", dgId);
|
::sprintf(text, "%u ", dgId);
|
||||||
|
|
||||||
for (unsigned int i = 0U; i < (50U - 4U - YSF_CALLSIGN_LENGTH); i++)
|
for (unsigned int i = 0U; i < (50U - 4U - YSF_CALLSIGN_LENGTH); i++)
|
||||||
m_options[i + 4U + YSF_CALLSIGN_LENGTH] = text[i];
|
m_options[i + 4U + YSF_CALLSIGN_LENGTH] = text[i];
|
||||||
|
|
||||||
|
std::string desc = description;
|
||||||
|
desc.resize(20U, ' ');
|
||||||
|
|
||||||
|
sprintf(text, "%9u%9u%.6s%sMMDVM %07u ", rxFrequency, txFrequency, locator.c_str(), desc.c_str(), id);
|
||||||
|
for (unsigned int i = 0U; i < (80U - 4U - YSF_CALLSIGN_LENGTH); i++)
|
||||||
|
m_info[i + 4U + YSF_CALLSIGN_LENGTH] = text[i];
|
||||||
}
|
}
|
||||||
|
|
||||||
CYSFNetwork::~CYSFNetwork()
|
CYSFNetwork::~CYSFNetwork()
|
||||||
|
@ -143,6 +165,7 @@ CYSFNetwork::~CYSFNetwork()
|
||||||
delete[] m_poll;
|
delete[] m_poll;
|
||||||
delete[] m_unlink;
|
delete[] m_unlink;
|
||||||
delete[] m_options;
|
delete[] m_options;
|
||||||
|
delete[] m_info;
|
||||||
}
|
}
|
||||||
|
|
||||||
std::string CYSFNetwork::getDesc(unsigned int dgId)
|
std::string CYSFNetwork::getDesc(unsigned int dgId)
|
||||||
|
@ -223,6 +246,11 @@ void CYSFNetwork::writePoll()
|
||||||
CUtils::dump(1U, "YSF Network Data Sent", m_options, 50U);
|
CUtils::dump(1U, "YSF Network Data Sent", m_options, 50U);
|
||||||
|
|
||||||
m_socket.write(m_options, 50U, m_addr, m_addrLen);
|
m_socket.write(m_options, 50U, m_addr, m_addrLen);
|
||||||
|
|
||||||
|
if (m_debug)
|
||||||
|
CUtils::dump(1U, "YSF Network Data Sent", m_info, 80U);
|
||||||
|
|
||||||
|
m_socket.write(m_info, 80U, m_addr, m_addrLen);
|
||||||
}
|
}
|
||||||
|
|
||||||
m_pollCount++;
|
m_pollCount++;
|
||||||
|
@ -276,6 +304,10 @@ void CYSFNetwork::clock(unsigned int ms)
|
||||||
if (::memcmp(buffer, "YSFO", 4U) == 0)
|
if (::memcmp(buffer, "YSFO", 4U) == 0)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
|
// Throw away any info messages
|
||||||
|
if (::memcmp(buffer, "YSFI", 4U) == 0)
|
||||||
|
return;
|
||||||
|
|
||||||
if (::memcmp(buffer, "YSFP", 4U) == 0 && m_state == DS_LINKING) {
|
if (::memcmp(buffer, "YSFP", 4U) == 0 && m_state == DS_LINKING) {
|
||||||
if (strcmp(m_name.c_str(),"MMDVM")== 0)
|
if (strcmp(m_name.c_str(),"MMDVM")== 0)
|
||||||
LogMessage("Link successful to %s", m_name.c_str());
|
LogMessage("Link successful to %s", m_name.c_str());
|
||||||
|
|
|
@ -31,7 +31,7 @@
|
||||||
class CYSFNetwork : public CDGIdNetwork {
|
class CYSFNetwork : public CDGIdNetwork {
|
||||||
public:
|
public:
|
||||||
CYSFNetwork(const std::string& localAddress, unsigned int localPort, const std::string& name, const sockaddr_storage& addr, unsigned int addrLen, const std::string& callsign, bool debug);
|
CYSFNetwork(const std::string& localAddress, unsigned int localPort, const std::string& name, const sockaddr_storage& addr, unsigned int addrLen, const std::string& callsign, bool debug);
|
||||||
CYSFNetwork(unsigned int localPort, const std::string& name, const sockaddr_storage& addr, unsigned int addrLen, const std::string& callsign, unsigned int dgId, bool debug);
|
CYSFNetwork(unsigned int localPort, const std::string& name, const sockaddr_storage& addr, unsigned int addrLen, const std::string& callsign, unsigned int rxFrequency, unsigned int txFrequency, const std::string& locator, const std::string& description, unsigned int id, unsigned int dgId, bool debug);
|
||||||
CYSFNetwork(unsigned int localPort, const std::string& name, const sockaddr_storage& addr, unsigned int addrLen, const std::string& callsign, bool debug);
|
CYSFNetwork(unsigned int localPort, const std::string& name, const sockaddr_storage& addr, unsigned int addrLen, const std::string& callsign, bool debug);
|
||||||
virtual ~CYSFNetwork();
|
virtual ~CYSFNetwork();
|
||||||
|
|
||||||
|
@ -62,6 +62,7 @@ private:
|
||||||
unsigned int m_addrLen;
|
unsigned int m_addrLen;
|
||||||
unsigned char* m_poll;
|
unsigned char* m_poll;
|
||||||
unsigned char* m_options;
|
unsigned char* m_options;
|
||||||
|
unsigned char* m_info;
|
||||||
unsigned char* m_unlink;
|
unsigned char* m_unlink;
|
||||||
CRingBuffer<unsigned char> m_buffer;
|
CRingBuffer<unsigned char> m_buffer;
|
||||||
CTimer m_pollTimer;
|
CTimer m_pollTimer;
|
||||||
|
|
Loading…
Add table
Reference in a new issue