diff --git a/Conf.cpp b/Conf.cpp index 06e3cb4..8629341 100644 --- a/Conf.cpp +++ b/Conf.cpp @@ -114,6 +114,7 @@ m_transparentEnabled(false), m_transparentRemoteAddress(), m_transparentRemotePort(0U), m_transparentLocalPort(0U), +m_transparentSendFrameType(0U), m_umpEnabled(false), m_umpPort(), m_dstarEnabled(false), @@ -464,6 +465,8 @@ bool CConf::read() m_transparentRemotePort = (unsigned int)::atoi(value); else if (::strcmp(key, "LocalPort") == 0) m_transparentLocalPort = (unsigned int)::atoi(value); + else if (::strcmp(key, "SendFrameType") == 0) + m_transparentSendFrameType = (unsigned int)::atoi(value); } else if (section == SECTION_UMP) { if (::strcmp(key, "Enable") == 0) m_umpEnabled = ::atoi(value) == 1; @@ -1054,6 +1057,11 @@ unsigned int CConf::getTransparentLocalPort() const return m_transparentLocalPort; } +unsigned int CConf::getTransparentSendFrameType() const +{ + return m_transparentSendFrameType; +} + bool CConf::getUMPEnabled() const { return m_umpEnabled; diff --git a/Conf.h b/Conf.h index 8243cd6..8b7d16c 100644 --- a/Conf.h +++ b/Conf.h @@ -99,6 +99,7 @@ public: std::string getTransparentRemoteAddress() const; unsigned int getTransparentRemotePort() const; unsigned int getTransparentLocalPort() const; + unsigned int getTransparentSendFrameType() const; // The UMP section bool getUMPEnabled() const; @@ -322,6 +323,7 @@ private: std::string m_transparentRemoteAddress; unsigned int m_transparentRemotePort; unsigned int m_transparentLocalPort; + unsigned int m_transparentSendFrameType; bool m_umpEnabled; std::string m_umpPort; diff --git a/Images/YSF.bmp b/Images/YSF.bmp index a753134..d1a8292 100644 Binary files a/Images/YSF.bmp and b/Images/YSF.bmp differ diff --git a/MMDVM.ini b/MMDVM.ini index d0debd0..661e86b 100644 --- a/MMDVM.ini +++ b/MMDVM.ini @@ -74,6 +74,7 @@ Enable=0 RemoteAddress=127.0.0.1 RemotePort=40094 LocalPort=40095 +# SendFrameType=0 [UMP] Enable=0 diff --git a/MMDVMHost.cpp b/MMDVMHost.cpp index 054d113..54ff394 100644 --- a/MMDVMHost.cpp +++ b/MMDVMHost.cpp @@ -315,15 +315,18 @@ int CMMDVMHost::run() unsigned int transparentPort = 0U; CUDPSocket* transparentSocket = NULL; + unsigned int sendFrameType = 0U; if (m_conf.getTransparentEnabled()) { std::string remoteAddress = m_conf.getTransparentRemoteAddress(); unsigned int remotePort = m_conf.getTransparentRemotePort(); unsigned int localPort = m_conf.getTransparentLocalPort(); + sendFrameType = m_conf.getTransparentSendFrameType(); LogInfo("Transparent Data"); LogInfo(" Remote Address: %s", remoteAddress.c_str()); LogInfo(" Remote Port: %u", remotePort); LogInfo(" Local Port: %u", localPort); + LogInfo(" Send Frame Type: %u", sendFrameType); transparentAddress = CUDPSocket::lookup(remoteAddress); transparentPort = remotePort; @@ -884,7 +887,7 @@ int CMMDVMHost::run() unsigned int port = 0U; len = transparentSocket->read(data, 200U, address, port); if (len > 0U) - m_modem->writeTransparentData(data, len); + m_modem->writeTransparentData(data, len, sendFrameType); } unsigned int ms = stopWatch.elapsed(); diff --git a/Modem.cpp b/Modem.cpp index 06bf916..e15ae7a 100644 --- a/Modem.cpp +++ b/Modem.cpp @@ -1085,7 +1085,7 @@ bool CModem::writePOCSAGData(const unsigned char* data, unsigned int length) return true; } -bool CModem::writeTransparentData(const unsigned char* data, unsigned int length) +bool CModem::writeTransparentData(const unsigned char* data, unsigned int length, unsigned int sendFrameType) { assert(data != NULL); assert(length > 0U); @@ -1096,7 +1096,19 @@ bool CModem::writeTransparentData(const unsigned char* data, unsigned int length buffer[1U] = length + 3U; buffer[2U] = MMDVM_TRANSPARENT; - ::memcpy(buffer + 3U, data, length); + if (sendFrameType>0) { + ::memcpy(buffer + 2U, data, length); + length--; + buffer[1U]--; + //when sendFrameType==1 , only 0x80 and 0x90 (MMDVM_SERIAL and MMDVM_TRANSPARENT) are allowed + // and reverted to default (MMDVM_TRANSPARENT) for any other value + //when >1, frame type is not checked + if (sendFrameType==1) { + if ((buffer[2U] & 0xE0) != 0x80) buffer[2U] = MMDVM_TRANSPARENT; + } + } else { + ::memcpy(buffer + 3U, data, length); + } unsigned char len = length + 3U; m_txTransparentData.addData(&len, 1U); diff --git a/Modem.h b/Modem.h index 52d2780..ef9c415 100644 --- a/Modem.h +++ b/Modem.h @@ -77,7 +77,7 @@ public: bool writeP25Data(const unsigned char* data, unsigned int length); bool writeNXDNData(const unsigned char* data, unsigned int length); bool writePOCSAGData(const unsigned char* data, unsigned int length); - bool writeTransparentData(const unsigned char* data, unsigned int length); + bool writeTransparentData(const unsigned char* data, unsigned int length, unsigned int sendFrameType); bool writeDMRStart(bool tx); bool writeDMRShortLC(const unsigned char* lc); diff --git a/Nextion_G4KLX/NX3224K024.HMI b/Nextion_G4KLX/NX3224K024.HMI index a38fa89..61c8067 100644 Binary files a/Nextion_G4KLX/NX3224K024.HMI and b/Nextion_G4KLX/NX3224K024.HMI differ diff --git a/Nextion_G4KLX/NX3224K024.tft b/Nextion_G4KLX/NX3224K024.tft index 614a799..417aefd 100644 Binary files a/Nextion_G4KLX/NX3224K024.tft and b/Nextion_G4KLX/NX3224K024.tft differ diff --git a/Nextion_G4KLX/NX3224K028.HMI b/Nextion_G4KLX/NX3224K028.HMI index 3cd43eb..b4ebbc3 100644 Binary files a/Nextion_G4KLX/NX3224K028.HMI and b/Nextion_G4KLX/NX3224K028.HMI differ diff --git a/Nextion_G4KLX/NX3224K028.tft b/Nextion_G4KLX/NX3224K028.tft index 4d17de7..7880b8c 100644 Binary files a/Nextion_G4KLX/NX3224K028.tft and b/Nextion_G4KLX/NX3224K028.tft differ diff --git a/Nextion_G4KLX/NX3224T024.HMI b/Nextion_G4KLX/NX3224T024.HMI index cccb8c1..44f1538 100644 Binary files a/Nextion_G4KLX/NX3224T024.HMI and b/Nextion_G4KLX/NX3224T024.HMI differ diff --git a/Nextion_G4KLX/NX3224T024.tft b/Nextion_G4KLX/NX3224T024.tft index 6eff11b..3699e85 100644 Binary files a/Nextion_G4KLX/NX3224T024.tft and b/Nextion_G4KLX/NX3224T024.tft differ diff --git a/Nextion_G4KLX/NX3224T028.HMI b/Nextion_G4KLX/NX3224T028.HMI index 741b105..3864b34 100644 Binary files a/Nextion_G4KLX/NX3224T028.HMI and b/Nextion_G4KLX/NX3224T028.HMI differ diff --git a/Nextion_G4KLX/NX3224T028.tft b/Nextion_G4KLX/NX3224T028.tft index 59d921a..034441b 100644 Binary files a/Nextion_G4KLX/NX3224T028.tft and b/Nextion_G4KLX/NX3224T028.tft differ diff --git a/Nextion_G4KLX/NX4024K032.HMI b/Nextion_G4KLX/NX4024K032.HMI index ddb0a92..7df6343 100644 Binary files a/Nextion_G4KLX/NX4024K032.HMI and b/Nextion_G4KLX/NX4024K032.HMI differ diff --git a/Nextion_G4KLX/NX4024K032.tft b/Nextion_G4KLX/NX4024K032.tft index ff6d570..92b2843 100644 Binary files a/Nextion_G4KLX/NX4024K032.tft and b/Nextion_G4KLX/NX4024K032.tft differ diff --git a/Nextion_G4KLX/NX4024T032.HMI b/Nextion_G4KLX/NX4024T032.HMI index af7564b..03cd4a8 100644 Binary files a/Nextion_G4KLX/NX4024T032.HMI and b/Nextion_G4KLX/NX4024T032.HMI differ diff --git a/Nextion_G4KLX/NX4024T032.tft b/Nextion_G4KLX/NX4024T032.tft index ac8fd65..9405c5e 100644 Binary files a/Nextion_G4KLX/NX4024T032.tft and b/Nextion_G4KLX/NX4024T032.tft differ diff --git a/Nextion_G4KLX/NX4832K035.HMI b/Nextion_G4KLX/NX4832K035.HMI index 68a0933..e1c2cf4 100644 Binary files a/Nextion_G4KLX/NX4832K035.HMI and b/Nextion_G4KLX/NX4832K035.HMI differ diff --git a/Nextion_G4KLX/NX4832K035.tft b/Nextion_G4KLX/NX4832K035.tft index 151e5e8..71fc6d8 100644 Binary files a/Nextion_G4KLX/NX4832K035.tft and b/Nextion_G4KLX/NX4832K035.tft differ diff --git a/Nextion_G4KLX/NX4832T035.HMI b/Nextion_G4KLX/NX4832T035.HMI index eb726a7..3128178 100644 Binary files a/Nextion_G4KLX/NX4832T035.HMI and b/Nextion_G4KLX/NX4832T035.HMI differ diff --git a/Nextion_G4KLX/NX4832T035.tft b/Nextion_G4KLX/NX4832T035.tft index 37f2c79..5643caa 100644 Binary files a/Nextion_G4KLX/NX4832T035.tft and b/Nextion_G4KLX/NX4832T035.tft differ diff --git a/Nextion_ON7LDS/NX3224T024-L2.HMI b/Nextion_ON7LDS/NX3224T024-L2.HMI index d3dd338..e444afa 100644 Binary files a/Nextion_ON7LDS/NX3224T024-L2.HMI and b/Nextion_ON7LDS/NX3224T024-L2.HMI differ diff --git a/Nextion_ON7LDS/NX3224T024-L2.tft b/Nextion_ON7LDS/NX3224T024-L2.tft index 31761dc..5ef6c18 100644 Binary files a/Nextion_ON7LDS/NX3224T024-L2.tft and b/Nextion_ON7LDS/NX3224T024-L2.tft differ diff --git a/Nextion_ON7LDS/NX3224T024-L3.HMI b/Nextion_ON7LDS/NX3224T024-L3.HMI index 93fd1dc..36d0843 100644 Binary files a/Nextion_ON7LDS/NX3224T024-L3.HMI and b/Nextion_ON7LDS/NX3224T024-L3.HMI differ diff --git a/Nextion_ON7LDS/NX3224T024-L3.tft b/Nextion_ON7LDS/NX3224T024-L3.tft index 1815a2e..df3405f 100644 Binary files a/Nextion_ON7LDS/NX3224T024-L3.tft and b/Nextion_ON7LDS/NX3224T024-L3.tft differ diff --git a/Nextion_ON7LDS/NX3224T028-L2.HMI b/Nextion_ON7LDS/NX3224T028-L2.HMI index 96c02a2..8fca48b 100644 Binary files a/Nextion_ON7LDS/NX3224T028-L2.HMI and b/Nextion_ON7LDS/NX3224T028-L2.HMI differ diff --git a/Nextion_ON7LDS/NX3224T028-L2.tft b/Nextion_ON7LDS/NX3224T028-L2.tft index 9e41c6d..610f8c9 100644 Binary files a/Nextion_ON7LDS/NX3224T028-L2.tft and b/Nextion_ON7LDS/NX3224T028-L2.tft differ diff --git a/Nextion_ON7LDS/NX3224T028-L3.HMI b/Nextion_ON7LDS/NX3224T028-L3.HMI index 2dbd311..f19c866 100644 Binary files a/Nextion_ON7LDS/NX3224T028-L3.HMI and b/Nextion_ON7LDS/NX3224T028-L3.HMI differ diff --git a/Nextion_ON7LDS/NX3224T028-L3.tft b/Nextion_ON7LDS/NX3224T028-L3.tft index 7d18455..cf5c831 100644 Binary files a/Nextion_ON7LDS/NX3224T028-L3.tft and b/Nextion_ON7LDS/NX3224T028-L3.tft differ diff --git a/Nextion_ON7LDS/NX4024T032-L2.HMI b/Nextion_ON7LDS/NX4024T032-L2.HMI index 81e65e9..4585874 100644 Binary files a/Nextion_ON7LDS/NX4024T032-L2.HMI and b/Nextion_ON7LDS/NX4024T032-L2.HMI differ diff --git a/Nextion_ON7LDS/NX4024T032-L2.tft b/Nextion_ON7LDS/NX4024T032-L2.tft index 3e9f72f..b310ce4 100644 Binary files a/Nextion_ON7LDS/NX4024T032-L2.tft and b/Nextion_ON7LDS/NX4024T032-L2.tft differ diff --git a/Nextion_ON7LDS/NX4832T035-L2.HMI b/Nextion_ON7LDS/NX4832T035-L2.HMI index e7580c2..1925206 100644 Binary files a/Nextion_ON7LDS/NX4832T035-L2.HMI and b/Nextion_ON7LDS/NX4832T035-L2.HMI differ diff --git a/Nextion_ON7LDS/NX4832T035-L2.tft b/Nextion_ON7LDS/NX4832T035-L2.tft index b1bc254..e2317e2 100644 Binary files a/Nextion_ON7LDS/NX4832T035-L2.tft and b/Nextion_ON7LDS/NX4832T035-L2.tft differ diff --git a/Nextion_ON7LDS/NX4832T035-L3.HMI b/Nextion_ON7LDS/NX4832T035-L3.HMI index af7bfb3..4c809c8 100644 Binary files a/Nextion_ON7LDS/NX4832T035-L3.HMI and b/Nextion_ON7LDS/NX4832T035-L3.HMI differ diff --git a/Nextion_ON7LDS/NX4832T035-L3.tft b/Nextion_ON7LDS/NX4832T035-L3.tft index 88b2d1c..1b93611 100644 Binary files a/Nextion_ON7LDS/NX4832T035-L3.tft and b/Nextion_ON7LDS/NX4832T035-L3.tft differ