mirror of
https://github.com/ShaYmez/MMDVM_CM.git
synced 2025-05-24 10:12:27 -04:00
Update YSF2NXDN and YSF2P25 for new YSF code
This commit is contained in:
parent
00606bb544
commit
73f0829136
@ -38,8 +38,6 @@ public:
|
|||||||
std::string getLocalAddress() const;
|
std::string getLocalAddress() const;
|
||||||
unsigned int getLocalPort() const;
|
unsigned int getLocalPort() const;
|
||||||
std::string getFCSFile() const;
|
std::string getFCSFile() const;
|
||||||
bool getDaemon() const;
|
|
||||||
bool getDebug() const;
|
|
||||||
unsigned char getFICHCallSign() const;
|
unsigned char getFICHCallSign() const;
|
||||||
unsigned char getFICHCallMode() const;
|
unsigned char getFICHCallMode() const;
|
||||||
unsigned char getFICHFrameTotal() const;
|
unsigned char getFICHFrameTotal() const;
|
||||||
@ -51,6 +49,8 @@ public:
|
|||||||
unsigned char* getYsfDT1();
|
unsigned char* getYsfDT1();
|
||||||
unsigned char* getYsfDT2();
|
unsigned char* getYsfDT2();
|
||||||
char* getYsfRadioID();
|
char* getYsfRadioID();
|
||||||
|
bool getDaemon() const;
|
||||||
|
bool getDebug() const;
|
||||||
|
|
||||||
// The DMR Network section
|
// The DMR Network section
|
||||||
unsigned int getDMRId() const;
|
unsigned int getDMRId() const;
|
||||||
@ -81,6 +81,17 @@ private:
|
|||||||
std::string m_localAddress;
|
std::string m_localAddress;
|
||||||
unsigned int m_localPort;
|
unsigned int m_localPort;
|
||||||
std::string m_fcsFile;
|
std::string m_fcsFile;
|
||||||
|
unsigned char m_fichCallSign;
|
||||||
|
unsigned char m_fichCallMode;
|
||||||
|
unsigned char m_fichFrameTotal;
|
||||||
|
unsigned char m_fichMessageRoute;
|
||||||
|
unsigned char m_fichVOIP;
|
||||||
|
unsigned char m_fichDataType;
|
||||||
|
unsigned char m_fichSQLType;
|
||||||
|
unsigned char m_fichSQLCode;
|
||||||
|
unsigned char m_ysfDT1[10U];
|
||||||
|
unsigned char m_ysfDT2[10U];
|
||||||
|
char m_ysfRadioID[5];
|
||||||
bool m_daemon;
|
bool m_daemon;
|
||||||
bool m_debug;
|
bool m_debug;
|
||||||
|
|
||||||
@ -101,18 +112,6 @@ private:
|
|||||||
unsigned int m_logFileLevel;
|
unsigned int m_logFileLevel;
|
||||||
std::string m_logFilePath;
|
std::string m_logFilePath;
|
||||||
std::string m_logFileRoot;
|
std::string m_logFileRoot;
|
||||||
|
|
||||||
unsigned char m_fichCallSign;
|
|
||||||
unsigned char m_fichCallMode;
|
|
||||||
unsigned char m_fichFrameTotal;
|
|
||||||
unsigned char m_fichMessageRoute;
|
|
||||||
unsigned char m_fichVOIP;
|
|
||||||
unsigned char m_fichDataType;
|
|
||||||
unsigned char m_fichSQLType;
|
|
||||||
unsigned char m_fichSQLCode;
|
|
||||||
unsigned char m_ysfDT1[10U];
|
|
||||||
unsigned char m_ysfDT2[10U];
|
|
||||||
char m_ysfRadioID[5];
|
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
@ -43,7 +43,6 @@ public:
|
|||||||
bool getRemoteGateway() const;
|
bool getRemoteGateway() const;
|
||||||
unsigned int getHangTime() const;
|
unsigned int getHangTime() const;
|
||||||
bool getWiresXMakeUpper() const;
|
bool getWiresXMakeUpper() const;
|
||||||
bool getDaemon() const;
|
|
||||||
unsigned char getFICHCallSign() const;
|
unsigned char getFICHCallSign() const;
|
||||||
unsigned char getFICHCallMode() const;
|
unsigned char getFICHCallMode() const;
|
||||||
unsigned char getFICHFrameTotal() const;
|
unsigned char getFICHFrameTotal() const;
|
||||||
@ -55,6 +54,7 @@ public:
|
|||||||
unsigned char* getYsfDT1();
|
unsigned char* getYsfDT1();
|
||||||
unsigned char* getYsfDT2();
|
unsigned char* getYsfDT2();
|
||||||
char* getYsfRadioID();
|
char* getYsfRadioID();
|
||||||
|
bool getDaemon() const;
|
||||||
|
|
||||||
// The Info section
|
// The Info section
|
||||||
unsigned int getRxFrequency() const;
|
unsigned int getRxFrequency() const;
|
||||||
@ -120,6 +120,17 @@ private:
|
|||||||
bool m_remoteGateway;
|
bool m_remoteGateway;
|
||||||
unsigned int m_hangTime;
|
unsigned int m_hangTime;
|
||||||
bool m_wiresXMakeUpper;
|
bool m_wiresXMakeUpper;
|
||||||
|
unsigned char m_fichCallSign;
|
||||||
|
unsigned char m_fichCallMode;
|
||||||
|
unsigned char m_fichFrameTotal;
|
||||||
|
unsigned char m_fichMessageRoute;
|
||||||
|
unsigned char m_fichVOIP;
|
||||||
|
unsigned char m_fichDataType;
|
||||||
|
unsigned char m_fichSQLType;
|
||||||
|
unsigned char m_fichSQLCode;
|
||||||
|
unsigned char m_ysfDT1[10U];
|
||||||
|
unsigned char m_ysfDT2[10U];
|
||||||
|
char m_ysfRadioID[5];
|
||||||
bool m_daemon;
|
bool m_daemon;
|
||||||
|
|
||||||
unsigned int m_rxFrequency;
|
unsigned int m_rxFrequency;
|
||||||
@ -168,18 +179,6 @@ private:
|
|||||||
std::string m_aprsAPIKey;
|
std::string m_aprsAPIKey;
|
||||||
unsigned int m_aprsRefresh;
|
unsigned int m_aprsRefresh;
|
||||||
std::string m_aprsDescription;
|
std::string m_aprsDescription;
|
||||||
|
|
||||||
unsigned char m_fichCallSign;
|
|
||||||
unsigned char m_fichCallMode;
|
|
||||||
unsigned char m_fichFrameTotal;
|
|
||||||
unsigned char m_fichMessageRoute;
|
|
||||||
unsigned char m_fichVOIP;
|
|
||||||
unsigned char m_fichDataType;
|
|
||||||
unsigned char m_fichSQLType;
|
|
||||||
unsigned char m_fichSQLCode;
|
|
||||||
unsigned char m_ysfDT1[10U];
|
|
||||||
unsigned char m_ysfDT2[10U];
|
|
||||||
char m_ysfRadioID[5];
|
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
@ -126,6 +126,8 @@ bool CConf::read()
|
|||||||
|
|
||||||
// Remove quotes from the value
|
// Remove quotes from the value
|
||||||
size_t len = ::strlen(value);
|
size_t len = ::strlen(value);
|
||||||
|
char *t;
|
||||||
|
unsigned char tokencnt = 0;
|
||||||
if (len > 1U && *value == '"' && value[len - 1U] == '"') {
|
if (len > 1U && *value == '"' && value[len - 1U] == '"') {
|
||||||
value[len - 1U] = '\0';
|
value[len - 1U] = '\0';
|
||||||
value++;
|
value++;
|
||||||
@ -167,6 +169,40 @@ bool CConf::read()
|
|||||||
m_enableWiresX = ::atoi(value) == 1;
|
m_enableWiresX = ::atoi(value) == 1;
|
||||||
else if (::strcmp(key, "WiresXMakeUpper") == 0)
|
else if (::strcmp(key, "WiresXMakeUpper") == 0)
|
||||||
m_wiresXMakeUpper = ::atoi(value) == 1;
|
m_wiresXMakeUpper = ::atoi(value) == 1;
|
||||||
|
else if (::strcmp(key, "RadioID") == 0)
|
||||||
|
::memcpy(m_ysfRadioID, value, 5);
|
||||||
|
else if (::strcmp(key, "FICHCallsign") == 0)
|
||||||
|
m_fichCallSign = ::atoi(value);
|
||||||
|
else if (::strcmp(key, "FICHCallMode") == 0)
|
||||||
|
m_fichCallMode = ::atoi(value);
|
||||||
|
else if (::strcmp(key, "FICHFrameTotal") == 0)
|
||||||
|
m_fichFrameTotal = ::atoi(value);
|
||||||
|
else if (::strcmp(key, "FICHMessageRoute") == 0)
|
||||||
|
m_fichMessageRoute = ::atoi(value);
|
||||||
|
else if (::strcmp(key, "FICHVOIP") == 0)
|
||||||
|
m_fichVOIP = ::atoi(value);
|
||||||
|
else if (::strcmp(key, "FICHDataType") == 0)
|
||||||
|
m_fichDataType = ::atoi(value);
|
||||||
|
else if (::strcmp(key, "FICHSQLType") == 0)
|
||||||
|
m_fichSQLType = ::atoi(value);
|
||||||
|
else if (::strcmp(key, "FICHSQLCode") == 0)
|
||||||
|
m_fichSQLCode = ::atoi(value);
|
||||||
|
else if (::strcmp(key, "DT1") == 0){
|
||||||
|
tokencnt = 0;
|
||||||
|
while((t = strtok_r(value, ",", &value)) != NULL){
|
||||||
|
if(tokencnt < 10){
|
||||||
|
m_ysfDT1[tokencnt++] = atoi(t);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else if (::strcmp(key, "DT2") == 0){
|
||||||
|
tokencnt = 0;
|
||||||
|
while((t = strtok_r(value, ",", &value)) != NULL){
|
||||||
|
if(tokencnt < 10){
|
||||||
|
m_ysfDT2[tokencnt++] = atoi(t);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
else if (::strcmp(key, "Daemon") == 0)
|
else if (::strcmp(key, "Daemon") == 0)
|
||||||
m_daemon = ::atoi(value) == 1;
|
m_daemon = ::atoi(value) == 1;
|
||||||
} else if (section == SECTION_NXDN_NETWORK) {
|
} else if (section == SECTION_NXDN_NETWORK) {
|
||||||
@ -293,6 +329,61 @@ bool CConf::getWiresXMakeUpper() const
|
|||||||
return m_wiresXMakeUpper;
|
return m_wiresXMakeUpper;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
unsigned char CConf::getFICHCallSign() const
|
||||||
|
{
|
||||||
|
return m_fichCallSign;
|
||||||
|
}
|
||||||
|
|
||||||
|
unsigned char CConf::getFICHCallMode() const
|
||||||
|
{
|
||||||
|
return m_fichCallMode;
|
||||||
|
}
|
||||||
|
|
||||||
|
unsigned char CConf::getFICHFrameTotal() const
|
||||||
|
{
|
||||||
|
return m_fichFrameTotal;
|
||||||
|
}
|
||||||
|
|
||||||
|
unsigned char CConf::getFICHMessageRoute() const
|
||||||
|
{
|
||||||
|
return m_fichMessageRoute;
|
||||||
|
}
|
||||||
|
|
||||||
|
unsigned char CConf::getFICHVOIP() const
|
||||||
|
{
|
||||||
|
return m_fichVOIP;
|
||||||
|
}
|
||||||
|
|
||||||
|
unsigned char CConf::getFICHDataType() const
|
||||||
|
{
|
||||||
|
return m_fichDataType;
|
||||||
|
}
|
||||||
|
|
||||||
|
unsigned char CConf::getFICHSQLType() const
|
||||||
|
{
|
||||||
|
return m_fichSQLType;
|
||||||
|
}
|
||||||
|
|
||||||
|
unsigned char CConf::getFICHSQLCode() const
|
||||||
|
{
|
||||||
|
return m_fichSQLCode;
|
||||||
|
}
|
||||||
|
|
||||||
|
unsigned char* CConf::getYsfDT1()
|
||||||
|
{
|
||||||
|
return m_ysfDT1;
|
||||||
|
}
|
||||||
|
|
||||||
|
unsigned char* CConf::getYsfDT2()
|
||||||
|
{
|
||||||
|
return m_ysfDT2;
|
||||||
|
}
|
||||||
|
|
||||||
|
char* CConf::getYsfRadioID()
|
||||||
|
{
|
||||||
|
return m_ysfRadioID;
|
||||||
|
}
|
||||||
|
|
||||||
bool CConf::getDaemon() const
|
bool CConf::getDaemon() const
|
||||||
{
|
{
|
||||||
return m_daemon;
|
return m_daemon;
|
||||||
|
@ -48,6 +48,17 @@ public:
|
|||||||
unsigned int getLocalPort() const;
|
unsigned int getLocalPort() const;
|
||||||
bool getEnableWiresX() const;
|
bool getEnableWiresX() const;
|
||||||
bool getWiresXMakeUpper() const;
|
bool getWiresXMakeUpper() const;
|
||||||
|
unsigned char getFICHCallSign() const;
|
||||||
|
unsigned char getFICHCallMode() const;
|
||||||
|
unsigned char getFICHFrameTotal() const;
|
||||||
|
unsigned char getFICHMessageRoute() const;
|
||||||
|
unsigned char getFICHVOIP() const;
|
||||||
|
unsigned char getFICHDataType() const;
|
||||||
|
unsigned char getFICHSQLType() const;
|
||||||
|
unsigned char getFICHSQLCode() const;
|
||||||
|
unsigned char* getYsfDT1();
|
||||||
|
unsigned char* getYsfDT2();
|
||||||
|
char* getYsfRadioID();
|
||||||
bool getDaemon() const;
|
bool getDaemon() const;
|
||||||
|
|
||||||
// The NXDN Network section
|
// The NXDN Network section
|
||||||
@ -90,6 +101,17 @@ private:
|
|||||||
unsigned int m_localPort;
|
unsigned int m_localPort;
|
||||||
bool m_enableWiresX;
|
bool m_enableWiresX;
|
||||||
bool m_wiresXMakeUpper;
|
bool m_wiresXMakeUpper;
|
||||||
|
unsigned char m_fichCallSign;
|
||||||
|
unsigned char m_fichCallMode;
|
||||||
|
unsigned char m_fichFrameTotal;
|
||||||
|
unsigned char m_fichMessageRoute;
|
||||||
|
unsigned char m_fichVOIP;
|
||||||
|
unsigned char m_fichDataType;
|
||||||
|
unsigned char m_fichSQLType;
|
||||||
|
unsigned char m_fichSQLCode;
|
||||||
|
unsigned char m_ysfDT1[10U];
|
||||||
|
unsigned char m_ysfDT2[10U];
|
||||||
|
char m_ysfRadioID[5];
|
||||||
bool m_daemon;
|
bool m_daemon;
|
||||||
|
|
||||||
unsigned int m_rxFrequency;
|
unsigned int m_rxFrequency;
|
||||||
|
@ -20,6 +20,6 @@
|
|||||||
#if !defined(VERSION_H)
|
#if !defined(VERSION_H)
|
||||||
#define VERSION_H
|
#define VERSION_H
|
||||||
|
|
||||||
const char* VERSION = "20200503";
|
const char* VERSION = "20200605";
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
@ -33,7 +33,6 @@
|
|||||||
// DT1 and DT2, suggested by Manuel EA7EE
|
// DT1 and DT2, suggested by Manuel EA7EE
|
||||||
const unsigned char dt1_temp[] = {0x31, 0x22, 0x62, 0x5F, 0x29, 0x00, 0x00, 0x00, 0x00, 0x00};
|
const unsigned char dt1_temp[] = {0x31, 0x22, 0x62, 0x5F, 0x29, 0x00, 0x00, 0x00, 0x00, 0x00};
|
||||||
const unsigned char dt2_temp[] = {0x00, 0x00, 0x00, 0x00, 0x6C, 0x20, 0x1C, 0x20, 0x03, 0x08};
|
const unsigned char dt2_temp[] = {0x00, 0x00, 0x00, 0x00, 0x6C, 0x20, 0x1C, 0x20, 0x03, 0x08};
|
||||||
const uint8_t dt1[10] = {0x01, 0x22, 0x61, 0x5f, 0x2b, 0x03, 0x11, 0x00, 0x00, 0x00};
|
|
||||||
|
|
||||||
#define NXDN_FRAME_PER 75U
|
#define NXDN_FRAME_PER 75U
|
||||||
#define YSF_FRAME_PER 90U
|
#define YSF_FRAME_PER 90U
|
||||||
@ -48,7 +47,6 @@ const char* HEADER1 = "This software is for use on amateur radio networks only,"
|
|||||||
const char* HEADER2 = "it is to be used for educational purposes only. Its use on";
|
const char* HEADER2 = "it is to be used for educational purposes only. Its use on";
|
||||||
const char* HEADER3 = "commercial networks is strictly prohibited.";
|
const char* HEADER3 = "commercial networks is strictly prohibited.";
|
||||||
const char* HEADER4 = "Copyright(C) 2018,2019 by CA6JAU, G4KLX and others";
|
const char* HEADER4 = "Copyright(C) 2018,2019 by CA6JAU, G4KLX and others";
|
||||||
const char ysf_radioid[] = {'H', '5', '0', '0', '0'};
|
|
||||||
|
|
||||||
#include <functional>
|
#include <functional>
|
||||||
#include <algorithm>
|
#include <algorithm>
|
||||||
@ -606,24 +604,23 @@ int CYSF2NXDN::run()
|
|||||||
// Set the FICH
|
// Set the FICH
|
||||||
CYSFFICH fich;
|
CYSFFICH fich;
|
||||||
fich.setFI(YSF_FI_HEADER);
|
fich.setFI(YSF_FI_HEADER);
|
||||||
fich.setCS(2U);
|
fich.setCS(m_conf.getFICHCallSign());
|
||||||
fich.setCM(1U);
|
fich.setCM(m_conf.getFICHCallMode());
|
||||||
fich.setBN(0U);
|
fich.setBN(0U);
|
||||||
fich.setBT(0U);
|
fich.setBT(0U);
|
||||||
fich.setFN(0U);
|
fich.setFN(0U);
|
||||||
fich.setFT(6U);
|
fich.setFT(m_conf.getFICHFrameTotal());
|
||||||
fich.setDev(0U);
|
fich.setDev(0U);
|
||||||
fich.setMR(0U);
|
fich.setMR(m_conf.getFICHMessageRoute());
|
||||||
fich.setVoIP(false);
|
fich.setVoIP(m_conf.getFICHVOIP());
|
||||||
fich.setDT(YSF_DT_VD_MODE2);
|
fich.setDT(m_conf.getFICHDataType());
|
||||||
fich.setSQL(0U);
|
fich.setSQL(m_conf.getFICHSQLType());
|
||||||
fich.setSQ(0U);
|
fich.setSQ(m_conf.getFICHSQLCode());
|
||||||
fich.encode(m_ysfFrame + 35U);
|
fich.encode(m_ysfFrame + 35U);
|
||||||
|
|
||||||
unsigned char csd1[20U], csd2[20U];
|
unsigned char csd1[20U], csd2[20U];
|
||||||
memset(csd1, '*', YSF_CALLSIGN_LENGTH/2);
|
memset(csd1, '*', YSF_CALLSIGN_LENGTH/2);
|
||||||
memcpy(csd1 + YSF_CALLSIGN_LENGTH/2, ysf_radioid, YSF_CALLSIGN_LENGTH/2);
|
memcpy(csd1 + YSF_CALLSIGN_LENGTH/2, m_conf.getYsfRadioID(), YSF_CALLSIGN_LENGTH/2);
|
||||||
//memset(csd1, '*', YSF_CALLSIGN_LENGTH);
|
|
||||||
memcpy(csd1 + YSF_CALLSIGN_LENGTH, m_netSrc.c_str(), YSF_CALLSIGN_LENGTH);
|
memcpy(csd1 + YSF_CALLSIGN_LENGTH, m_netSrc.c_str(), YSF_CALLSIGN_LENGTH);
|
||||||
memset(csd2, ' ', YSF_CALLSIGN_LENGTH + YSF_CALLSIGN_LENGTH);
|
memset(csd2, ' ', YSF_CALLSIGN_LENGTH + YSF_CALLSIGN_LENGTH);
|
||||||
|
|
||||||
@ -646,25 +643,24 @@ int CYSF2NXDN::run()
|
|||||||
|
|
||||||
// Set the FICH
|
// Set the FICH
|
||||||
CYSFFICH fich;
|
CYSFFICH fich;
|
||||||
fich.setFI(YSF_FI_TERMINATOR);
|
fich.setFI(YSF_FI_HEADER);
|
||||||
fich.setCS(2U);
|
fich.setCS(m_conf.getFICHCallSign());
|
||||||
fich.setCM(1U);
|
fich.setCM(m_conf.getFICHCallMode());
|
||||||
fich.setBN(0U);
|
fich.setBN(0U);
|
||||||
fich.setBT(0U);
|
fich.setBT(0U);
|
||||||
fich.setFN(0U);
|
fich.setFN(0U);
|
||||||
fich.setFT(6U);
|
fich.setFT(m_conf.getFICHFrameTotal());
|
||||||
fich.setDev(0U);
|
fich.setDev(0U);
|
||||||
fich.setMR(0U);
|
fich.setMR(m_conf.getFICHMessageRoute());
|
||||||
fich.setVoIP(false);
|
fich.setVoIP(m_conf.getFICHVOIP());
|
||||||
fich.setDT(YSF_DT_VD_MODE2);
|
fich.setDT(m_conf.getFICHDataType());
|
||||||
fich.setSQL(0U);
|
fich.setSQL(m_conf.getFICHSQLType());
|
||||||
fich.setSQ(0U);
|
fich.setSQ(m_conf.getFICHSQLCode());
|
||||||
fich.encode(m_ysfFrame + 35U);
|
fich.encode(m_ysfFrame + 35U);
|
||||||
|
|
||||||
unsigned char csd1[20U], csd2[20U];
|
unsigned char csd1[20U], csd2[20U];
|
||||||
memset(csd1, '*', YSF_CALLSIGN_LENGTH/2);
|
memset(csd1, '*', YSF_CALLSIGN_LENGTH/2);
|
||||||
memcpy(csd1 + YSF_CALLSIGN_LENGTH/2, ysf_radioid, YSF_CALLSIGN_LENGTH/2);
|
memcpy(csd1 + YSF_CALLSIGN_LENGTH/2, m_conf.getYsfRadioID(), YSF_CALLSIGN_LENGTH/2);
|
||||||
//memset(csd1, '*', YSF_CALLSIGN_LENGTH);
|
|
||||||
memcpy(csd1 + YSF_CALLSIGN_LENGTH, m_netSrc.c_str(), YSF_CALLSIGN_LENGTH);
|
memcpy(csd1 + YSF_CALLSIGN_LENGTH, m_netSrc.c_str(), YSF_CALLSIGN_LENGTH);
|
||||||
memset(csd2, ' ', YSF_CALLSIGN_LENGTH + YSF_CALLSIGN_LENGTH);
|
memset(csd2, ' ', YSF_CALLSIGN_LENGTH + YSF_CALLSIGN_LENGTH);
|
||||||
|
|
||||||
@ -691,9 +687,8 @@ int CYSF2NXDN::run()
|
|||||||
switch (fn) {
|
switch (fn) {
|
||||||
case 0:
|
case 0:
|
||||||
memset(dch, '*', YSF_CALLSIGN_LENGTH/2);
|
memset(dch, '*', YSF_CALLSIGN_LENGTH/2);
|
||||||
memcpy(dch + YSF_CALLSIGN_LENGTH/2, ysf_radioid, YSF_CALLSIGN_LENGTH/2);
|
memcpy(dch + YSF_CALLSIGN_LENGTH/2, m_conf.getYsfRadioID(), YSF_CALLSIGN_LENGTH/2);
|
||||||
ysfPayload.writeVDMode2Data(m_ysfFrame + 35U, dch);
|
ysfPayload.writeVDMode2Data(m_ysfFrame + 35U, dch);
|
||||||
//ysfPayload.writeVDMode2Data(m_ysfFrame + 35U, (const unsigned char*)"**********");
|
|
||||||
break;
|
break;
|
||||||
case 1:
|
case 1:
|
||||||
ysfPayload.writeVDMode2Data(m_ysfFrame + 35U, (const unsigned char*)m_netSrc.c_str());
|
ysfPayload.writeVDMode2Data(m_ysfFrame + 35U, (const unsigned char*)m_netSrc.c_str());
|
||||||
@ -703,14 +698,14 @@ int CYSF2NXDN::run()
|
|||||||
break;
|
break;
|
||||||
case 5:
|
case 5:
|
||||||
memset(dch, ' ', YSF_CALLSIGN_LENGTH/2);
|
memset(dch, ' ', YSF_CALLSIGN_LENGTH/2);
|
||||||
memcpy(dch + YSF_CALLSIGN_LENGTH/2, ysf_radioid, YSF_CALLSIGN_LENGTH/2);
|
memcpy(dch + YSF_CALLSIGN_LENGTH/2, m_conf.getYsfRadioID(), YSF_CALLSIGN_LENGTH/2);
|
||||||
ysfPayload.writeVDMode2Data(m_ysfFrame + 35U, dch); // Rem3/4
|
ysfPayload.writeVDMode2Data(m_ysfFrame + 35U, dch); // Rem3/4
|
||||||
break;
|
break;
|
||||||
case 6:
|
case 6:
|
||||||
ysfPayload.writeVDMode2Data(m_ysfFrame + 35U, dt1);
|
ysfPayload.writeVDMode2Data(m_ysfFrame + 35U, m_conf.getYsfDT1());
|
||||||
break;
|
break;
|
||||||
case 7:
|
case 7:
|
||||||
ysfPayload.writeVDMode2Data(m_ysfFrame + 35U, dt2_temp);
|
ysfPayload.writeVDMode2Data(m_ysfFrame + 35U, m_conf.getYsfDT2());
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
ysfPayload.writeVDMode2Data(m_ysfFrame + 35U, (const unsigned char*)" ");
|
ysfPayload.writeVDMode2Data(m_ysfFrame + 35U, (const unsigned char*)" ");
|
||||||
@ -718,18 +713,18 @@ int CYSF2NXDN::run()
|
|||||||
|
|
||||||
// Set the FICH
|
// Set the FICH
|
||||||
fich.setFI(YSF_FI_COMMUNICATIONS);
|
fich.setFI(YSF_FI_COMMUNICATIONS);
|
||||||
fich.setCS(2U);
|
fich.setCS(m_conf.getFICHCallSign());
|
||||||
fich.setCM(1U);
|
fich.setCM(m_conf.getFICHCallMode());
|
||||||
fich.setBN(0U);
|
fich.setBN(0U);
|
||||||
fich.setBT(0U);
|
fich.setBT(0U);
|
||||||
fich.setFN(fn);
|
fich.setFN(fn);
|
||||||
fich.setFT(6U);
|
fich.setFT(m_conf.getFICHFrameTotal());
|
||||||
fich.setDev(0U);
|
fich.setDev(0U);
|
||||||
fich.setMR(0U);
|
fich.setMR(m_conf.getFICHMessageRoute());
|
||||||
fich.setVoIP(false);
|
fich.setVoIP(m_conf.getFICHVOIP());
|
||||||
fich.setDT(YSF_DT_VD_MODE2);
|
fich.setDT(m_conf.getFICHDataType());
|
||||||
fich.setSQL(0U);
|
fich.setSQL(m_conf.getFICHSQLType());
|
||||||
fich.setSQ(0U);
|
fich.setSQ(m_conf.getFICHSQLCode());
|
||||||
fich.encode(m_ysfFrame + 35U);
|
fich.encode(m_ysfFrame + 35U);
|
||||||
|
|
||||||
// Net frame counter
|
// Net frame counter
|
||||||
|
@ -16,6 +16,18 @@ LocalAddress=127.0.0.1
|
|||||||
LocalPort=42014
|
LocalPort=42014
|
||||||
EnableWiresX=1
|
EnableWiresX=1
|
||||||
WiresXMakeUpper=1
|
WiresXMakeUpper=1
|
||||||
|
RadioID=*****
|
||||||
|
FICHCallsign=2
|
||||||
|
FICHCallMode=0
|
||||||
|
FICHBlockTotal=0
|
||||||
|
FICHFrameTotal=7
|
||||||
|
FICHMessageRoute=0
|
||||||
|
FICHVOIP=0
|
||||||
|
FICHDataType=2
|
||||||
|
FICHSQLType=0
|
||||||
|
FICHSQLCode=0
|
||||||
|
DT1=49,34,98,95,41,0,0,0,0,0
|
||||||
|
DT2=0,0,0,0,108,32,28,32,3,8
|
||||||
Daemon=0
|
Daemon=0
|
||||||
|
|
||||||
[NXDN Network]
|
[NXDN Network]
|
||||||
|
@ -114,6 +114,8 @@ bool CConf::read()
|
|||||||
|
|
||||||
// Remove quotes from the value
|
// Remove quotes from the value
|
||||||
size_t len = ::strlen(value);
|
size_t len = ::strlen(value);
|
||||||
|
char *t;
|
||||||
|
unsigned char tokencnt = 0;
|
||||||
if (len > 1U && *value == '"' && value[len - 1U] == '"') {
|
if (len > 1U && *value == '"' && value[len - 1U] == '"') {
|
||||||
value[len - 1U] = '\0';
|
value[len - 1U] = '\0';
|
||||||
value++;
|
value++;
|
||||||
@ -149,6 +151,40 @@ bool CConf::read()
|
|||||||
m_enableWiresX = ::atoi(value) == 1;
|
m_enableWiresX = ::atoi(value) == 1;
|
||||||
else if (::strcmp(key, "WiresXMakeUpper") == 0)
|
else if (::strcmp(key, "WiresXMakeUpper") == 0)
|
||||||
m_wiresXMakeUpper = ::atoi(value) == 1;
|
m_wiresXMakeUpper = ::atoi(value) == 1;
|
||||||
|
else if (::strcmp(key, "RadioID") == 0)
|
||||||
|
::memcpy(m_ysfRadioID, value, 5);
|
||||||
|
else if (::strcmp(key, "FICHCallsign") == 0)
|
||||||
|
m_fichCallSign = ::atoi(value);
|
||||||
|
else if (::strcmp(key, "FICHCallMode") == 0)
|
||||||
|
m_fichCallMode = ::atoi(value);
|
||||||
|
else if (::strcmp(key, "FICHFrameTotal") == 0)
|
||||||
|
m_fichFrameTotal = ::atoi(value);
|
||||||
|
else if (::strcmp(key, "FICHMessageRoute") == 0)
|
||||||
|
m_fichMessageRoute = ::atoi(value);
|
||||||
|
else if (::strcmp(key, "FICHVOIP") == 0)
|
||||||
|
m_fichVOIP = ::atoi(value);
|
||||||
|
else if (::strcmp(key, "FICHDataType") == 0)
|
||||||
|
m_fichDataType = ::atoi(value);
|
||||||
|
else if (::strcmp(key, "FICHSQLType") == 0)
|
||||||
|
m_fichSQLType = ::atoi(value);
|
||||||
|
else if (::strcmp(key, "FICHSQLCode") == 0)
|
||||||
|
m_fichSQLCode = ::atoi(value);
|
||||||
|
else if (::strcmp(key, "DT1") == 0){
|
||||||
|
tokencnt = 0;
|
||||||
|
while((t = strtok_r(value, ",", &value)) != NULL){
|
||||||
|
if(tokencnt < 10){
|
||||||
|
m_ysfDT1[tokencnt++] = atoi(t);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else if (::strcmp(key, "DT2") == 0){
|
||||||
|
tokencnt = 0;
|
||||||
|
while((t = strtok_r(value, ",", &value)) != NULL){
|
||||||
|
if(tokencnt < 10){
|
||||||
|
m_ysfDT2[tokencnt++] = atoi(t);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
else if (::strcmp(key, "Daemon") == 0)
|
else if (::strcmp(key, "Daemon") == 0)
|
||||||
m_daemon = ::atoi(value) == 1;
|
m_daemon = ::atoi(value) == 1;
|
||||||
else if (::strcmp(key, "Debug") == 0)
|
else if (::strcmp(key, "Debug") == 0)
|
||||||
@ -247,6 +283,61 @@ bool CConf::getWiresXMakeUpper() const
|
|||||||
return m_wiresXMakeUpper;
|
return m_wiresXMakeUpper;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
unsigned char CConf::getFICHCallSign() const
|
||||||
|
{
|
||||||
|
return m_fichCallSign;
|
||||||
|
}
|
||||||
|
|
||||||
|
unsigned char CConf::getFICHCallMode() const
|
||||||
|
{
|
||||||
|
return m_fichCallMode;
|
||||||
|
}
|
||||||
|
|
||||||
|
unsigned char CConf::getFICHFrameTotal() const
|
||||||
|
{
|
||||||
|
return m_fichFrameTotal;
|
||||||
|
}
|
||||||
|
|
||||||
|
unsigned char CConf::getFICHMessageRoute() const
|
||||||
|
{
|
||||||
|
return m_fichMessageRoute;
|
||||||
|
}
|
||||||
|
|
||||||
|
unsigned char CConf::getFICHVOIP() const
|
||||||
|
{
|
||||||
|
return m_fichVOIP;
|
||||||
|
}
|
||||||
|
|
||||||
|
unsigned char CConf::getFICHDataType() const
|
||||||
|
{
|
||||||
|
return m_fichDataType;
|
||||||
|
}
|
||||||
|
|
||||||
|
unsigned char CConf::getFICHSQLType() const
|
||||||
|
{
|
||||||
|
return m_fichSQLType;
|
||||||
|
}
|
||||||
|
|
||||||
|
unsigned char CConf::getFICHSQLCode() const
|
||||||
|
{
|
||||||
|
return m_fichSQLCode;
|
||||||
|
}
|
||||||
|
|
||||||
|
unsigned char* CConf::getYsfDT1()
|
||||||
|
{
|
||||||
|
return m_ysfDT1;
|
||||||
|
}
|
||||||
|
|
||||||
|
unsigned char* CConf::getYsfDT2()
|
||||||
|
{
|
||||||
|
return m_ysfDT2;
|
||||||
|
}
|
||||||
|
|
||||||
|
char* CConf::getYsfRadioID()
|
||||||
|
{
|
||||||
|
return m_ysfRadioID;
|
||||||
|
}
|
||||||
|
|
||||||
bool CConf::getDaemon() const
|
bool CConf::getDaemon() const
|
||||||
{
|
{
|
||||||
return m_daemon;
|
return m_daemon;
|
||||||
|
@ -45,6 +45,17 @@ public:
|
|||||||
unsigned int getLocalPort() const;
|
unsigned int getLocalPort() const;
|
||||||
bool getEnableWiresX() const;
|
bool getEnableWiresX() const;
|
||||||
bool getWiresXMakeUpper() const;
|
bool getWiresXMakeUpper() const;
|
||||||
|
unsigned char getFICHCallSign() const;
|
||||||
|
unsigned char getFICHCallMode() const;
|
||||||
|
unsigned char getFICHFrameTotal() const;
|
||||||
|
unsigned char getFICHMessageRoute() const;
|
||||||
|
unsigned char getFICHVOIP() const;
|
||||||
|
unsigned char getFICHDataType() const;
|
||||||
|
unsigned char getFICHSQLType() const;
|
||||||
|
unsigned char getFICHSQLCode() const;
|
||||||
|
unsigned char* getYsfDT1();
|
||||||
|
unsigned char* getYsfDT2();
|
||||||
|
char* getYsfRadioID();
|
||||||
bool getDaemon() const;
|
bool getDaemon() const;
|
||||||
bool getNetworkDebug() const;
|
bool getNetworkDebug() const;
|
||||||
|
|
||||||
@ -78,6 +89,17 @@ private:
|
|||||||
unsigned int m_localPort;
|
unsigned int m_localPort;
|
||||||
bool m_enableWiresX;
|
bool m_enableWiresX;
|
||||||
bool m_wiresXMakeUpper;
|
bool m_wiresXMakeUpper;
|
||||||
|
unsigned char m_fichCallSign;
|
||||||
|
unsigned char m_fichCallMode;
|
||||||
|
unsigned char m_fichFrameTotal;
|
||||||
|
unsigned char m_fichMessageRoute;
|
||||||
|
unsigned char m_fichVOIP;
|
||||||
|
unsigned char m_fichDataType;
|
||||||
|
unsigned char m_fichSQLType;
|
||||||
|
unsigned char m_fichSQLCode;
|
||||||
|
unsigned char m_ysfDT1[10];
|
||||||
|
unsigned char m_ysfDT2[10];
|
||||||
|
char m_ysfRadioID[5];
|
||||||
bool m_daemon;
|
bool m_daemon;
|
||||||
bool m_networkDebug;
|
bool m_networkDebug;
|
||||||
|
|
||||||
|
@ -20,6 +20,6 @@
|
|||||||
#if !defined(VERSION_H)
|
#if !defined(VERSION_H)
|
||||||
#define VERSION_H
|
#define VERSION_H
|
||||||
|
|
||||||
const char* VERSION = "20200503";
|
const char* VERSION = "20200605";
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
@ -92,8 +92,6 @@ const unsigned char REC73[] = {
|
|||||||
const unsigned char REC80[] = {
|
const unsigned char REC80[] = {
|
||||||
0x80U, 0x00U, 0x00U, 0x00U, 0x00U, 0x00U, 0x00U, 0x00U, 0x00U, 0x00U, 0x00U, 0x00U, 0x00U, 0x00U, 0x00U, 0x00U, 0x00U};
|
0x80U, 0x00U, 0x00U, 0x00U, 0x00U, 0x00U, 0x00U, 0x00U, 0x00U, 0x00U, 0x00U, 0x00U, 0x00U, 0x00U, 0x00U, 0x00U, 0x00U};
|
||||||
|
|
||||||
const uint8_t dt1[10] = {0x01, 0x22, 0x61, 0x5f, 0x2b, 0x03, 0x11, 0x00, 0x00, 0x00};
|
|
||||||
|
|
||||||
#define P25_FRAME_PER 15U
|
#define P25_FRAME_PER 15U
|
||||||
#define YSF_FRAME_PER 90U
|
#define YSF_FRAME_PER 90U
|
||||||
|
|
||||||
@ -107,7 +105,6 @@ const char* HEADER1 = "This software is for use on amateur radio networks only,"
|
|||||||
const char* HEADER2 = "it is to be used for educational purposes only. Its use on";
|
const char* HEADER2 = "it is to be used for educational purposes only. Its use on";
|
||||||
const char* HEADER3 = "commercial networks is strictly prohibited.";
|
const char* HEADER3 = "commercial networks is strictly prohibited.";
|
||||||
const char* HEADER4 = "Copyright(C) 2018,2019 by CA6JAU, G4KLX and others";
|
const char* HEADER4 = "Copyright(C) 2018,2019 by CA6JAU, G4KLX and others";
|
||||||
const char ysf_radioid[] = {'H', '5', '0', '0', '0'};
|
|
||||||
|
|
||||||
#include <functional>
|
#include <functional>
|
||||||
#include <algorithm>
|
#include <algorithm>
|
||||||
@ -623,23 +620,23 @@ int CYSF2P25::run()
|
|||||||
// Set the FICH
|
// Set the FICH
|
||||||
CYSFFICH fich;
|
CYSFFICH fich;
|
||||||
fich.setFI(YSF_FI_HEADER);
|
fich.setFI(YSF_FI_HEADER);
|
||||||
fich.setCS(2U);
|
fich.setCS(m_conf.getFICHCallSign());
|
||||||
fich.setCM(1U);
|
fich.setCM(m_conf.getFICHCallMode());
|
||||||
fich.setBN(0U);
|
fich.setBN(0U);
|
||||||
fich.setBT(0U);
|
fich.setBT(0U);
|
||||||
fich.setFN(0U);
|
fich.setFN(0U);
|
||||||
fich.setFT(6U);
|
fich.setFT(m_conf.getFICHFrameTotal());
|
||||||
fich.setDev(0U);
|
fich.setDev(0U);
|
||||||
fich.setMR(0U);
|
fich.setMR(m_conf.getFICHMessageRoute());
|
||||||
fich.setVoIP(false);
|
fich.setVoIP(m_conf.getFICHVOIP());
|
||||||
fich.setDT(YSF_DT_VOICE_FR_MODE);
|
fich.setDT(m_conf.getFICHDataType());
|
||||||
fich.setSQL(0U);
|
fich.setSQL(m_conf.getFICHSQLType());
|
||||||
fich.setSQ(0U);
|
fich.setSQ(m_conf.getFICHSQLCode());
|
||||||
fich.encode(m_ysfFrame + 35U);
|
fich.encode(m_ysfFrame + 35U);
|
||||||
|
|
||||||
unsigned char csd1[20U], csd2[20U];
|
unsigned char csd1[20U], csd2[20U];
|
||||||
memset(csd1, '*', YSF_CALLSIGN_LENGTH/2);
|
memset(csd1, '*', YSF_CALLSIGN_LENGTH/2);
|
||||||
memcpy(csd1 + YSF_CALLSIGN_LENGTH/2, ysf_radioid, YSF_CALLSIGN_LENGTH/2);
|
memcpy(csd1 + YSF_CALLSIGN_LENGTH/2, m_conf.getYsfRadioID(), YSF_CALLSIGN_LENGTH/2);
|
||||||
memcpy(csd1 + YSF_CALLSIGN_LENGTH, m_netSrc.c_str(), YSF_CALLSIGN_LENGTH);
|
memcpy(csd1 + YSF_CALLSIGN_LENGTH, m_netSrc.c_str(), YSF_CALLSIGN_LENGTH);
|
||||||
memset(csd2, ' ', YSF_CALLSIGN_LENGTH + YSF_CALLSIGN_LENGTH);
|
memset(csd2, ' ', YSF_CALLSIGN_LENGTH + YSF_CALLSIGN_LENGTH);
|
||||||
|
|
||||||
@ -663,23 +660,23 @@ int CYSF2P25::run()
|
|||||||
// Set the FICH
|
// Set the FICH
|
||||||
CYSFFICH fich;
|
CYSFFICH fich;
|
||||||
fich.setFI(YSF_FI_TERMINATOR);
|
fich.setFI(YSF_FI_TERMINATOR);
|
||||||
fich.setCS(2U);
|
fich.setCS(m_conf.getFICHCallSign());
|
||||||
fich.setCM(1U);
|
fich.setCM(m_conf.getFICHCallMode());
|
||||||
fich.setBN(0U);
|
fich.setBN(0U);
|
||||||
fich.setBT(0U);
|
fich.setBT(0U);
|
||||||
fich.setFN(0U);
|
fich.setFN(0U);
|
||||||
fich.setFT(6U);
|
fich.setFT(m_conf.getFICHFrameTotal());
|
||||||
fich.setDev(0U);
|
fich.setDev(0U);
|
||||||
fich.setMR(0U);
|
fich.setMR(m_conf.getFICHMessageRoute());
|
||||||
fich.setVoIP(false);
|
fich.setVoIP(m_conf.getFICHVOIP());
|
||||||
fich.setDT(YSF_DT_VOICE_FR_MODE);
|
fich.setDT(m_conf.getFICHDataType());
|
||||||
fich.setSQL(0U);
|
fich.setSQL(m_conf.getFICHSQLType());
|
||||||
fich.setSQ(0U);
|
fich.setSQ(m_conf.getFICHSQLCode());
|
||||||
fich.encode(m_ysfFrame + 35U);
|
fich.encode(m_ysfFrame + 35U);
|
||||||
|
|
||||||
unsigned char csd1[20U], csd2[20U];
|
unsigned char csd1[20U], csd2[20U];
|
||||||
memset(csd1, '*', YSF_CALLSIGN_LENGTH/2);
|
memset(csd1, '*', YSF_CALLSIGN_LENGTH/2);
|
||||||
memcpy(csd1 + YSF_CALLSIGN_LENGTH/2, ysf_radioid, YSF_CALLSIGN_LENGTH/2);
|
memcpy(csd1 + YSF_CALLSIGN_LENGTH/2, m_conf.getYsfRadioID(), YSF_CALLSIGN_LENGTH/2);
|
||||||
memcpy(csd1 + YSF_CALLSIGN_LENGTH, m_netSrc.c_str(), YSF_CALLSIGN_LENGTH);
|
memcpy(csd1 + YSF_CALLSIGN_LENGTH, m_netSrc.c_str(), YSF_CALLSIGN_LENGTH);
|
||||||
memset(csd2, ' ', YSF_CALLSIGN_LENGTH + YSF_CALLSIGN_LENGTH);
|
memset(csd2, ' ', YSF_CALLSIGN_LENGTH + YSF_CALLSIGN_LENGTH);
|
||||||
|
|
||||||
@ -705,18 +702,18 @@ int CYSF2P25::run()
|
|||||||
|
|
||||||
// Set the FICH
|
// Set the FICH
|
||||||
fich.setFI(YSF_FI_COMMUNICATIONS);
|
fich.setFI(YSF_FI_COMMUNICATIONS);
|
||||||
fich.setCS(2U);
|
fich.setCS(m_conf.getFICHCallSign());
|
||||||
fich.setCM(1U);
|
fich.setCM(m_conf.getFICHCallMode());
|
||||||
fich.setBN(0U);
|
fich.setBN(0U);
|
||||||
fich.setBT(0U);
|
fich.setBT(0U);
|
||||||
fich.setFN(fn);
|
fich.setFN(fn);
|
||||||
fich.setFT(6U);
|
fich.setFT(m_conf.getFICHFrameTotal());
|
||||||
fich.setDev(0U);
|
fich.setDev(0U);
|
||||||
fich.setMR(0U);
|
fich.setMR(m_conf.getFICHMessageRoute());
|
||||||
fich.setVoIP(false);
|
fich.setVoIP(m_conf.getFICHVOIP());
|
||||||
fich.setDT(YSF_DT_VOICE_FR_MODE);
|
fich.setDT(m_conf.getFICHDataType());
|
||||||
fich.setSQL(0U);
|
fich.setSQL(m_conf.getFICHSQLType());
|
||||||
fich.setSQ(0U);
|
fich.setSQ(m_conf.getFICHSQLCode());
|
||||||
fich.encode(m_ysfFrame + 35U);
|
fich.encode(m_ysfFrame + 35U);
|
||||||
|
|
||||||
// Net frame counter
|
// Net frame counter
|
||||||
|
@ -13,6 +13,18 @@ LocalAddress=127.0.0.1
|
|||||||
LocalPort=42015
|
LocalPort=42015
|
||||||
EnableWiresX=1
|
EnableWiresX=1
|
||||||
WiresXMakeUpper=1
|
WiresXMakeUpper=1
|
||||||
|
RadioID=*****
|
||||||
|
FICHCallsign=2
|
||||||
|
FICHCallMode=0
|
||||||
|
FICHBlockTotal=0
|
||||||
|
FICHFrameTotal=7
|
||||||
|
FICHMessageRoute=0
|
||||||
|
FICHVOIP=0
|
||||||
|
FICHDataType=2
|
||||||
|
FICHSQLType=0
|
||||||
|
FICHSQLCode=0
|
||||||
|
DT1=49,34,98,95,41,0,0,0,0,0
|
||||||
|
DT2=0,0,0,0,108,32,28,32,3,8
|
||||||
Daemon=0
|
Daemon=0
|
||||||
Debug=0
|
Debug=0
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user