Add Callsign to USRPClients file, fix NXDN ID bug, update version for xlxapi compat

pull/8/head
Doug McLain 3 years ago
parent f001a2fbbd
commit 0d29254024

@ -15,11 +15,11 @@ Optional software vocoding of AMBE+2(DMR/YSF/NXDN) can be done using md380_vocod
Numerous fixes like late entry recognition from modes like YSF that are otherwise ignored by the original reflector when no header has been received.
The USRP Clients are read from a file defined in Main.h. The format of this file is ipaddr;port; one host per line, ex:
The USRP Clients are read from a file defined in Main.h. The format of this file is ipaddr;port;callsign; one host per line, ex:
```bash
192.168.1.100;32000;
192.168.1.101;32001;
192.168.1.100;32000;CALLSIGN1;
192.168.1.101;32001;CALLSIGN2;
```
The rest of this README is unchanged from the original.

@ -277,7 +277,7 @@ void CCallsign::SetNXDNid(uint16_t nxdnid, bool UpdateCallsign)
m_uiNXDNid = nxdnid;
if ( UpdateCallsign )
{
g_DmridDir.Lock();
g_NXDNidDir.Lock();
{
const CCallsign *callsign = g_NXDNidDir.FindCallsign(nxdnid);
if ( callsign != nullptr )

@ -67,9 +67,9 @@
// version -----------------------------------------------------
#define VERSION_MAJOR 0
#define VERSION_MINOR 0
#define VERSION_REVISION 7
#define VERSION_MAJOR 2
#define VERSION_MINOR 6
#define VERSION_REVISION 0
// global ------------------------------------------------------
@ -171,10 +171,9 @@ enum class EProtocol { any, none, dextra, dplus, dcs, bm, urf, dmrplus, dmrmmdvm
#define USRP_PORT 34001 // UDP port
#define USRP_KEEPALIVE_PERIOD 1 // in seconds
#define USRP_KEEPALIVE_TIMEOUT (USRP_KEEPALIVE_PERIOD*10) // in seconds
#define USRP_AUTOLINK_ENABLE 1 // 1 = enable, 0 = disable auto-link
#define USRP_AUTOLINK_MODULE 'A' // module for client to auto-link to
#define USRP_DEFAULT_CALLSIGN "ALLSTAR"
#define USRPCLIENTS_PATH "/home/pi/USRPClients.txt" // format ip;port; per line for each ALLSTAR/USRP node
#define USRP_CLIENTS_PATH "/home/pi/USRPClients.txt" // format ip;port;callsign; per line for each ALLSTAR/USRP node
#define USRP_AUTOLINK_MODULE 'A'
#ifndef NO_G3
// G3 Terminal

@ -81,7 +81,7 @@ bool CReflector::Start(void)
// init dmrid directory. No need to check the return value.
g_DmridDir.Init();
// init dmrid directory. No need to check the return value.
// init nxdnid directory. No need to check the return value.
g_NXDNidDir.Init();
// init wiresx node directory. Likewise with the return vale.

@ -40,7 +40,6 @@ bool CUSRPProtocol::Initialize(const char *type, const EProtocol ptype, const ui
{
CBuffer buffer;
m_uiStreamId = 0;
CCallsign cs(USRP_DEFAULT_CALLSIGN);
CClients *clients = g_Reflector.GetClients();
std::ifstream file;
std::streampos size;
@ -49,7 +48,7 @@ bool CUSRPProtocol::Initialize(const char *type, const EProtocol ptype, const ui
if (! CProtocol::Initialize(type, ptype, port, has_ipv4, has_ipv6))
return false;
file.open(USRPCLIENTS_PATH, std::ios::in | std::ios::binary | std::ios::ate);
file.open(USRP_CLIENTS_PATH, std::ios::in | std::ios::binary | std::ios::ate);
if ( file.is_open() )
{
// read file
@ -76,19 +75,19 @@ bool CUSRPProtocol::Initialize(const char *type, const EProtocol ptype, const ui
*ptr2 = 0;
char *ip;
char *port;
if ((ip = ::strtok(ptr1, ";")) != nullptr)
{
if ( ((port = ::strtok(nullptr, ";")) != nullptr) )
char *clientcs;
if ( ((ip = ::strtok(ptr1, ";")) != nullptr) &&
((port = ::strtok(nullptr, ";")) != nullptr) &&
((clientcs = ::strtok(nullptr, ";")) != nullptr) )
{
uint32_t ui = atoi(port);
CIp Ip(AF_INET, ui, ip);
CCallsign cs(clientcs);
auto newclient = std::make_shared<CUSRPClient>(cs, Ip);
#if USRP_AUTOLINK_ENABLE
newclient->SetReflectorModule(USRP_AUTOLINK_MODULE);
#endif
clients->AddClient(newclient);
}
}
ptr1 = ptr2+1;
}
}

Loading…
Cancel
Save

Powered by TurnKey Linux.