diff --git a/MMDVM.README b/MMDVM.README index f781e90..654d8dc 100644 --- a/MMDVM.README +++ b/MMDVM.README @@ -45,7 +45,7 @@ system should work. It just needs a g++ compiler with version greater than 4.9. 10) cd into the build directory and switch the branch: git checkout mmdvm -11) then compile: make +11) Then compile: make don't forget the -j option! 12) You need a configuration file for QnetGateway. The simplest config file is: diff --git a/Makefile b/Makefile index 6a6474f..83564e1 100644 --- a/Makefile +++ b/Makefile @@ -110,7 +110,6 @@ installdvap : qngateway qnlink qndvap systemctl start qnlink.service ######### QnetDVAP ######### /bin/cp -f qndvap $(BINDIR) - /bin/cp -f qndvap.sh $(BINDIR) /bin/cp -f service.qndvap /lib/systemd/system/qndvap.service systemctl enable qnlink.service systemctl daemon-reload @@ -135,7 +134,6 @@ installdvrptr : qngateway qnlink qndvrptr systemctl start qnlink.service ######### QnetDVRPTR ######### /bin/cp -f qndvrptr $(BINDIR) - /bin/cp -f qndvrptr.sh $(BINDIR) /bin/cp -f service.qndvrptr /lib/systemd/system/qndvrptr.service systemctl enable qndvrptr.service systemctl daemon-reload @@ -156,6 +154,7 @@ uninstalldtmfs: systemctl daemon-reload /bin/rm -f $(BINDIR)/qnlinktest /bin/rm -f $(BINDIR)/proc_qnlinktest + systemctl daemon-reload uninstall : ######### QnetGateway ######### @@ -183,6 +182,7 @@ uninstall : systemctl disable qnrelay.service /bin/rm -f /lib/systemd/system/qnrelay.service /bin/rm -f $(BINDIR)/qnrelay + systemctl daemon-reload uninstalldvap : ######### QnetGateway ######### @@ -210,7 +210,7 @@ uninstalldvap : systemctl disable qndvap.service /bin/rm -f /lib/systemd/system/qndvap.service /bin/rm -f $(BINDIR)/qndvap - /bin/rm -f $(BINDIR)/qndvap.sh + systemctl daemon-reload uninstalldvrptr : ######### QnetGateway ######### @@ -238,4 +238,4 @@ uninstalldvrptr : systemctl disable qndvrptr.service /bin/rm -f /lib/systemd/system/qndvrptr.service /bin/rm -f $(BINDIR)/qndvrptr - /bin/rm -f $(BINDIR)/qndvrptr.sh + systemctl daemon-reload diff --git a/QnetDVRPTR.cpp b/QnetDVRPTR.cpp index 6c4c677..670a646 100644 --- a/QnetDVRPTR.cpp +++ b/QnetDVRPTR.cpp @@ -2378,8 +2378,7 @@ static void readFrom20000() seq_no = block * 21 + seq_no; if (busy20000) { - if ((recv_buf.myicm.streamid[0] == streamid[0]) && - (recv_buf.myicm.streamid[1] == streamid[1])) { + if ((recv_buf.myicm.streamid[0] == streamid[0]) && (recv_buf.myicm.streamid[1] == streamid[1])) { if ((recv_buf.myicm.ctrl <= ctrl_in) && (ctrl_in != 0x80)) { /* do not update written_to_q, ctrl_in */ ; // printf("dup\n"); diff --git a/QnetRelay.cpp b/QnetRelay.cpp index 71872ad..7c3968a 100644 --- a/QnetRelay.cpp +++ b/QnetRelay.cpp @@ -161,6 +161,7 @@ void CQnetRelay::Run(const char *cfgfile) memset(&addr, 0, sizeof(sockaddr_in)); socklen_t size = sizeof(sockaddr); ssize_t len; + if (FD_ISSET(msock, &readfds)) { len = ::recvfrom(msock, buf, 100, 0, (sockaddr *)&addr, &size); @@ -172,7 +173,9 @@ void CQnetRelay::Run(const char *cfgfile) if (ntohs(addr.sin_port) != MMDVM_IN_PORT) printf("DEBUG: Run: read from msock but port was %u, expected %u.\n", ntohs(addr.sin_port), MMDVM_IN_PORT); - } else if (FD_ISSET(gsock, &readfds)) { + } + + if (FD_ISSET(gsock, &readfds)) { len = ::recvfrom(gsock, buf, 100, 0, (sockaddr *)&addr, &size); if (len < 0) { diff --git a/qndvap.sh b/qndvap.sh deleted file mode 100755 index e23388e..0000000 --- a/qndvap.sh +++ /dev/null @@ -1,26 +0,0 @@ -#!/bin/bash - -# -# Copyright (C) 2010 by Scott Lawson KI4LKF -# -# This program is free software; you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation; either version 2 of the License, or -# (at your option) any later version. -# -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with this program; if not, write to the Free Software -# Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. - - -while [ 1 ]; -do - /usr/local/bin/qndvap /usr/local/etc/qn.cfg - sleep 10 -done - diff --git a/qndvrptr.sh b/qndvrptr.sh deleted file mode 100755 index e74e529..0000000 --- a/qndvrptr.sh +++ /dev/null @@ -1,10 +0,0 @@ -#!/bin/bash - -while [ 1 ]; -do - /usr/local/bin/qndvrptr /usr/local/etc/qn.cfg - sleep 10 -done - -exit 0 - diff --git a/service.qndvap b/service.qndvap index 5c48994..bb0f49a 100644 --- a/service.qndvap +++ b/service.qndvap @@ -4,7 +4,8 @@ After=systemd-user-session.service [Service] Type=simple -ExecStart=/usr/local/bin/qndvap.sh +ExecStart=/usr/local/bin/qndvap +Restart=always [Install] WantedBy=multi-user.target diff --git a/service.qndvrptr b/service.qndvrptr index c95896c..1587d72 100644 --- a/service.qndvrptr +++ b/service.qndvrptr @@ -4,7 +4,8 @@ After=systemd-user-session.service [Service] Type=simple -ExecStart=/usr/local/bin/qndvrptr.sh +ExecStart=/usr/local/bin/qndvrptr +Restart=always [Install] WantedBy=multi-user.target