mirror of
https://github.com/ShaYmez/MMDVM_CM.git
synced 2025-09-05 06:27:48 -04:00
Patching YSF2DMR for new Yaesu Radios
This commit is contained in:
parent
b2ee3e8e65
commit
234d128bde
@ -33,6 +33,7 @@
|
|||||||
// 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 DMR_FRAME_PER 55U
|
#define DMR_FRAME_PER 55U
|
||||||
#define YSF_FRAME_PER 90U
|
#define YSF_FRAME_PER 90U
|
||||||
@ -50,6 +51,7 @@ 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, EA7EE, G4KLX and others";
|
const char* HEADER4 = "Copyright(C) 2018,2019 by CA6JAU, EA7EE, G4KLX and others";
|
||||||
|
const char ysf_radioid[] = {'H', '5', '0', '0', '0'};
|
||||||
|
|
||||||
#include <functional>
|
#include <functional>
|
||||||
#include <algorithm>
|
#include <algorithm>
|
||||||
@ -942,13 +944,17 @@ int CYSF2DMR::run()
|
|||||||
CYSFFICH fich;
|
CYSFFICH fich;
|
||||||
fich.setFI(YSF_FI_HEADER);
|
fich.setFI(YSF_FI_HEADER);
|
||||||
fich.setCS(2U);
|
fich.setCS(2U);
|
||||||
|
fich.setCM(1U);
|
||||||
|
fich.setBN(0U);
|
||||||
|
fich.setBT(0U);
|
||||||
fich.setFN(0U);
|
fich.setFN(0U);
|
||||||
fich.setFT(7U);
|
fich.setFT(6U);
|
||||||
fich.setDev(0U);
|
fich.setDev(0U);
|
||||||
|
fich.setMR(0U);
|
||||||
|
fich.setVoIP(false);
|
||||||
fich.setDT(YSF_DT_VD_MODE2);
|
fich.setDT(YSF_DT_VD_MODE2);
|
||||||
fich.setSQL(false);
|
fich.setSQL(false);
|
||||||
fich.setSQ(0U);
|
fich.setSQ(0U);
|
||||||
fich.setMR(2U);
|
|
||||||
|
|
||||||
if (m_remoteGateway) {
|
if (m_remoteGateway) {
|
||||||
fich.setVoIP(false);
|
fich.setVoIP(false);
|
||||||
@ -961,7 +967,8 @@ int CYSF2DMR::run()
|
|||||||
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);
|
memset(csd1, '*', YSF_CALLSIGN_LENGTH/2);
|
||||||
|
memcpy(csd1 + YSF_CALLSIGN_LENGTH/2, ysf_radioid, 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);
|
||||||
|
|
||||||
@ -986,13 +993,17 @@ int CYSF2DMR::run()
|
|||||||
CYSFFICH fich;
|
CYSFFICH fich;
|
||||||
fich.setFI(YSF_FI_TERMINATOR);
|
fich.setFI(YSF_FI_TERMINATOR);
|
||||||
fich.setCS(2U);
|
fich.setCS(2U);
|
||||||
|
fich.setCM(1U);
|
||||||
|
fich.setBN(0U);
|
||||||
|
fich.setBT(0U);
|
||||||
fich.setFN(0U);
|
fich.setFN(0U);
|
||||||
fich.setFT(7U);
|
fich.setFT(6U);
|
||||||
fich.setDev(0U);
|
fich.setDev(0U);
|
||||||
|
fich.setMR(0U);
|
||||||
|
fich.setVoIP(false);
|
||||||
fich.setDT(YSF_DT_VD_MODE2);
|
fich.setDT(YSF_DT_VD_MODE2);
|
||||||
fich.setSQL(false);
|
fich.setSQL(false);
|
||||||
fich.setSQ(0U);
|
fich.setSQ(0U);
|
||||||
fich.setMR(2U);
|
|
||||||
|
|
||||||
if (m_remoteGateway) {
|
if (m_remoteGateway) {
|
||||||
fich.setVoIP(false);
|
fich.setVoIP(false);
|
||||||
@ -1005,7 +1016,8 @@ int CYSF2DMR::run()
|
|||||||
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);
|
memset(csd1, '*', YSF_CALLSIGN_LENGTH/2);
|
||||||
|
memcpy(csd1 + YSF_CALLSIGN_LENGTH/2, ysf_radioid, 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);
|
||||||
|
|
||||||
@ -1017,8 +1029,9 @@ int CYSF2DMR::run()
|
|||||||
else if (ysfFrameType == TAG_DATA) {
|
else if (ysfFrameType == TAG_DATA) {
|
||||||
CYSFFICH fich;
|
CYSFFICH fich;
|
||||||
CYSFPayload ysfPayload;
|
CYSFPayload ysfPayload;
|
||||||
|
unsigned char dch[10U];
|
||||||
|
|
||||||
unsigned int fn = (ysf_cnt - 1U) % 8U;
|
unsigned int fn = (ysf_cnt - 1U) % 7U;
|
||||||
|
|
||||||
::memcpy(m_ysfFrame + 0U, "YSFD", 4U);
|
::memcpy(m_ysfFrame + 0U, "YSFD", 4U);
|
||||||
::memcpy(m_ysfFrame + 4U, m_ysfNetwork->getCallsign().c_str(), YSF_CALLSIGN_LENGTH);
|
::memcpy(m_ysfFrame + 4U, m_ysfNetwork->getCallsign().c_str(), YSF_CALLSIGN_LENGTH);
|
||||||
@ -1030,7 +1043,9 @@ int CYSF2DMR::run()
|
|||||||
|
|
||||||
switch (fn) {
|
switch (fn) {
|
||||||
case 0:
|
case 0:
|
||||||
ysfPayload.writeVDMode2Data(m_ysfFrame + 35U, (const unsigned char*)"**********");
|
memset(dch, '*', YSF_CALLSIGN_LENGTH/2);
|
||||||
|
memcpy(dch + YSF_CALLSIGN_LENGTH/2, ysf_radioid, YSF_CALLSIGN_LENGTH/2);
|
||||||
|
ysfPayload.writeVDMode2Data(m_ysfFrame + 35U, dch);
|
||||||
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());
|
||||||
@ -1038,11 +1053,16 @@ int CYSF2DMR::run()
|
|||||||
case 2:
|
case 2:
|
||||||
ysfPayload.writeVDMode2Data(m_ysfFrame + 35U, (const unsigned char*)m_netDst.c_str());
|
ysfPayload.writeVDMode2Data(m_ysfFrame + 35U, (const unsigned char*)m_netDst.c_str());
|
||||||
break;
|
break;
|
||||||
|
case 5:
|
||||||
|
memset(dch, ' ', YSF_CALLSIGN_LENGTH/2);
|
||||||
|
memcpy(dch + YSF_CALLSIGN_LENGTH/2, ysf_radioid, YSF_CALLSIGN_LENGTH/2);
|
||||||
|
ysfPayload.writeVDMode2Data(m_ysfFrame + 35U, dch); // Rem3/4
|
||||||
|
break;
|
||||||
case 6:
|
case 6:
|
||||||
ysfPayload.writeVDMode2Data(m_ysfFrame + 35U, gps_buffer);
|
ysfPayload.writeVDMode2Data(m_ysfFrame + 35U, dt1);
|
||||||
break;
|
break;
|
||||||
case 7:
|
case 7:
|
||||||
ysfPayload.writeVDMode2Data(m_ysfFrame + 35U, gps_buffer+10U);
|
ysfPayload.writeVDMode2Data(m_ysfFrame + 35U, dt2_temp);
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
ysfPayload.writeVDMode2Data(m_ysfFrame + 35U, (const unsigned char*)" ");
|
ysfPayload.writeVDMode2Data(m_ysfFrame + 35U, (const unsigned char*)" ");
|
||||||
@ -1051,9 +1071,14 @@ int CYSF2DMR::run()
|
|||||||
// Set the FICH
|
// Set the FICH
|
||||||
fich.setFI(YSF_FI_COMMUNICATIONS);
|
fich.setFI(YSF_FI_COMMUNICATIONS);
|
||||||
fich.setCS(2U);
|
fich.setCS(2U);
|
||||||
|
fich.setCM(1U);
|
||||||
|
fich.setBN(0U);
|
||||||
|
fich.setBT(0U);
|
||||||
fich.setFN(fn);
|
fich.setFN(fn);
|
||||||
fich.setFT(7U);
|
fich.setFT(6U);
|
||||||
fich.setDev(0U);
|
fich.setDev(0U);
|
||||||
|
fich.setMR(0U);
|
||||||
|
fich.setVoIP(false);
|
||||||
fich.setDT(YSF_DT_VD_MODE2);
|
fich.setDT(YSF_DT_VD_MODE2);
|
||||||
fich.setSQL(false);
|
fich.setSQL(false);
|
||||||
fich.setSQ(0U);
|
fich.setSQ(0U);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user