From 1e80dd58cd2d49fbb457061df652dbe628bcad6e Mon Sep 17 00:00:00 2001 From: Tom Early Date: Fri, 10 Jul 2020 17:19:07 -0700 Subject: [PATCH] xrf dashboard --- ambed/Makefile | 28 +++++++++++++++++++--------- ambed/main.cpp | 16 +++++----------- dashboard.xrf/pgs/peers.php | 4 ++-- src/Makefile | 4 ++-- 4 files changed, 28 insertions(+), 24 deletions(-) diff --git a/ambed/Makefile b/ambed/Makefile index 72428fa..642b1cf 100644 --- a/ambed/Makefile +++ b/ambed/Makefile @@ -1,26 +1,36 @@ #copyright(C) 2020 by Thomas A. Early, N7TAE +################################################################# +# Here is the only things you might need to change +ip = 127.0.0.1 +# set to true for debugging support +debug = false +################################################################# + # If you are going to change this path, you will # need to update the systemd service script -BINDIR=/usr/local/bin +BINDIR = /usr/local/bin -GCC=g++ +GCC = g++ # uncomment the next line to enable gdb debugging help #DEBUG=true -CFLAGS=-W -MMD -MD -std=c++11 -ifdef DEBUG +CFLAGS = -W -MMD -MD -std=c++11 + +ifeq ($(debug), true) CFLAGS+=-ggdb3 endif -LDFLAGS=-pthread +CFLAGS += -DIP_ADDR=\"$(ip)\" + +LDFLAGS = -pthread -SRCS=cagc.cpp cbuffer.cpp cfirfilter.cpp cip.cpp csignalprocessor.cpp cusb3003hrinterface.cpp cvocodecchannel.cpp cvoicepacket.cpp cambepacket.cpp ccallsign.cpp cfixedgain.cpp cpacket.cpp cstream.cpp cusb3000interface.cpp cusb3003interface.cpp cvocodecinterface.cpp main.cpp cambeserver.cpp ccontroller.cpp cftdidevicedescr.cpp cpacketqueue.cpp ctimepoint.cpp cusb3003df2etinterface.cpp cusb3xxxinterface.cpp cvocodecs.cpp cudpsocket.cpp +SRCS = cagc.cpp cbuffer.cpp cfirfilter.cpp cip.cpp csignalprocessor.cpp cusb3003hrinterface.cpp cvocodecchannel.cpp cvoicepacket.cpp cambepacket.cpp ccallsign.cpp cfixedgain.cpp cpacket.cpp cstream.cpp cusb3000interface.cpp cusb3003interface.cpp cvocodecinterface.cpp main.cpp cambeserver.cpp ccontroller.cpp cftdidevicedescr.cpp cpacketqueue.cpp ctimepoint.cpp cusb3003df2etinterface.cpp cusb3xxxinterface.cpp cvocodecs.cpp cudpsocket.cpp -OBJS=$(SRCS:.cpp=.o) -DEPS=$(SRCS:.cpp=.d) -EXE=ambed +OBJS = $(SRCS:.cpp=.o) +DEPS = $(SRCS:.cpp=.d) +EXE = ambed $(EXE) : $(OBJS) $(GCC) $(LDFLAGS) $(OBJS) -lftd2xx -Wl,-rpath,/usr/local/lib -o $@ diff --git a/ambed/main.cpp b/ambed/main.cpp index e59936c..6fede91 100644 --- a/ambed/main.cpp +++ b/ambed/main.cpp @@ -32,20 +32,14 @@ //////////////////////////////////////////////////////////////////////////////////////// // function declaration +#ifndef IP_ADDR +#define IP_ADDR "127.0.0.1" +#endif -int main(int argc, const char * argv[]) +int main() { - - // check arguments - if ( argc != 2 ) - { - std::cout << "Usage: ambed ip" << std::endl; - std::cout << "example: ambed 192.168.178.212" << std::endl; - return 1; - } - // initialize ambeserver - g_AmbeServer.SetListenIp(argv[1]); + g_AmbeServer.SetListenIp(IP_ADDR); // and let it run std::cout << "Starting AMBEd " << VERSION_MAJOR << "." << VERSION_MINOR << "." << VERSION_REVISION << std::endl << std::endl; diff --git a/dashboard.xrf/pgs/peers.php b/dashboard.xrf/pgs/peers.php index 45a735d..b238b5b 100644 --- a/dashboard.xrf/pgs/peers.php +++ b/dashboard.xrf/pgs/peers.php @@ -84,9 +84,9 @@ for ($i=0;$i<$Reflector->PeerCount();$i++) { if ($count > 1) { if (1 == substr_count($ipstr, "::")) { $ipstr = str_replace("::", str_repeat(":", 9 - $count), $ipstr); } if (7 == substr_count($ipstr, ":")) { - echo $MC.':'.$MC.':'.$MC.':'.$MC; + echo $MC.':'.$MC.':'.$MC.':'.$MC.':'.$MC.':'.$MC; $Bytes = explode(":", $ipstr); - for( $k=4; $k<8; $k++) { echo (0==strlen($Bytes[$k])) ? ':0' : ':'.$Bytes[$k]; } + for( $k=6; $k<8; $k++) { echo (0==strlen($Bytes[$k])) ? ':0' : ':'.$Bytes[$k]; } } } } diff --git a/src/Makefile b/src/Makefile index 6357c1b..8e8c356 100644 --- a/src/Makefile +++ b/src/Makefile @@ -134,7 +134,7 @@ clean : -include $(DEPS) -install : $(EXE).blacklist $(EXE).whitelist $(EXE).interlink $(EXE).terminal $(EXE).service $(EXE) +install : ln -s $(shell pwd)/$(EXE).blacklist $(CFGDIR)/$(EXE).blacklist ln -s $(shell pwd)/$(EXE).whitelist $(CFGDIR)/$(EXE).whitelist ln -s $(shell pwd)/$(EXE).interlink $(CFGDIR)/$(EXE).interlink @@ -153,7 +153,7 @@ uninstall : rm -f $(CFGDIR)/$(EXE).whitelist rm -f $(CFGDIR)/$(EXE).interlink rm -f $(CFGDIR)/$(EXE).terminal - rm -r xlxd xrfd + rm -rf xlxd xrfd systemctl stop $(EXE).service rm -f $(CFGDIR)/dmrid.dat systemctl disable $(EXE).service