Index: Makefile.openbsd =================================================================== RCS file: Makefile.openbsd diff -N Makefile.openbsd --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ Makefile.openbsd 15 Feb 2014 05:48:57 -0000 @@ -0,0 +1,277 @@ +# +# Makefile for Linux version of Dire Wolf. +# + +all : direwolf decode_aprs text2tt tt2text ll2utm utm2ll aclients + +CC = gcc + +# +# On Linux, you have a choice of using either OSS or ALSA +# sound systems depending on what is supported on your platform. +# ALSA is newer and the the default as shown below. +# Remove "-DUSE_ALSA" if you prefer to use OSS. +# + +# +# The DSP filters can be sped up considerably with the SSE +# instructions. The SSE instructions were introduced in 1999 +# with the Pentium III series. +# SSE2 instructions, added in 2000, don't seem to offer any advantage. +# +# Let's look at impact of various optimization levels. +# +# Benchmark results with Ubuntu gcc version 4.6.3, 32 bit platform. +# Intel(R) Celeron(R) CPU 2.53GHz. Appears to have only 32 bit instructions. +# +# seconds options, comments +# ------ ----------------- +# 123 -O2 +# 128 -O3 Slower than -O2 ? +# 123 -Ofast (should be same as -O3 -ffastmath) +# 126 -Ofast -march=pentium +# 88 -Ofast -msse +# 108 -Ofast -march=pentium -msse +# 88 -Ofast -march=pentium3 (this implies -msse) +# 89 -Ofast -march=pentium3 -msse +# +# +# Raspberry Pi, ARM11 (ARMv6 + VFP2) +# gcc (Debian 4.6.3-14+rpi1) 4.6.3 +# +# seconds options, comments +# ------ ----------------- +# 1015 -O2 +# 948 -O3 +# 928 -Ofast +# 937 -Ofast -fmpu=vfp (worse, no option for vfp2) +# +# Are we getting any vectorizing? +# + + + +# +# Release 0.9 added a new feature than can consume a lot of CPU +# power: multiple AFSK demodulators running in parallel. +# These spend a lot of time spinning around in little loops +# calculating the sums of products for the DSP filters. +# +# When gcc is generating code for a 32 bit x86 target, it +# assumes the ancient i386 processor. This is good for +# portability but bad for performance. +# +# The code can run considerably faster by taking advantage of +# the SSE instructions available in the Pentium 3 or later. +# Here we find out if the gcc compiler is generating code +# for the i386. If so, we add the option to assume we will +# have at least a Pentium 3 to run on. +# +# When generating code for the x86_64 target, it is automatically +# assumed that the SSE instructions are available. +# +# If you are using gcc version 4.6 or later, you might get a +# small improvement by using the new "-Ofast" option that is +# not available in older compilers. +# "-O3" is used here for compatibility with older compilers. +# +# You might also get some improvement by using "-march=native" +# to fine tune the application for your particular type of +# hardware. +# +# If you are planning to distribute the binary version to +# other people (in some ham radio software collection), avoid +# fine tuning it for your particular computer. It could +# cause compatibility issues for those with older computers. +# + +arch := $(shell echo | gcc -E -dM - | grep __i386__) + +ifneq ($(arch),) +CFLAGS := -O3 -march=k8 -pthread +else +CFLAGS := -O3 -pthread +endif + + +# Name of current directory. +# Used to generate zip file name for distribution. + +z=$(notdir ${CURDIR}) + + +# Main application. + +direwolf : direwolf.o config.o fsk_gen_filter.o fsk_demod.o hdlc_rec.o \ + hdlc_rec2.o multi_modem.o redecode.o rdq.o rrbb.o \ + fcs_calc.o ax25_pad.o \ + decode_aprs.o server.o kiss.o kissnet.o kiss_frame.o hdlc_send.o fcs_calc.o \ + gen_tone.o audio.o digipeater.o dedupe.o tq.o xmit.o \ + ptt.o beacon.o textcolor.o \ + dtmf.o aprs_tt.o tt_user.o tt_text.o igate.o \ + utm.a + $(CC) $(CFLAGS) -o $@ $^ -lpthread -lm -lossaudio + + +# Optimization for slow processors. + +fsk_demod.c : fsk_fast_filter.h + +fsk_fast_filter.h : fsk_gen_filter.c + $(CC) $(CFLAGS) -o gen_fff -DGEN_FFF fsk_gen_filter.c textcolor.c -lm + ./gen_fff > fsk_fast_filter.h + + + +utm.a : LatLong-UTMconversion.o + ar -cr $@ $^ + +LatLong-UTMconversion.o : utm/LatLong-UTMconversion.c + $(CC) $(CFLAGS) -c -o $@ $^ + + +# Optional install step. +# TODO: Review file locations. +# TODO: Handle Linux variations correctly. +# The Raspberry Pi has ~/Desktop but Ubuntu does not. +# For now, just put reference to it at the end so only last step fails. + +install : direwolf decode_aprs tocalls.txt dw-icon.png direwolf.desktop + sudo install direwolf /usr/local/bin + sudo install decode_aprs /usr/local/bin + sudo install text2tt /usr/local/bin + sudo install tt2text /usr/local/bin + sudo install ll2utm /usr/local/bin + sudo install utm2ll /usr/local/bin + sudo install aclients /usr/local/bin + sudo install -D --mode=644 tocalls.txt /usr/share/direwolf/tocalls.txt + sudo install -D --mode=644 dw-icon.png /usr/share/direwolf/dw-icon.png + sudo install -D --mode=644 direwolf.desktop /usr/share/applications/direwolf.desktop + cp direwolf.conf ~ + cp dw-start.sh ~ + sudo install -D --mode=644 CHANGES.txt /usr/local/share/doc/direwolf/CHANGES.txt + sudo install -D --mode=644 LICENSE-dire-wolf.txt /usr/local/share/doc/direwolf/LICENSE-dire-wolf.txt + sudo install -D --mode=644 LICENSE-other.txt /usr/local/share/doc/direwolf/LICENSE-other.txt + sudo install -D --mode=644 User-Guide.pdf /usr/local/share/doc/direwolf/User-Guide.pdf + sudo install -D --mode=644 Raspberry-Pi-APRS.pdf /usr/local/share/doc/direwolf/Raspberry-Pi-APRS.pdf + sudo install -D --mode=644 APRStt-Implementation-Notes.pdf /usr/local/share/doc/direwolf/APRStt-Implementation-Notes.pdf + sudo install -D --mode=644 Quick-Start-Guide-Windows.pdf /usr/local/share/doc/direwolf/Quick-Start-Guide-Windows.pdf + ln -f -s /usr/share/applications/direwolf.desktop ~/Desktop/direwolf.desktop + + +# Separate application to decode raw data. + +decode_aprs : decode_aprs.c ax25_pad.c textcolor.c fcs_calc.c + $(CC) $(CFLAGS) -o decode_aprs -DTEST $^ -lm + + + +# Convert between text and touch tone representation. + +text2tt : tt_text.c + $(CC) $(CFLAGS) -DENC_MAIN -o text2tt tt_text.c + +tt2text : tt_text.c + $(CC) $(CFLAGS) -DDEC_MAIN -o tt2text tt_text.c + + +# Convert between Latitude/Longitude and UTM coordinates. + +ll2utm : ll2utm.c utm.a + $(CC) $(CFLAGS) -I utm -o $@ $^ -lm + +utm2ll : utm2ll.c utm.a + $(CC) $(CFLAGS) -I utm -o $@ $^ -lm + + + +# Test application to generate sound. + +gen_packets : gen_packets.o ax25_pad.o hdlc_send.o fcs_calc.o gen_tone.o \ + audio.o + $(CC) $(CFLAGS) -o $@ $^ + +fsk_demod.o : fsk_demod_agc.h +fsk_gen_filter.o : fsk_demod_agc.h + +testagc : atest.c fsk_demod.c hdlc_rec.c hdlc_rec2.o multi_modem.o rrbb.o fcs_calc.c ax25_pad.c decode_aprs.c fsk_demod_agc.h textcolor.c + $(CC) $(CFLAGS) -o atest $^ -lm + ./atest 02_Track_2.wav | grep "packets decoded in" > atest.out + + +# Unit test for AFSK demodulator + + +atest : atest.c fsk_gen_filter.c fsk_demod.c hdlc_rec.c hdlc_rec2.o multi_modem.o rrbb.o fcs_calc.c ax25_pad.c decode_aprs.c textcolor.c + $(CC) $(CFLAGS) -o $@ $^ -lm + time ./atest ../direwolf-0.2/02_Track_2.wav + +# Unit test for inner digipeater algorithm + + +dtest : digipeater.c ax25_pad.c dedupe.c fcs_calc.c tq.c textcolor.c + $(CC) $(CFLAGS) -DTEST -o $@ $^ + ./dtest + + +# Unit test for IGate + + +itest : igate.c textcolor.c ax25_pad.c fcs_calc.c + $(CC) $(CFLAGS) -DITEST -o $@ $^ + ./itest + + +# Multiple AGWPE network or serial port clients to test TNCs side by side. + +aclients : aclients.c ax25_pad.c fcs_calc.c textcolor.c + $(CC) $(CFLAGS) -g -o $@ $^ + + +SRCS = direwolf.c fsk_gen_filter.o fsk_demod.c hdlc_rec.c multi_modem.c fcs_calc.c ax25_pad.c decode_aprs.c \ + server.c kiss.c kissnet.c kiss_frame.c hdlc_send.c fcs_calc.c gen_tone.c audio.c \ + digipeater.c dedupe.c tq.c xmit.c beacon.c + + +depend : $(SRCS) + makedepend $(INCLUDES) $^ + + +clean : + rm -f direwolf decode_aprs text2tt tt2text ll2utm utm2ll fsk_fast_filter.h *.o *.a + echo " " > fsk_demod_agc.h + + +# Package it up for distribution. + +dist-src : CHANGES.txt User-Guide.pdf Quick-Start-Guide-Windows.pdf Raspberry-Pi-APRS.pdf \ + direwolf.desktop dw-start.sh + rm -f fsk_fast_filter.h + echo " " > fsk_demod_agc.h + rm -f ../$z-src.zip + (cd .. ; zip $z-src.zip $z/CHANGES.txt $z/LICENSE* \ + $z/User-Guide.pdf $z/Quick-Start-Guide-Windows.pdf $z/Raspberry-Pi-APRS.pdf \ + $z/Makefile* $z/*.c $z/*.h $z/regex/* $z/misc/* $z/utm/* \ + $z/*.conf $z/tocalls.txt $z/dw-icon.png $z/dw-icon.rc $z/dw-icon.ico \ + $z/direwolf.desktop $z/dw-start.sh ) + + +#User-Guide.pdf : User-Guide.docx +# echo "***** User-Guide.pdf is out of date *****" + +#Quick-Start-Guide-Windows.pdf : Quick-Start-Guide-Windows.docx +# echo "***** Quick-Start-Guide-Windows.pdf is out of date *****" + +#Raspberry-Pi-APRS.pdf : Raspberry-Pi-APRS.docx +# echo "***** Raspberry-Pi-APRS.pdf is out of date *****" + + +backup : + mkdir /cygdrive/e/backup-cygwin-home/`date +"%Y-%m-%d"` + cp -r . /cygdrive/e/backup-cygwin-home/`date +"%Y-%m-%d"` + +# +# The following is updated by "make depend" +# +# DO NOT DELETE + Index: aprs_tt.h =================================================================== RCS file: /users/gabucino/src2/cvsroot/direwolf/aprs_tt.h,v retrieving revision 1.2 diff -u -r1.2 aprs_tt.h --- aprs_tt.h 15 Feb 2014 05:25:19 -0000 1.2 +++ aprs_tt.h 15 Feb 2014 05:44:36 -0000 @@ -97,4 +97,4 @@ #endif -/* end aprs_tt.h */ \ No newline at end of file +/* end aprs_tt.h */ Index: audio.c =================================================================== RCS file: /users/gabucino/src2/cvsroot/direwolf/audio.c,v retrieving revision 1.2 diff -u -r1.2 audio.c --- audio.c 15 Feb 2014 05:25:19 -0000 1.2 +++ audio.c 15 Feb 2014 05:40:27 -0000 @@ -65,8 +65,12 @@ #include #else +#ifdef __OpenBSD__ +#include +#else #include #endif +#endif #include "direwolf.h" #include "audio.h" Index: audio.h =================================================================== RCS file: /users/gabucino/src2/cvsroot/direwolf/audio.h,v retrieving revision 1.2 diff -u -r1.2 audio.h --- audio.h 15 Feb 2014 05:25:19 -0000 1.2 +++ audio.h 15 Feb 2014 05:51:39 -0000 @@ -121,7 +121,7 @@ /* 44100 works a little better than 22050. */ /* If you have a reasonable machine, use the highest rate. */ #define MIN_SAMPLES_PER_SEC 8000 -#define MAX_SAMPLES_PER_SEC 44100 +#define MAX_SAMPLES_PER_SEC 48000 #define DEFAULT_BITS_PER_SAMPLE 16 Index: beacon.c =================================================================== RCS file: /users/gabucino/src2/cvsroot/direwolf/beacon.c,v retrieving revision 1.1.1.1 diff -u -r1.1.1.1 beacon.c --- beacon.c 3 Oct 2013 06:23:54 -0000 1.1.1.1 +++ beacon.c 15 Feb 2014 05:45:37 -0000 @@ -227,4 +227,4 @@ } /* end beacon_thread */ -/* end beacon.c */ \ No newline at end of file +/* end beacon.c */ Index: config.c =================================================================== RCS file: /users/gabucino/src2/cvsroot/direwolf/config.c,v retrieving revision 1.2 diff -u -r1.2 config.c --- config.c 15 Feb 2014 05:25:20 -0000 1.2 +++ config.c 15 Feb 2014 05:44:43 -0000 @@ -2059,4 +2059,4 @@ } /* end config_init */ -/* end config.c */ \ No newline at end of file +/* end config.c */ Index: direwolf.c =================================================================== RCS file: /users/gabucino/src2/cvsroot/direwolf/direwolf.c,v retrieving revision 1.2 diff -u -r1.2 direwolf.c --- direwolf.c 15 Feb 2014 05:25:20 -0000 1.2 +++ direwolf.c 12 Feb 2014 14:40:42 -0000 @@ -49,7 +49,11 @@ #include #include #include +#ifdef __OpenBSD__ +#include +#else #include +#endif #include #include #include Index: direwolf.h =================================================================== RCS file: /users/gabucino/src2/cvsroot/direwolf/direwolf.h,v retrieving revision 1.2 diff -u -r1.2 direwolf.h --- direwolf.h 15 Feb 2014 05:25:21 -0000 1.2 +++ direwolf.h 15 Feb 2014 05:44:36 -0000 @@ -36,4 +36,4 @@ #include "pthreads/pthread.h" #else #include -#endif \ No newline at end of file +#endif Index: fsk_demod.h =================================================================== RCS file: /users/gabucino/src2/cvsroot/direwolf/fsk_demod.h,v retrieving revision 1.2 diff -u -r1.2 fsk_demod.h --- fsk_demod.h 15 Feb 2014 05:25:21 -0000 1.2 +++ fsk_demod.h 15 Feb 2014 05:44:36 -0000 @@ -10,4 +10,4 @@ void fsk_demod_print_agc (int chan, int subchan); -int fsk_demod_get_audio_level (int chan, int subchan); \ No newline at end of file +int fsk_demod_get_audio_level (int chan, int subchan); Index: fsk_demod_state.h =================================================================== RCS file: /users/gabucino/src2/cvsroot/direwolf/fsk_demod_state.h,v retrieving revision 1.2 diff -u -r1.2 fsk_demod_state.h --- fsk_demod_state.h 15 Feb 2014 05:25:21 -0000 1.2 +++ fsk_demod_state.h 15 Feb 2014 05:44:36 -0000 @@ -161,4 +161,4 @@ }; #define FSK_DEMOD_STATE_H 1 -#endif \ No newline at end of file +#endif Index: fsk_gen_filter.c =================================================================== RCS file: /users/gabucino/src2/cvsroot/direwolf/fsk_gen_filter.c,v retrieving revision 1.2 diff -u -r1.2 fsk_gen_filter.c --- fsk_gen_filter.c 15 Feb 2014 05:25:21 -0000 1.2 +++ fsk_gen_filter.c 15 Feb 2014 05:44:55 -0000 @@ -558,4 +558,4 @@ #endif -/* end fsk_gen_filters.c */ \ No newline at end of file +/* end fsk_gen_filters.c */ Index: fsk_gen_filter.h =================================================================== RCS file: /users/gabucino/src2/cvsroot/direwolf/fsk_gen_filter.h,v retrieving revision 1.2 diff -u -r1.2 fsk_gen_filter.h --- fsk_gen_filter.h 15 Feb 2014 05:25:21 -0000 1.2 +++ fsk_gen_filter.h 15 Feb 2014 05:44:36 -0000 @@ -12,4 +12,4 @@ char profile, struct demodulator_state_s *D); -#endif \ No newline at end of file +#endif Index: gen_fff =================================================================== RCS file: /users/gabucino/src2/cvsroot/direwolf/gen_fff,v retrieving revision 1.1 diff -u -r1.1 gen_fff Binary files /tmp/cvsWIneDE and gen_fff differ Index: hdlc_send.c =================================================================== RCS file: /users/gabucino/src2/cvsroot/direwolf/hdlc_send.c,v retrieving revision 1.2 diff -u -r1.2 hdlc_send.c --- hdlc_send.c 15 Feb 2014 05:25:22 -0000 1.2 +++ hdlc_send.c 15 Feb 2014 05:46:00 -0000 @@ -212,4 +212,4 @@ number_of_bits_sent++; } -/* end hdlc_send.c */ \ No newline at end of file +/* end hdlc_send.c */ Index: kiss.c =================================================================== RCS file: /users/gabucino/src2/cvsroot/direwolf/kiss.c,v retrieving revision 1.2 diff -u -r1.2 kiss.c --- kiss.c 15 Feb 2014 05:25:23 -0000 1.2 +++ kiss.c 15 Feb 2014 05:38:41 -0000 @@ -129,8 +129,12 @@ #include #include #include +#ifdef __OpenBSD__ +#include +#else #include #endif +#endif #include #include Index: kiss_frame.h =================================================================== RCS file: /users/gabucino/src2/cvsroot/direwolf/kiss_frame.h,v retrieving revision 1.1.1.1 diff -u -r1.1.1.1 kiss_frame.h --- kiss_frame.h 3 Oct 2013 06:23:56 -0000 1.1.1.1 +++ kiss_frame.h 15 Feb 2014 05:44:36 -0000 @@ -44,4 +44,4 @@ void kiss_debug_print (fromto_t fromto, char *special, unsigned char *pmsg, int msg_len); -/* end kiss_frame.h */ \ No newline at end of file +/* end kiss_frame.h */ Index: rrbb.h =================================================================== RCS file: /users/gabucino/src2/cvsroot/direwolf/rrbb.h,v retrieving revision 1.2 diff -u -r1.2 rrbb.h --- rrbb.h 15 Feb 2014 05:25:24 -0000 1.2 +++ rrbb.h 15 Feb 2014 05:44:36 -0000 @@ -71,4 +71,4 @@ int rrbb_get_audio_level (rrbb_t b); -#endif \ No newline at end of file +#endif Index: textcolor.h =================================================================== RCS file: /users/gabucino/src2/cvsroot/direwolf/textcolor.h,v retrieving revision 1.1.1.1 diff -u -r1.1.1.1 textcolor.h --- textcolor.h 3 Oct 2013 06:23:58 -0000 1.1.1.1 +++ textcolor.h 15 Feb 2014 05:44:36 -0000 @@ -40,4 +40,4 @@ //#define CH_DEGREE "\0xb0" /* ISO Latin 1. */ //#define CH_DEGREE "\0xc2\0xb0" /* With UTF-8. */ -#endif \ No newline at end of file +#endif Index: tt_text.h =================================================================== RCS file: /users/gabucino/src2/cvsroot/direwolf/tt_text.h,v retrieving revision 1.1.1.1 diff -u -r1.1.1.1 tt_text.h --- tt_text.h 3 Oct 2013 06:23:58 -0000 1.1.1.1 +++ tt_text.h 15 Feb 2014 05:44:36 -0000 @@ -14,4 +14,4 @@ int tt_two_key_to_text (char *buttons, int quiet, char *text); -/* end tt_text.h */ \ No newline at end of file +/* end tt_text.h */ Index: tt_user.h =================================================================== RCS file: /users/gabucino/src2/cvsroot/direwolf/tt_user.h,v retrieving revision 1.1 diff -u -r1.1 tt_user.h --- tt_user.h 15 Feb 2014 05:25:25 -0000 1.1 +++ tt_user.h 15 Feb 2014 05:44:36 -0000 @@ -7,4 +7,4 @@ int tt_user_heard (char *callsign, int ssid, char overlay, char symbol, double latitude, double longitude, char *freq, char *comment, char mic_e, char *dao); -void tt_user_background (void); \ No newline at end of file +void tt_user_background (void);