pull/162/head
Charlie Root 5 years ago
commit fe7ec66c6d

@ -134,6 +134,6 @@ XLX Server requires the following ports to be open and forwarded properly for in
Pay attention, the XLX Server acts as an YSF Master, which provides 26 wires-x rooms. Pay attention, the XLX Server acts as an YSF Master, which provides 26 wires-x rooms.
It has nothing to do with the regular YSFReflector network, hence you dont need to register your XLX at ysfreflector.de ! It has nothing to do with the regular YSFReflector network, hence you dont need to register your XLX at ysfreflector.de !
Nevertheless it is possible.
© 2016 Jean-Luc Deltombe (LX3JL) and Luc Engelmann (LX1IQ) © 2016 Jean-Luc Deltombe (LX3JL) and Luc Engelmann (LX1IQ)

@ -1,11 +1,10 @@
************************************************* *************************************************
*copy xlxd into /etc.init.d/ *copy xlxd to /etc.init.d/
*copy ambed.service into /etc/systemd/system/ *copy ambed.service to /etc/systemd/system/
* *copy watchdog to /ambed/
************************************************* *************************************************
* xlxd executable must be in /xlxd/ folder * xlxd executable must be in /xlxd/ folder
* ambed executable must be in /ambed/ folder * ambed executable must be in /ambed/ folder
*
************************************************* *************************************************
* possible options: * possible options:
* *
@ -18,3 +17,10 @@
* #systemctl enable ambed * #systemctl enable ambed
* *
************************************************* *************************************************
* If your usb port gets unresponsive and you get some persistent timeouts,
* the watchdog script restarts the ambed service.
* You can run it every 5 minutes by a cronjob.
*
* */5 * * * * /ambed/./watchdog >> /ambed/watchdog.log
*
***************************************************

@ -0,0 +1,14 @@
#!/bin/bash
sleep 5
PATTERN=timed
FILE=/var/log/syslog
if grep -q $PATTERN $FILE;
then
echo "ambed timeout error"
> /var/log/syslog
service ambed restart
else
echo "all ok"
echo "Exiting..."
exit 0
fi

@ -19,7 +19,7 @@
// GNU General Public License for more details. // GNU General Public License for more details.
// //
// You should have received a copy of the GNU General Public License // You should have received a copy of the GNU General Public License
// along with Foobar. If not, see <http://www.gnu.org/licenses/>. // along with Foobar. If not, see <http://www.gnu.org/licenses/>.
// ---------------------------------------------------------------------------- // ----------------------------------------------------------------------------
#include "main.h" #include "main.h"
@ -52,7 +52,7 @@ CProtocol::~CProtocol()
m_pThread->join(); m_pThread->join();
delete m_pThread; delete m_pThread;
} }
// empty queue // empty queue
m_Queue.Lock(); m_Queue.Lock();
while ( !m_Queue.empty() ) while ( !m_Queue.empty() )
@ -69,13 +69,13 @@ bool CProtocol::Init(void)
{ {
// init reflector apparent callsign // init reflector apparent callsign
m_ReflectorCallsign = g_Reflector.GetCallsign(); m_ReflectorCallsign = g_Reflector.GetCallsign();
// reset stop flag // reset stop flag
m_bStopThread = false; m_bStopThread = false;
// start thread; // start thread;
m_pThread = new std::thread(CProtocol::Thread, this); m_pThread = new std::thread(CProtocol::Thread, this);
// done // done
return true; return true;
} }
@ -138,7 +138,12 @@ void CProtocol::OnDvFramePacketIn(CDvFramePacket *Frame, const CIp *Ip)
{ {
// find the stream // find the stream
CPacketStream *stream = GetStream(Frame->GetStreamId(), Ip); CPacketStream *stream = GetStream(Frame->GetStreamId(), Ip);
if ( stream != NULL ) if ( stream == NULL )
{
std::cout << "Deleting oprhaned Frame Packet with StreamId " << Frame->GetStreamId() << " from " << *Ip << std::endl;
delete Frame;
}
else
{ {
//std::cout << "DV frame" << "from " << *Ip << std::endl; //std::cout << "DV frame" << "from " << *Ip << std::endl;
// and push // and push
@ -152,13 +157,18 @@ void CProtocol::OnDvLastFramePacketIn(CDvLastFramePacket *Frame, const CIp *Ip)
{ {
// find the stream // find the stream
CPacketStream *stream = GetStream(Frame->GetStreamId(), Ip); CPacketStream *stream = GetStream(Frame->GetStreamId(), Ip);
if ( stream != NULL ) if ( stream == NULL )
{
std::cout << "Deleting oprhaned Last Frame Packet with StreamId " << Frame->GetStreamId() << " from " << *Ip << std::endl;
delete Frame;
}
else
{ {
// push // push
stream->Lock(); stream->Lock();
stream->Push(Frame); stream->Push(Frame);
stream->Unlock(); stream->Unlock();
// and close the stream // and close the stream
g_Reflector.CloseStream(stream); g_Reflector.CloseStream(stream);
} }
@ -170,7 +180,7 @@ void CProtocol::OnDvLastFramePacketIn(CDvLastFramePacket *Frame, const CIp *Ip)
CPacketStream *CProtocol::GetStream(uint16 uiStreamId, const CIp *Ip) CPacketStream *CProtocol::GetStream(uint16 uiStreamId, const CIp *Ip)
{ {
CPacketStream *stream = NULL; CPacketStream *stream = NULL;
// find if we have a stream with same streamid in our cache // find if we have a stream with same streamid in our cache
for ( int i = 0; (i < m_Streams.size()) && (stream == NULL); i++ ) for ( int i = 0; (i < m_Streams.size()) && (stream == NULL); i++ )
{ {
@ -256,5 +266,3 @@ uint32 CProtocol::ModuleToDmrDestId(char m) const
{ {
return (uint32)(m - 'A')+1; return (uint32)(m - 'A')+1;
} }

Loading…
Cancel
Save

Powered by TurnKey Linux.