mirror of
https://github.com/g4klx/DMRGateway.git
synced 2026-01-18 22:30:18 +01:00
Allow for passing of beacon requests from the networks to the repeater.
This commit is contained in:
parent
c70e35d5b7
commit
efbf42ff83
|
|
@ -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];
|
||||
|
|
|
|||
|
|
@ -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");
|
||||
|
|
|
|||
|
|
@ -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();
|
||||
|
|
|
|||
|
|
@ -45,6 +45,8 @@ public:
|
|||
|
||||
virtual void clock(unsigned int ms) = 0;
|
||||
|
||||
virtual bool writeBeacon() = 0;
|
||||
|
||||
virtual void close() = 0;
|
||||
|
||||
private:
|
||||
|
|
|
|||
Loading…
Reference in a new issue