From d3377e776c72f5d5860fa804728b959e15ab2a8a Mon Sep 17 00:00:00 2001 From: George Smart Date: Thu, 9 Mar 2017 20:55:41 +0000 Subject: [PATCH 1/9] Added Git Version number (*NIX only) --- .gitignore | 1 + MMDVMHost.cpp | 2 ++ Makefile | 13 ++++++++++--- Makefile.Pi | 13 ++++++++++--- Makefile.Pi.Adafruit | 13 ++++++++++--- Makefile.Pi.HD44780 | 13 ++++++++++--- Makefile.Pi.OLED | 13 ++++++++++--- Makefile.Pi.PCF8574 | 12 ++++++++++-- Makefile.Solaris | 13 ++++++++++--- 9 files changed, 73 insertions(+), 20 deletions(-) diff --git a/.gitignore b/.gitignore index f1260a1..158435f 100644 --- a/.gitignore +++ b/.gitignore @@ -15,3 +15,4 @@ MMDVMHost *.VC.db .vs *.ambe +gitversion.h diff --git a/MMDVMHost.cpp b/MMDVMHost.cpp index cea5c9b..a875ec4 100644 --- a/MMDVMHost.cpp +++ b/MMDVMHost.cpp @@ -33,6 +33,7 @@ #include "LCDproc.h" #include "Thread.h" #include "Log.h" +#include "gitversion.h" #if defined(HD44780) #include "HD44780.h" @@ -235,6 +236,7 @@ int CMMDVMHost::run() LogInfo(HEADER4); LogMessage("MMDVMHost-%s is starting", VERSION); + LogMessage("Built %s %s (GitID #%.7s)", __TIME__, __DATE__, gitversion); readParams(); diff --git a/Makefile b/Makefile index f180e2d..b1f1050 100644 --- a/Makefile +++ b/Makefile @@ -15,12 +15,19 @@ OBJECTS = \ all: MMDVMHost -MMDVMHost: $(OBJECTS) +MMDVMHost: gitversion.h $(OBJECTS) $(CXX) $(OBJECTS) $(CFLAGS) $(LIBS) -o MMDVMHost %.o: %.cpp $(CXX) $(CFLAGS) -c -o $@ $< clean: - $(RM) MMDVMHost *.o *.d *.bak *~ - + $(RM) MMDVMHost *.o *.d *.bak *~ gitversion.h + +# Export the current git version if the index file exists, else 000... +gitversion.h: +ifneq ("$(wildcard .git/index)","") + echo "const char *gitversion = \"$(shell git rev-parse HEAD)\";" > $@ +else + echo "const char *gitversion = \"0000000000000000000000000000000000000000\";" > $@ +endif diff --git a/Makefile.Pi b/Makefile.Pi index 0734d47..f683ec6 100644 --- a/Makefile.Pi +++ b/Makefile.Pi @@ -15,12 +15,19 @@ OBJECTS = \ all: MMDVMHost -MMDVMHost: $(OBJECTS) +MMDVMHost: gitversion.h $(OBJECTS) $(CXX) $(OBJECTS) $(CFLAGS) $(LIBS) -o MMDVMHost %.o: %.cpp $(CXX) $(CFLAGS) -c -o $@ $< clean: - $(RM) MMDVMHost *.o *.d *.bak *~ - + $(RM) MMDVMHost *.o *.d *.bak *~ gitversion.h + +# Export the current git version if the index file exists, else 000... +gitversion.h: +ifneq ("$(wildcard .git/index)","") + echo "const char *gitversion = \"$(shell git rev-parse HEAD)\";" > $@ +else + echo "const char *gitversion = \"0000000000000000000000000000000000000000\";" > $@ +endif diff --git a/Makefile.Pi.Adafruit b/Makefile.Pi.Adafruit index bbe5dfe..16ecc2f 100644 --- a/Makefile.Pi.Adafruit +++ b/Makefile.Pi.Adafruit @@ -15,12 +15,19 @@ OBJECTS = \ all: MMDVMHost -MMDVMHost: $(OBJECTS) +MMDVMHost: gitversion.h $(OBJECTS) $(CXX) $(OBJECTS) $(CFLAGS) $(LIBS) -o MMDVMHost %.o: %.cpp $(CXX) $(CFLAGS) -c -o $@ $< clean: - $(RM) MMDVMHost *.o *.d *.bak *~ - + $(RM) MMDVMHost *.o *.d *.bak *~ gitversion.h + +# Export the current git version if the index file exists, else 000... +gitversion.h: +ifneq ("$(wildcard .git/index)","") + echo "const char *gitversion = \"$(shell git rev-parse HEAD)\";" > $@ +else + echo "const char *gitversion = \"0000000000000000000000000000000000000000\";" > $@ +endif diff --git a/Makefile.Pi.HD44780 b/Makefile.Pi.HD44780 index a4b9c97..981af5e 100644 --- a/Makefile.Pi.HD44780 +++ b/Makefile.Pi.HD44780 @@ -15,12 +15,19 @@ OBJECTS = \ all: MMDVMHost -MMDVMHost: $(OBJECTS) +MMDVMHost: gitversion.h $(OBJECTS) $(CXX) $(OBJECTS) $(CFLAGS) $(LIBS) -o MMDVMHost %.o: %.cpp $(CXX) $(CFLAGS) -c -o $@ $< clean: - $(RM) MMDVMHost *.o *.d *.bak *~ - + $(RM) MMDVMHost *.o *.d *.bak *~ gitversion.h + +# Export the current git version if the index file exists, else 000... +gitversion.h: +ifneq ("$(wildcard .git/index)","") + echo "const char *gitversion = \"$(shell git rev-parse HEAD)\";" > $@ +else + echo "const char *gitversion = \"0000000000000000000000000000000000000000\";" > $@ +endif diff --git a/Makefile.Pi.OLED b/Makefile.Pi.OLED index 167c739..660fc88 100644 --- a/Makefile.Pi.OLED +++ b/Makefile.Pi.OLED @@ -15,12 +15,19 @@ OBJECTS = \ all: MMDVMHost -MMDVMHost: $(OBJECTS) +MMDVMHost: gitversion.h $(OBJECTS) $(CXX) $(OBJECTS) $(CFLAGS) $(LIBS) -o MMDVMHost %.o: %.cpp $(CXX) $(CFLAGS) -c -o $@ $< clean: - $(RM) MMDVMHost *.o *.d *.bak *~ - + $(RM) MMDVMHost *.o *.d *.bak *~ gitversion.h + +# Export the current git version if the index file exists, else 000... +gitversion.h: +ifneq ("$(wildcard .git/index)","") + echo "const char *gitversion = \"$(shell git rev-parse HEAD)\";" > $@ +else + echo "const char *gitversion = \"0000000000000000000000000000000000000000\";" > $@ +endif diff --git a/Makefile.Pi.PCF8574 b/Makefile.Pi.PCF8574 index e5df3a5..2ea81dd 100644 --- a/Makefile.Pi.PCF8574 +++ b/Makefile.Pi.PCF8574 @@ -15,11 +15,19 @@ OBJECTS = \ all: MMDVMHost -MMDVMHost: $(OBJECTS) +MMDVMHost: gitversion.h $(OBJECTS) $(CXX) $(OBJECTS) $(CFLAGS) $(LIBS) -o MMDVMHost %.o: %.cpp $(CXX) $(CFLAGS) -c -o $@ $< clean: - $(RM) MMDVMHost *.o *.d *.bak *~ + $(RM) MMDVMHost *.o *.d *.bak *~ gitversion.h + +# Export the current git version if the index file exists, else 000... +gitversion.h: +ifneq ("$(wildcard .git/index)","") + echo "const char *gitversion = \"$(shell git rev-parse HEAD)\";" > $@ +else + echo "const char *gitversion = \"0000000000000000000000000000000000000000\";" > $@ +endif diff --git a/Makefile.Solaris b/Makefile.Solaris index a2c74ac..6113fa6 100644 --- a/Makefile.Solaris +++ b/Makefile.Solaris @@ -15,12 +15,19 @@ OBJECTS = \ all: MMDVMHost -MMDVMHost: $(OBJECTS) +MMDVMHost: gitversion.h $(OBJECTS) $(CXX) $(OBJECTS) $(CFLAGS) $(LIBS) -o MMDVMHost %.o: %.cpp $(CXX) $(CFLAGS) -c -o $@ $< clean: - $(RM) MMDVMHost *.o *.d *.bak *~ - + $(RM) MMDVMHost *.o *.d *.bak *~ gitversion.h + +# Export the current git version if the index file exists, else 000... +gitversion.h: +ifneq ("$(wildcard .git/index)","") + echo "const char *gitversion = \"$(shell git rev-parse HEAD)\";" > $@ +else + echo "const char *gitversion = \"0000000000000000000000000000000000000000\";" > $@ +endif From 0898b5c98cd8bfb4016c7a91fd91745b4c5564f4 Mon Sep 17 00:00:00 2001 From: George Smart Date: Fri, 10 Mar 2017 03:06:04 +0000 Subject: [PATCH 2/9] Added Git Version number (Windows MSVS with prebuild script) --- MMDVMHost.vcxproj | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/MMDVMHost.vcxproj b/MMDVMHost.vcxproj index 1c9a25e..ea4eb81 100644 --- a/MMDVMHost.vcxproj +++ b/MMDVMHost.vcxproj @@ -108,6 +108,12 @@ true kernel32.lib;user32.lib;gdi32.lib;winspool.lib;comdlg32.lib;advapi32.lib;shell32.lib;ole32.lib;oleaut32.lib;uuid.lib;odbc32.lib;odbccp32.lib;ws2_32.lib;%(AdditionalDependencies) + + "$(ProjectDir)prebuild.cmd" $(ProjectDir) + + + prebuild.cmd generates GitVersion.h from git refs heads master + From b6cbbc02e3be497600f63caa8e4169b441b9be1a Mon Sep 17 00:00:00 2001 From: George Smart Date: Fri, 10 Mar 2017 03:06:23 +0000 Subject: [PATCH 3/9] Added Git Version number (Windows MSVS with prebuild script) --- prebuild.cmd | 38 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 38 insertions(+) create mode 100644 prebuild.cmd diff --git a/prebuild.cmd b/prebuild.cmd new file mode 100644 index 0000000..c73ceca --- /dev/null +++ b/prebuild.cmd @@ -0,0 +1,38 @@ +@echo off +REM This pre-build file is for MSVS VC++. It parses the git master hash and +REM converts it into GitVersion.h for compiling into builds. [George M1GEO] + +cd %1 +setlocal enabledelayedexpansion +set HEADFILE=.git\HEAD +set HASHFILE=0 +if exist %HEADFILE% ( + for /F "tokens=4 delims=/:" %%a in ('type %HEADFILE%') do set HEADBRANCH=%%a + set HASHFILE=.git\refs\heads\!HEADBRANCH! + echo Found Git HEAD file: %HEADFILE% + echo Git HEAD branch: !HEADBRANCH! + echo Git HASH file: !HASHFILE! + call :USEHASH +) else ( + echo No head file :( + call :USENULL +) + +goto :EOF + +:USENULL +set GITHASH=0000000000000000000000000000000000000000 +goto :WRITEGITVERSIONHEADER + +:USEHASH +for /f %%i in ('type !HASHFILE!') do set GITHASH=%%i +goto :WRITEGITVERSIONHEADER + +:WRITEGITVERSIONHEADER +echo # File contains Git commit ID SHA1 present at buildtime (prebuild.cmd) > GitVersion.h +echo const char *gitversion = "%GITHASH%"; >> GitVersion.h +echo Current Git HASH: %GITHASH% +goto :FINISHED + +:FINISHED +echo GitVersion.h written... From ef89ffe5235caaa4b3f0f0c8e1b490f41a7eec3e Mon Sep 17 00:00:00 2001 From: George Smart Date: Fri, 10 Mar 2017 03:32:00 +0000 Subject: [PATCH 4/9] Fixed typo in generated header file and tested more --- prebuild.cmd | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/prebuild.cmd b/prebuild.cmd index c73ceca..2dc5f9d 100644 --- a/prebuild.cmd +++ b/prebuild.cmd @@ -29,7 +29,7 @@ for /f %%i in ('type !HASHFILE!') do set GITHASH=%%i goto :WRITEGITVERSIONHEADER :WRITEGITVERSIONHEADER -echo # File contains Git commit ID SHA1 present at buildtime (prebuild.cmd) > GitVersion.h +echo // File contains Git commit ID SHA1 present at buildtime (prebuild.cmd) > GitVersion.h echo const char *gitversion = "%GITHASH%"; >> GitVersion.h echo Current Git HASH: %GITHASH% goto :FINISHED From e0b0a3b6d8f3507ed260eb691b202c017d21976e Mon Sep 17 00:00:00 2001 From: George Smart Date: Fri, 10 Mar 2017 04:21:40 +0000 Subject: [PATCH 5/9] corrected case --- .gitignore | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.gitignore b/.gitignore index 158435f..690a1f9 100644 --- a/.gitignore +++ b/.gitignore @@ -15,4 +15,4 @@ MMDVMHost *.VC.db .vs *.ambe -gitversion.h +GitVersion.h From 1cb9db0e4d4d3660aef14b5af0c7175141311c83 Mon Sep 17 00:00:00 2001 From: George Smart Date: Fri, 10 Mar 2017 04:22:33 +0000 Subject: [PATCH 6/9] corrected case --- MMDVMHost.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/MMDVMHost.cpp b/MMDVMHost.cpp index a875ec4..4d9ed6a 100644 --- a/MMDVMHost.cpp +++ b/MMDVMHost.cpp @@ -33,7 +33,7 @@ #include "LCDproc.h" #include "Thread.h" #include "Log.h" -#include "gitversion.h" +#include "GitVersion.h" #if defined(HD44780) #include "HD44780.h" From 41bdb11bf24f630c8adfaa366774d29f380fa718 Mon Sep 17 00:00:00 2001 From: Jonathan Naylor Date: Fri, 10 Mar 2017 08:36:47 +0000 Subject: [PATCH 7/9] Add two DMR issues. --- ISSUES.txt | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/ISSUES.txt b/ISSUES.txt index 9c136d8..5bf6d41 100644 --- a/ISSUES.txt +++ b/ISSUES.txt @@ -2,6 +2,10 @@ D-Star: No obvious issues. DMR: There is an issue where transmitted data (text messages) isn’t picked up as reliably from an MMDVM than (say) a Hytera repeater. In order to address this, I need to see a trace from a Hytera repeater transmitting text, both from cold (no tx) and when already running. The DMRRX receiver from the DV4RX code in my GitHub repository would do the job, provided you have a DV4mini and a repeater within range. +Timeouts aren't handled cleany, i.e. the repeater should go off transmit rather than stay on. + +It seems like there is a need to add some idle frames at the beginning of a DMO transmission in order allow older DMR radios to wake up. + YSF: There is an issue that need addressing: The data sent to aprs.fi from southern hemisphere users isn’t always correct. Maybe the GPS format used by YSF still has some secrets to reveal. P25: No obvious issues. From 6844085db36cb912af436a8f02b840c197e5565b Mon Sep 17 00:00:00 2001 From: Jonathan Naylor Date: Fri, 10 Mar 2017 08:41:56 +0000 Subject: [PATCH 8/9] Updated the copyright dates. --- MMDVMHost.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/MMDVMHost.cpp b/MMDVMHost.cpp index 4d9ed6a..d360992 100644 --- a/MMDVMHost.cpp +++ b/MMDVMHost.cpp @@ -74,7 +74,7 @@ static void sigHandler(int signum) const char* HEADER1 = "This software is for use on amateur radio networks only,"; const char* HEADER2 = "it is to be used for educational purposes only. Its use on"; const char* HEADER3 = "commercial networks is strictly prohibited."; -const char* HEADER4 = "Copyright(C) 2015, 2016 by Jonathan Naylor, G4KLX and others"; +const char* HEADER4 = "Copyright(C) 2015-2017 by Jonathan Naylor, G4KLX and others"; int main(int argc, char** argv) { From 2bc3606ed4ae20d0249ff8c7ca7962b59fad3639 Mon Sep 17 00:00:00 2001 From: phl0 Date: Fri, 10 Mar 2017 11:00:31 +0100 Subject: [PATCH 9/9] Fix case errors with GitVersion.h --- Makefile | 6 +++--- Makefile.Pi | 6 +++--- Makefile.Pi.Adafruit | 6 +++--- Makefile.Pi.HD44780 | 6 +++--- Makefile.Pi.OLED | 6 +++--- Makefile.Pi.PCF8574 | 6 +++--- Makefile.Solaris | 6 +++--- 7 files changed, 21 insertions(+), 21 deletions(-) diff --git a/Makefile b/Makefile index b1f1050..90346af 100644 --- a/Makefile +++ b/Makefile @@ -15,17 +15,17 @@ OBJECTS = \ all: MMDVMHost -MMDVMHost: gitversion.h $(OBJECTS) +MMDVMHost: GitVersion.h $(OBJECTS) $(CXX) $(OBJECTS) $(CFLAGS) $(LIBS) -o MMDVMHost %.o: %.cpp $(CXX) $(CFLAGS) -c -o $@ $< clean: - $(RM) MMDVMHost *.o *.d *.bak *~ gitversion.h + $(RM) MMDVMHost *.o *.d *.bak *~ GitVersion.h # Export the current git version if the index file exists, else 000... -gitversion.h: +GitVersion.h: ifneq ("$(wildcard .git/index)","") echo "const char *gitversion = \"$(shell git rev-parse HEAD)\";" > $@ else diff --git a/Makefile.Pi b/Makefile.Pi index f683ec6..3ac85ad 100644 --- a/Makefile.Pi +++ b/Makefile.Pi @@ -15,17 +15,17 @@ OBJECTS = \ all: MMDVMHost -MMDVMHost: gitversion.h $(OBJECTS) +MMDVMHost: GitVersion.h $(OBJECTS) $(CXX) $(OBJECTS) $(CFLAGS) $(LIBS) -o MMDVMHost %.o: %.cpp $(CXX) $(CFLAGS) -c -o $@ $< clean: - $(RM) MMDVMHost *.o *.d *.bak *~ gitversion.h + $(RM) MMDVMHost *.o *.d *.bak *~ GitVersion.h # Export the current git version if the index file exists, else 000... -gitversion.h: +GitVersion.h: ifneq ("$(wildcard .git/index)","") echo "const char *gitversion = \"$(shell git rev-parse HEAD)\";" > $@ else diff --git a/Makefile.Pi.Adafruit b/Makefile.Pi.Adafruit index 16ecc2f..816f5ad 100644 --- a/Makefile.Pi.Adafruit +++ b/Makefile.Pi.Adafruit @@ -15,17 +15,17 @@ OBJECTS = \ all: MMDVMHost -MMDVMHost: gitversion.h $(OBJECTS) +MMDVMHost: GitVersion.h $(OBJECTS) $(CXX) $(OBJECTS) $(CFLAGS) $(LIBS) -o MMDVMHost %.o: %.cpp $(CXX) $(CFLAGS) -c -o $@ $< clean: - $(RM) MMDVMHost *.o *.d *.bak *~ gitversion.h + $(RM) MMDVMHost *.o *.d *.bak *~ GitVersion.h # Export the current git version if the index file exists, else 000... -gitversion.h: +GitVersion.h: ifneq ("$(wildcard .git/index)","") echo "const char *gitversion = \"$(shell git rev-parse HEAD)\";" > $@ else diff --git a/Makefile.Pi.HD44780 b/Makefile.Pi.HD44780 index 981af5e..13b5688 100644 --- a/Makefile.Pi.HD44780 +++ b/Makefile.Pi.HD44780 @@ -15,17 +15,17 @@ OBJECTS = \ all: MMDVMHost -MMDVMHost: gitversion.h $(OBJECTS) +MMDVMHost: GitVersion.h $(OBJECTS) $(CXX) $(OBJECTS) $(CFLAGS) $(LIBS) -o MMDVMHost %.o: %.cpp $(CXX) $(CFLAGS) -c -o $@ $< clean: - $(RM) MMDVMHost *.o *.d *.bak *~ gitversion.h + $(RM) MMDVMHost *.o *.d *.bak *~ GitVersion.h # Export the current git version if the index file exists, else 000... -gitversion.h: +GitVersion.h: ifneq ("$(wildcard .git/index)","") echo "const char *gitversion = \"$(shell git rev-parse HEAD)\";" > $@ else diff --git a/Makefile.Pi.OLED b/Makefile.Pi.OLED index 660fc88..000de85 100644 --- a/Makefile.Pi.OLED +++ b/Makefile.Pi.OLED @@ -15,17 +15,17 @@ OBJECTS = \ all: MMDVMHost -MMDVMHost: gitversion.h $(OBJECTS) +MMDVMHost: GitVersion.h $(OBJECTS) $(CXX) $(OBJECTS) $(CFLAGS) $(LIBS) -o MMDVMHost %.o: %.cpp $(CXX) $(CFLAGS) -c -o $@ $< clean: - $(RM) MMDVMHost *.o *.d *.bak *~ gitversion.h + $(RM) MMDVMHost *.o *.d *.bak *~ GitVersion.h # Export the current git version if the index file exists, else 000... -gitversion.h: +GitVersion.h: ifneq ("$(wildcard .git/index)","") echo "const char *gitversion = \"$(shell git rev-parse HEAD)\";" > $@ else diff --git a/Makefile.Pi.PCF8574 b/Makefile.Pi.PCF8574 index 2ea81dd..9164dab 100644 --- a/Makefile.Pi.PCF8574 +++ b/Makefile.Pi.PCF8574 @@ -15,17 +15,17 @@ OBJECTS = \ all: MMDVMHost -MMDVMHost: gitversion.h $(OBJECTS) +MMDVMHost: GitVersion.h $(OBJECTS) $(CXX) $(OBJECTS) $(CFLAGS) $(LIBS) -o MMDVMHost %.o: %.cpp $(CXX) $(CFLAGS) -c -o $@ $< clean: - $(RM) MMDVMHost *.o *.d *.bak *~ gitversion.h + $(RM) MMDVMHost *.o *.d *.bak *~ GitVersion.h # Export the current git version if the index file exists, else 000... -gitversion.h: +GitVersion.h: ifneq ("$(wildcard .git/index)","") echo "const char *gitversion = \"$(shell git rev-parse HEAD)\";" > $@ else diff --git a/Makefile.Solaris b/Makefile.Solaris index 6113fa6..7136c1a 100644 --- a/Makefile.Solaris +++ b/Makefile.Solaris @@ -15,17 +15,17 @@ OBJECTS = \ all: MMDVMHost -MMDVMHost: gitversion.h $(OBJECTS) +MMDVMHost: GitVersion.h $(OBJECTS) $(CXX) $(OBJECTS) $(CFLAGS) $(LIBS) -o MMDVMHost %.o: %.cpp $(CXX) $(CFLAGS) -c -o $@ $< clean: - $(RM) MMDVMHost *.o *.d *.bak *~ gitversion.h + $(RM) MMDVMHost *.o *.d *.bak *~ GitVersion.h # Export the current git version if the index file exists, else 000... -gitversion.h: +GitVersion.h: ifneq ("$(wildcard .git/index)","") echo "const char *gitversion = \"$(shell git rev-parse HEAD)\";" > $@ else