diff --git a/DMRGateway.cpp b/DMRGateway.cpp index 017aa36..2c148ab 100644 --- a/DMRGateway.cpp +++ b/DMRGateway.cpp @@ -615,6 +615,10 @@ int CDMRGateway::run() } } } + + ret = m_dmrNetwork1->wantsBeacon(); + if (ret) + m_repeater->writeBeacon(); } if (m_dmrNetwork2 != NULL) { @@ -639,6 +643,10 @@ int CDMRGateway::run() } } } + + ret = m_dmrNetwork2->wantsBeacon(); + if (ret) + m_repeater->writeBeacon(); } unsigned char buffer[50U]; diff --git a/MMDVMNetwork.cpp b/MMDVMNetwork.cpp index 3179d51..aadc537 100644 --- a/MMDVMNetwork.cpp +++ b/MMDVMNetwork.cpp @@ -244,6 +244,15 @@ bool CMMDVMNetwork::readTalkerAlias(unsigned char* data, unsigned int& length) return true; } +bool CMMDVMNetwork::writeBeacon() +{ + unsigned char buffer[20U]; + ::memcpy(buffer + 0U, "RPTSBKN", 7U); + ::memcpy(buffer + 7U, m_netId, 4U); + + return m_socket.write(buffer, 11U, m_rptAddress, m_rptPort); +} + void CMMDVMNetwork::close() { LogMessage("DMR, Closing MMDVM Network"); diff --git a/MMDVMNetwork.h b/MMDVMNetwork.h index 58d7990..3240705 100644 --- a/MMDVMNetwork.h +++ b/MMDVMNetwork.h @@ -50,6 +50,8 @@ public: virtual bool readTalkerAlias(unsigned char* data, unsigned int& length); + virtual bool writeBeacon(); + virtual void clock(unsigned int ms); virtual void close(); diff --git a/RepeaterProtocol.h b/RepeaterProtocol.h index d15019c..6f602f3 100644 --- a/RepeaterProtocol.h +++ b/RepeaterProtocol.h @@ -45,6 +45,8 @@ public: virtual void clock(unsigned int ms) = 0; + virtual bool writeBeacon() = 0; + virtual void close() = 0; private: