├── .gitattributes ├── .github └── workflows │ ├── ci.yml │ ├── codeql-analysis-python.yml │ └── codeql-analysis.yml ├── .gitignore ├── CHANGES.md ├── CMakeLists.txt ├── LICENSE ├── Makefile ├── README.md ├── cmake ├── cpack │ ├── CMakeLists.txt │ ├── direwolf.desktop.in │ ├── direwolf.rc │ ├── direwolf_icon.ico │ └── direwolf_icon.png ├── cpu_tests │ ├── test_arm_neon.cxx │ ├── test_x86_avx.cxx │ ├── test_x86_avx2.cxx │ ├── test_x86_avx512.cxx │ ├── test_x86_sse2.cxx │ ├── test_x86_sse3.cxx │ ├── test_x86_sse41.cxx │ ├── test_x86_sse42.cxx │ └── test_x86_ssse3.cxx ├── include │ └── uninstall.cmake.in └── modules │ ├── FindAvahi.cmake │ ├── FindCPUflags.cmake │ ├── FindCompiler.cmake │ ├── FindGPSD.cmake │ ├── FindPortaudio.cmake │ ├── Findhamlib.cmake │ ├── Findsndio.cmake │ └── Findudev.cmake ├── conf ├── 99-direwolf-cmedia.rules ├── CMakeLists.txt ├── generic.conf ├── install_conf.cmake └── sdr.conf ├── data ├── CMakeLists.txt ├── symbols-new.txt ├── symbolsX.txt └── tocalls.txt ├── debian ├── README.Debian ├── changelog ├── compat ├── control ├── copyright ├── direwolf.postinst ├── direwolf.postrm ├── rules └── source │ └── format ├── direwolf-block-diagram.png ├── doc ├── 2400-4800-PSK-for-APRS-Packet-Radio.pdf ├── A-Better-APRS-Packet-Demodulator-Part-1-1200-baud.pdf ├── A-Better-APRS-Packet-Demodulator-Part-2-9600-baud.pdf ├── A-Closer-Look-at-the-WA8LMF-TNC-Test-CD.pdf ├── AIS-Reception.pdf ├── APRS-Telemetry-Toolkit.pdf ├── APRStt-Implementation-Notes.pdf ├── APRStt-Listening-Example.pdf ├── APRStt-interface-for-SARTrack.pdf ├── AX25_plus_FEC_equals_FX25.pdf ├── Bluetooth-KISS-TNC.pdf ├── CMakeLists.txt ├── Going-beyond-9600-baud.pdf ├── README.md ├── Raspberry-Pi-APRS-Tracker.pdf ├── Raspberry-Pi-APRS.pdf ├── Raspberry-Pi-SDR-IGate.pdf ├── Successful-APRS-IGate-Operation.pdf ├── User-Guide.pdf ├── WA8LMF-TNC-Test-CD-Results.pdf └── Why-is-9600-only-twice-as-fast-as-1200.pdf ├── external ├── LICENSE ├── geotranz │ ├── CMakeLists.txt │ ├── README-FIRST.txt │ ├── error_string.c │ ├── error_string.h │ ├── mgrs.c │ ├── mgrs.h │ ├── polarst.c │ ├── polarst.h │ ├── readme.txt │ ├── releasenotes.txt │ ├── tranmerc.c │ ├── tranmerc.h │ ├── ups.c │ ├── ups.h │ ├── usng.c │ ├── usng.h │ ├── utm.c │ └── utm.h ├── hidapi │ ├── CMakeLists.txt │ ├── LICENSE-bsd.txt │ ├── LICENSE-gpl3.txt │ ├── LICENSE-orig.txt │ ├── LICENSE.txt │ ├── README.md │ ├── hid.c │ └── hidapi.h ├── misc │ ├── CMakeLists.txt │ ├── README │ ├── strcasestr.c │ ├── strlcat.c │ ├── strlcpy.c │ ├── strsep.c │ └── strtok_r.c └── regex │ ├── CMakeLists.txt │ ├── COPYING │ ├── INSTALL │ ├── LICENSES │ ├── NEWS │ ├── README │ ├── README-dire-wolf.txt │ ├── re_comp.h │ ├── regcomp.c │ ├── regex.c │ ├── regex.h │ ├── regex_internal.c │ ├── regex_internal.h │ └── regexec.c ├── fx25.png ├── man ├── CMakeLists.txt ├── aclients.1 ├── atest.1 ├── decode_aprs.1 ├── direwolf.1 ├── gen_packets.1 ├── kissutil.1 ├── ll2utm.1 ├── log2gpx.1 ├── text2tt.1 ├── tt2text.1 └── utm2ll.1 ├── rpm └── direwolf.spec ├── scripts ├── CMakeLists.txt ├── dw-start.sh ├── dwespeak.bat ├── dwespeak.sh └── telemetry-toolkit │ ├── CMakeLists.txt │ ├── telem-balloon.conf │ ├── telem-balloon.pl │ ├── telem-bits.pl │ ├── telem-data.pl │ ├── telem-data91.pl │ ├── telem-eqns.pl │ ├── telem-m0xer-3.txt │ ├── telem-parm.pl │ ├── telem-seq.sh │ ├── telem-unit.pl │ ├── telem-volts.conf │ └── telem-volts.py ├── src ├── CMakeLists.txt ├── aclients.c ├── agwlib.c ├── agwlib.h ├── ais.c ├── ais.h ├── appserver.c ├── aprs_tt.c ├── aprs_tt.h ├── atest.c ├── audio.c ├── audio.h ├── audio_portaudio.c ├── audio_stats.c ├── audio_stats.h ├── audio_win.c ├── ax25_link.c ├── ax25_link.h ├── ax25_pad.c ├── ax25_pad.h ├── ax25_pad2.c ├── ax25_pad2.h ├── beacon.c ├── beacon.h ├── cdigipeater.c ├── cdigipeater.h ├── cm108.c ├── cm108.h ├── config.c ├── config.h ├── decode_aprs.c ├── decode_aprs.h ├── dedupe.c ├── dedupe.h ├── demod.c ├── demod.h ├── demod_9600.c ├── demod_9600.h ├── demod_afsk.c ├── demod_afsk.h ├── demod_psk.c ├── demod_psk.h ├── digipeater.c ├── digipeater.h ├── direwolf.c ├── direwolf.h ├── dlq.c ├── dlq.h ├── dns_sd_avahi.c ├── dns_sd_common.c ├── dns_sd_common.h ├── dns_sd_dw.h ├── dns_sd_macos.c ├── dsp.c ├── dsp.h ├── dtime_now.c ├── dtime_now.h ├── dtmf.c ├── dtmf.h ├── dwgps.c ├── dwgps.h ├── dwgpsd.c ├── dwgpsd.h ├── dwgpsnmea.c ├── dwgpsnmea.h ├── dwsock.c ├── dwsock.h ├── encode_aprs.c ├── encode_aprs.h ├── fcs_calc.c ├── fcs_calc.h ├── fsk_demod_state.h ├── fsk_filters.h ├── fsk_gen_filter.h ├── fx25.h ├── fx25_auto.c ├── fx25_encode.c ├── fx25_extract.c ├── fx25_init.c ├── fx25_rec.c ├── fx25_send.c ├── gen_packets.c ├── gen_tone.c ├── gen_tone.h ├── grm_sym.h ├── hdlc_rec.c ├── hdlc_rec.h ├── hdlc_rec2.c ├── hdlc_rec2.h ├── hdlc_send.c ├── hdlc_send.h ├── igate.c ├── igate.h ├── il2p.h ├── il2p_codec.c ├── il2p_header.c ├── il2p_init.c ├── il2p_payload.c ├── il2p_rec.c ├── il2p_scramble.c ├── il2p_send.c ├── il2p_test.c ├── kiss.c ├── kiss.h ├── kiss_frame.c ├── kiss_frame.h ├── kissnet.c ├── kissnet.h ├── kissserial.c ├── kissserial.h ├── kissutil.c ├── latlong.c ├── latlong.h ├── ll2utm.c ├── log.c ├── log.h ├── log2gpx.c ├── mgn_icon.h ├── mheard.c ├── mheard.h ├── morse.c ├── morse.h ├── multi_modem.c ├── multi_modem.h ├── pfilter.c ├── pfilter.h ├── ptt.c ├── ptt.h ├── recv.c ├── recv.h ├── redecode.h ├── rpack.h ├── rrbb.c ├── rrbb.h ├── serial_port.c ├── serial_port.h ├── server.c ├── server.h ├── symbols.c ├── symbols.h ├── telemetry.c ├── telemetry.h ├── textcolor.c ├── textcolor.h ├── tnctest.c ├── tq.c ├── tq.h ├── tt_text.c ├── tt_text.h ├── tt_user.c ├── tt_user.h ├── ttcalc.c ├── tune.h ├── utm2ll.c ├── version.h ├── walk96.c ├── waypoint.c ├── waypoint.h ├── xid.c ├── xid.h ├── xmit.c └── xmit.h ├── systemd ├── direwolf.logrotate ├── direwolf.service └── direwolf.sysconfig ├── test ├── CMakeLists.txt └── scripts │ ├── check-fx25 │ ├── check-il2p │ ├── check-modem1200 │ ├── check-modem1200-i │ ├── check-modem19200 │ ├── check-modem2400-a │ ├── check-modem2400-b │ ├── check-modem2400-g │ ├── check-modem300 │ ├── check-modem4800 │ ├── check-modem9600 │ ├── check-modem9600-i │ └── check-modemeas └── tnc-test-cd-results.png /.gitattributes: -------------------------------------------------------------------------------- 1 | # Auto detect text files and perform LF normalization 2 | * text=auto 3 | 4 | # Custom for Visual Studio 5 | *.cs diff=csharp 6 | 7 | # Standard to msysgit 8 | *.doc diff=astextplain 9 | *.DOC diff=astextplain 10 | *.docx diff=astextplain 11 | *.DOCX diff=astextplain 12 | *.dot diff=astextplain 13 | *.DOT diff=astextplain 14 | *.pdf diff=astextplain 15 | *.PDF diff=astextplain 16 | *.rtf diff=astextplain 17 | *.RTF diff=astextplain 18 | 19 | # My rules to remove any doubt 20 | 21 | *.c text 22 | *.cpp text 23 | *.h text 24 | *.pl text 25 | *.py text 26 | *.sh text 27 | *.txt text 28 | *.desktop text 29 | *.conf text 30 | *.rc text 31 | *.spec text 32 | *.bat text 33 | *.1 text 34 | *.md text 35 | COPYING text 36 | Makefile* text 37 | README* text 38 | 39 | *.ico binary 40 | *.png binary 41 | 42 | -------------------------------------------------------------------------------- /.github/workflows/codeql-analysis-python.yml: -------------------------------------------------------------------------------- 1 | # For most projects, this workflow file will not need changing; you simply need 2 | # to commit it to your repository. 3 | # 4 | # You may wish to alter this file to override the set of languages analyzed, 5 | # or to provide custom queries or build logic. 6 | # 7 | # ******** NOTE ******** 8 | # We have attempted to detect the languages in your repository. Please check 9 | # the `language` matrix defined below to confirm you have the correct set of 10 | # supported CodeQL languages. 11 | # 12 | name: "CodeQL - Python" 13 | 14 | on: 15 | push: 16 | branches: [ dev ] 17 | pull_request: 18 | # The branches below must be a subset of the branches above 19 | branches: [ dev ] 20 | schedule: 21 | - cron: '25 8 * * 4' 22 | 23 | jobs: 24 | analyze: 25 | name: Analyze 26 | runs-on: ubuntu-latest 27 | permissions: 28 | actions: read 29 | contents: read 30 | security-events: write 31 | 32 | strategy: 33 | fail-fast: false 34 | matrix: 35 | language: [ 'python' ] 36 | # CodeQL supports [ 'cpp', 'csharp', 'go', 'java', 'javascript', 'python', 'ruby' ] 37 | # Learn more about CodeQL language support at https://git.io/codeql-language-support 38 | 39 | steps: 40 | - name: Checkout repository 41 | uses: actions/checkout@v3 42 | 43 | # Initializes the CodeQL tools for scanning. 44 | - name: Initialize CodeQL 45 | uses: github/codeql-action/init@v3 46 | with: 47 | languages: ${{ matrix.language }} 48 | setup-python-dependencies: true 49 | # If you wish to specify custom queries, you can do so here or in a config file. 50 | # By default, queries listed here will override any specified in a config file. 51 | # Prefix the list here with "+" to use these queries and those in the config file. 52 | # queries: ./path/to/local/query, your-org/your-repo/queries@main 53 | 54 | # Autobuild attempts to build any compiled languages (C/C++, C#, or Java). 55 | # If this step fails, then you should remove it and run the build manually (see below) 56 | - name: Autobuild 57 | uses: github/codeql-action/autobuild@v3 58 | 59 | # ℹ️ Command-line programs to run using the OS shell. 60 | # 📚 https://git.io/JvXDl 61 | 62 | 63 | - name: Perform CodeQL Analysis 64 | uses: github/codeql-action/analyze@v3 65 | -------------------------------------------------------------------------------- /.github/workflows/codeql-analysis.yml: -------------------------------------------------------------------------------- 1 | # For most projects, this workflow file will not need changing; you simply need 2 | # to commit it to your repository. 3 | # 4 | # You may wish to alter this file to override the set of languages analyzed, 5 | # or to provide custom queries or build logic. 6 | # 7 | # ******** NOTE ******** 8 | # We have attempted to detect the languages in your repository. Please check 9 | # the `language` matrix defined below to confirm you have the correct set of 10 | # supported CodeQL languages. 11 | # 12 | name: "CodeQL - CPP" 13 | 14 | on: 15 | push: 16 | branches: [ dev ] 17 | pull_request: 18 | # The branches below must be a subset of the branches above 19 | branches: [ dev ] 20 | schedule: 21 | - cron: '25 8 * * 4' 22 | 23 | jobs: 24 | analyze: 25 | name: Analyze 26 | runs-on: ubuntu-latest 27 | permissions: 28 | actions: read 29 | contents: read 30 | security-events: write 31 | 32 | strategy: 33 | fail-fast: false 34 | matrix: 35 | language: [ 'cpp' ] 36 | # CodeQL supports [ 'cpp', 'csharp', 'go', 'java', 'javascript', 'python', 'ruby' ] 37 | # Learn more about CodeQL language support at https://git.io/codeql-language-support 38 | 39 | steps: 40 | - name: Checkout repository 41 | uses: actions/checkout@v3 42 | 43 | # Initializes the CodeQL tools for scanning. 44 | - name: Initialize CodeQL 45 | uses: github/codeql-action/init@v3 46 | with: 47 | languages: ${{ matrix.language }} 48 | setup-python-dependencies: true 49 | # If you wish to specify custom queries, you can do so here or in a config file. 50 | # By default, queries listed here will override any specified in a config file. 51 | # Prefix the list here with "+" to use these queries and those in the config file. 52 | # queries: ./path/to/local/query, your-org/your-repo/queries@main 53 | 54 | # Autobuild attempts to build any compiled languages (C/C++, C#, or Java). 55 | # If this step fails, then you should remove it and run the build manually (see below) 56 | - name: Autobuild 57 | uses: github/codeql-action/autobuild@v3 58 | 59 | # ℹ️ Command-line programs to run using the OS shell. 60 | # 📚 https://git.io/JvXDl 61 | 62 | # ✏️ If the Autobuild fails above, remove it and uncomment the following three lines 63 | # and modify them (or add more) to build your code if your project 64 | # uses a compiled language 65 | 66 | - run: | 67 | mkdir build 68 | cd build 69 | cmake -DUNITTEST=1 .. 70 | make 71 | make test 72 | 73 | - name: Perform CodeQL Analysis 74 | uses: github/codeql-action/analyze@v3 75 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | # Custom 2 | *.docx 3 | z* 4 | *.log 5 | *bak* 6 | *~ 7 | *.xlsx 8 | *.stackdump 9 | *.wav 10 | 11 | 12 | # Object files 13 | *.o 14 | *.ko 15 | *.obj 16 | *.elf 17 | 18 | # Precompiled Headers 19 | *.gch 20 | *.pch 21 | 22 | # Libraries 23 | *.lib 24 | *.a 25 | *.la 26 | *.lo 27 | 28 | # Shared objects (inc. Windows DLLs) 29 | *.dll 30 | *.so 31 | *.so.* 32 | *.dylib 33 | 34 | # Executables 35 | *.exe 36 | *.out 37 | *.app 38 | *.i*86 39 | *.x86_64 40 | *.hex 41 | 42 | # Binaries, other build results 43 | 44 | aclients 45 | atest 46 | decode_aprs 47 | direwolf 48 | gen_fff 49 | gen_packets 50 | ll2utm 51 | log2gpx 52 | text2tt 53 | tt2text 54 | ttcalc 55 | utm2ll 56 | 57 | direwolf.conf 58 | fsk_fast_filter.h 59 | direwolf.desktop 60 | 61 | 62 | # ========================= 63 | # Operating System Files 64 | # ========================= 65 | 66 | # OSX 67 | # ========================= 68 | 69 | .DS_Store 70 | .AppleDouble 71 | .LSOverride 72 | 73 | # Thumbnails 74 | ._* 75 | 76 | # Files that might appear on external disk 77 | .Spotlight-V100 78 | .Trashes 79 | 80 | # Directories potentially created on remote AFP share 81 | .AppleDB 82 | .AppleDesktop 83 | Network Trash Folder 84 | Temporary Items 85 | .apdisk 86 | 87 | # Windows 88 | # ========================= 89 | 90 | # Windows image file caches 91 | Thumbs.db 92 | ehthumbs.db 93 | 94 | # Folder config file 95 | Desktop.ini 96 | 97 | # Recycle Bin used on file shares 98 | $RECYCLE.BIN/ 99 | 100 | # Windows Installer files 101 | *.cab 102 | *.msi 103 | *.msm 104 | *.msp 105 | 106 | # Windows shortcuts 107 | *.lnk 108 | /use_this_sdk 109 | *.dSYM 110 | 111 | # cmake 112 | build/ 113 | tmp/ -------------------------------------------------------------------------------- /Makefile: -------------------------------------------------------------------------------- 1 | 2 | all: 3 | @echo "The build procedure has changed in version 1.6." 4 | @echo "In general, it now looks like this:" 5 | @echo " " 6 | @echo "Download the source code:" 7 | @echo " " 8 | @echo " cd ~" 9 | @echo " git clone https://www.github.com/wb2osz/direwolf" 10 | @echo " cd direwolf" 11 | @echo " " 12 | @echo "Optional - Do this to get the latest development version" 13 | @echo "rather than the latest stable release." 14 | @echo " " 15 | @echo " git checkout dev" 16 | @echo " " 17 | @echo "Build it. There are two new steps not used for earlier releases." 18 | @echo " " 19 | @echo " mkdir build && cd build" 20 | @echo " cmake .." 21 | @echo " make -j4" 22 | @echo " " 23 | @echo "Install:" 24 | @echo " " 25 | @echo " sudo make install" 26 | @echo " make install-conf" 27 | @echo " " 28 | @echo "You will probably need to install additional applications and" 29 | @echo "libraries depending on your operating system." 30 | @echo "More details are in the README.md file." 31 | @echo " " 32 | @echo "Questions?" 33 | @echo " " 34 | @echo " - Extensive documentation can be found in the 'doc' directory." 35 | @echo " - Join the discussion forum here: https://groups.io/g/direwolf" 36 | @echo " " 37 | -------------------------------------------------------------------------------- /cmake/cpack/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | include(CPack) 2 | -------------------------------------------------------------------------------- /cmake/cpack/direwolf.desktop.in: -------------------------------------------------------------------------------- 1 | [Desktop Entry] 2 | Name=@APPLICATION_NAME@ 3 | Comment=APRS Soundcard TNC 4 | Exec=@APPLICATION_DESKTOP_EXEC@ 5 | Icon=@CMAKE_PROJECT_NAME@_icon.png 6 | StartupNotify=true 7 | Terminal=false 8 | Type=Application 9 | Categories=HamRadio 10 | Keywords=Ham Radio;APRS;Soundcard TNC;KISS;AGWPE;AX.25 -------------------------------------------------------------------------------- /cmake/cpack/direwolf.rc: -------------------------------------------------------------------------------- 1 | MAINICON ICON "direwolf_icon.ico" -------------------------------------------------------------------------------- /cmake/cpack/direwolf_icon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wb2osz/direwolf/390d4a8c2733565748cb85c96d0bcdf2562807cb/cmake/cpack/direwolf_icon.ico -------------------------------------------------------------------------------- /cmake/cpack/direwolf_icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wb2osz/direwolf/390d4a8c2733565748cb85c96d0bcdf2562807cb/cmake/cpack/direwolf_icon.png -------------------------------------------------------------------------------- /cmake/cpu_tests/test_arm_neon.cxx: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include 4 | #include 5 | 6 | void signalHandler(int signum) { 7 | exit(signum); // SIGILL = 4 8 | } 9 | 10 | int main(int argc, char* argv[]) 11 | { 12 | signal(SIGILL, signalHandler); 13 | uint32x4_t x={0}; 14 | x=veorq_u32(x,x); 15 | return 0; 16 | } 17 | -------------------------------------------------------------------------------- /cmake/cpu_tests/test_x86_avx.cxx: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include 4 | 5 | void signalHandler(int signum) { 6 | exit(signum); // SIGILL = 4 7 | } 8 | 9 | int main(int argc, char* argv[]) 10 | { 11 | signal(SIGILL, signalHandler); 12 | __m256d x = _mm256_setzero_pd(); 13 | x=_mm256_addsub_pd(x,x); 14 | return 0; 15 | } 16 | -------------------------------------------------------------------------------- /cmake/cpu_tests/test_x86_avx2.cxx: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include 4 | 5 | void signalHandler(int signum) { 6 | exit(signum); // SIGILL = 4 7 | } 8 | 9 | int main(int argc, char* argv[]) 10 | { 11 | signal(SIGILL, signalHandler); 12 | __m256i x = _mm256_setzero_si256(); 13 | x=_mm256_add_epi64 (x,x); 14 | return 0; 15 | } 16 | -------------------------------------------------------------------------------- /cmake/cpu_tests/test_x86_avx512.cxx: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include 4 | #include 5 | 6 | void signalHandler(int signum) { 7 | exit(signum); // SIGILL = 4 8 | } 9 | 10 | int main(int argc, char* argv[]) 11 | { 12 | signal(SIGILL, signalHandler); 13 | uint64_t x[8] = {0}; 14 | __m512i y = _mm512_loadu_si512((__m512i*)x); 15 | return 0; 16 | } 17 | -------------------------------------------------------------------------------- /cmake/cpu_tests/test_x86_sse2.cxx: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include 4 | 5 | void signalHandler(int signum) { 6 | exit(signum); // SIGILL = 4 7 | } 8 | 9 | int main(int argc, char* argv[]) 10 | { 11 | signal(SIGILL, signalHandler); 12 | __m128i x = _mm_setzero_si128(); 13 | x=_mm_add_epi64(x,x); 14 | return 0; 15 | } 16 | -------------------------------------------------------------------------------- /cmake/cpu_tests/test_x86_sse3.cxx: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include 4 | #include 5 | 6 | void signalHandler(int signum) { 7 | exit(signum); // SIGILL = 4 8 | } 9 | 10 | int main(int argc, char* argv[]) 11 | { 12 | signal(SIGILL, signalHandler); 13 | __m128d x = _mm_setzero_pd(); 14 | x=_mm_addsub_pd(x,x); 15 | return 0; 16 | } 17 | -------------------------------------------------------------------------------- /cmake/cpu_tests/test_x86_sse41.cxx: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include 4 | #include 5 | 6 | void signalHandler(int signum) { 7 | exit(signum); // SIGILL = 4 8 | } 9 | 10 | int main(int argc, char* argv[]) 11 | { 12 | signal(SIGILL, signalHandler); 13 | __m128i x = _mm_setzero_si128(); 14 | __m128i a = _mm_setzero_si128(); 15 | __m128i b = _mm_setzero_si128(); 16 | x=_mm_blend_epi16(a,b,4); 17 | return 0; 18 | } 19 | -------------------------------------------------------------------------------- /cmake/cpu_tests/test_x86_sse42.cxx: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include 4 | 5 | void signalHandler(int signum) { 6 | exit(signum); // SIGILL = 4 7 | } 8 | 9 | int main(int argc, char* argv[]) 10 | { 11 | signal(SIGILL, signalHandler); 12 | unsigned int x=32; 13 | x=_mm_crc32_u8(x,4); 14 | return 0; 15 | } 16 | -------------------------------------------------------------------------------- /cmake/cpu_tests/test_x86_ssse3.cxx: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include 4 | #include 5 | 6 | void signalHandler(int signum) { 7 | exit(signum); // SIGILL = 4 8 | } 9 | 10 | int main(int argc, char* argv[]) 11 | { 12 | signal(SIGILL, signalHandler); 13 | __m128i x = _mm_setzero_si128(); 14 | x=_mm_alignr_epi8(x,x,2); 15 | return 0; 16 | } 17 | -------------------------------------------------------------------------------- /cmake/include/uninstall.cmake.in: -------------------------------------------------------------------------------- 1 | if(NOT EXISTS "@CMAKE_CURRENT_BINARY_DIR@/install_manifest.txt") 2 | message(FATAL_ERROR "Cannot find install manifest: @CMAKE_CURRENT_BINARY_DIR@/install_manifest.txt") 3 | endif(NOT EXISTS "@CMAKE_CURRENT_BINARY_DIR@/install_manifest.txt") 4 | 5 | file(READ "@CMAKE_CURRENT_BINARY_DIR@/install_manifest.txt" files) 6 | string(REGEX REPLACE "\n" ";" files "${files}") 7 | foreach(file ${files}) 8 | message(STATUS "Uninstalling $ENV{DESTDIR}${file}") 9 | if(IS_SYMLINK "$ENV{DESTDIR}${file}" OR EXISTS "$ENV{DESTDIR}${file}") 10 | exec_program( 11 | "@CMAKE_COMMAND@" ARGS "-E remove \"$ENV{DESTDIR}${file}\"" 12 | OUTPUT_VARIABLE rm_out 13 | RETURN_VALUE rm_retval 14 | ) 15 | if(NOT "${rm_retval}" STREQUAL 0) 16 | message(FATAL_ERROR "Problem when removing $ENV{DESTDIR}${file}") 17 | endif(NOT "${rm_retval}" STREQUAL 0) 18 | else(IS_SYMLINK "$ENV{DESTDIR}${file}" OR EXISTS "$ENV{DESTDIR}${file}") 19 | message(STATUS "File $ENV{DESTDIR}${file} does not exist.") 20 | endif(IS_SYMLINK "$ENV{DESTDIR}${file}" OR EXISTS "$ENV{DESTDIR}${file}") 21 | endforeach(file) 22 | -------------------------------------------------------------------------------- /cmake/modules/FindAvahi.cmake: -------------------------------------------------------------------------------- 1 | 2 | find_library(AVAHI_COMMON_LIBRARY NAMES avahi-common PATHS ${PC_AVAHI_CLIENT_LIBRARY_DIRS}) 3 | if(AVAHI_COMMON_LIBRARY) 4 | set(AVAHI_COMMON_FOUND TRUE) 5 | endif() 6 | 7 | find_library(AVAHI_CLIENT_LIBRARY NAMES avahi-client PATHS ${PC_AVAHI_CLIENT_LIBRARY_DIRS}) 8 | if(AVAHI_CLIENT_LIBRARY) 9 | set(AVAHI_CLIENT_FOUND TRUE) 10 | endif() 11 | 12 | FIND_PACKAGE_HANDLE_STANDARD_ARGS(Avahi DEFAULT_MSG AVAHI_COMMON_FOUND AVAHI_CLIENT_FOUND) 13 | 14 | if (AVAHI_FOUND) 15 | set(AVAHI_INCLUDE_DIRS ${AVAHI_UI_INCLUDE_DIR}) 16 | set(AVAHI_LIBRARIES ${AVAHI_COMMON_LIBRARY} ${AVAHI_CLIENT_LIBRARY}) 17 | endif() 18 | 19 | mark_as_advanced(AVAHI_INCLUDE_DIRS AVAHI_LIBRARIES) 20 | -------------------------------------------------------------------------------- /cmake/modules/FindCompiler.cmake: -------------------------------------------------------------------------------- 1 | # Clang or AppleClang (see CMP0025) 2 | if(NOT DEFINED C_CLANG AND CMAKE_CXX_COMPILER_ID MATCHES "Clang") 3 | set(C_CLANG 1) 4 | elseif(NOT DEFINED C_GCC AND CMAKE_CXX_COMPILER_ID MATCHES "GNU") 5 | set(C_GCC 1) 6 | elseif(NOT DEFINED C_MSVC AND CMAKE_CXX_COMPILER_ID MATCHES "MSVC") 7 | set(C_MSVC 1) 8 | if(MSVC_VERSION GREATER_EQUAL 1920 AND MSVC_VERSION LESS_EQUAL 1929) 9 | set(VS2019 ON) 10 | elseif(MSVC_VERSION GREATER_EQUAL 1910 AND MSVC_VERSION LESS_EQUAL 1919) 11 | set(VS2017 ON) 12 | elseif(MSVC_VERSION GREATER 1899 AND MSVC_VERSION LESS 1910) 13 | set(VS2015 ON) 14 | endif() 15 | endif() 16 | -------------------------------------------------------------------------------- /cmake/modules/FindGPSD.cmake: -------------------------------------------------------------------------------- 1 | # - Try to find GPSD 2 | # Once done this will define 3 | # 4 | # GPSD_FOUND - system has GPSD 5 | # GPSD_INCLUDE_DIRS - the GPSD include directory 6 | # GPSD_LIBRARIES - Link these to use GPSD 7 | # GPSD_DEFINITIONS - Compiler switches required for using GPSD 8 | # 9 | # Copyright (c) 2006 Andreas Schneider 10 | # 11 | # Redistribution and use is allowed according to the terms of the New 12 | # BSD license. 13 | # For details see the accompanying COPYING-CMAKE-SCRIPTS file. 14 | # 15 | 16 | set(GPSD_ROOT_DIR 17 | "${GPSD_ROOT_DIR}" 18 | CACHE 19 | PATH 20 | "Directory to search for gpsd") 21 | 22 | find_package(PkgConfig QUIET) 23 | if(PKG_CONFIG_FOUND) 24 | pkg_check_modules(PC_GPSD libgps) 25 | endif() 26 | 27 | if (GPSD_LIBRARIES AND GPSD_INCLUDE_DIRS) 28 | # in cache already 29 | set(GPSD_FOUND TRUE) 30 | else (GPSD_LIBRARIES AND GPSD_INCLUDE_DIRS) 31 | find_path(GPSD_INCLUDE_DIRS 32 | NAMES 33 | gps.h 34 | PATHS 35 | /usr/include 36 | /usr/local/include 37 | /opt/local/include 38 | /sw/include 39 | /usr/include/gps 40 | /usr/local/include/gps 41 | /opt/local/include/gps 42 | /sw/include/gps 43 | HINTS 44 | ${PC_GPSD_INCLUDEDIR} 45 | ${GPSD_ROOT_DIR} 46 | ) 47 | 48 | # debian uses version suffixes 49 | # add suffix evey new release 50 | find_library(GPSD_LIBRARIES 51 | NAMES 52 | gps 53 | PATHS 54 | /usr/lib64 55 | /usr/lib 56 | /usr/local/lib 57 | /opt/local/lib 58 | /sw/lib 59 | HINTS 60 | ${PC_GPSD_LIBDIR} 61 | ${GPSD_ROOT_DIR} 62 | ) 63 | 64 | if (GPSD_INCLUDE_DIRS AND GPSD_LIBRARIES) 65 | set(GPSD_FOUND TRUE) 66 | endif (GPSD_INCLUDE_DIRS AND GPSD_LIBRARIES) 67 | 68 | if (GPSD_FOUND) 69 | if (NOT GPSD_FIND_QUIETLY) 70 | message(STATUS "Found GPSD: ${GPSD_LIBRARIES}") 71 | endif (NOT GPSD_FIND_QUIETLY) 72 | else (GPSD_FOUND) 73 | if (GPSD_FIND_REQUIRED) 74 | message(FATAL_ERROR "Could not find GPSD") 75 | endif (GPSD_FIND_REQUIRED) 76 | endif (GPSD_FOUND) 77 | 78 | # show the GPSD_INCLUDE_DIRS and GPSD_LIBRARIES variables only in the advanced view 79 | mark_as_advanced(GPSD_INCLUDE_DIRS GPSD_LIBRARIES) 80 | 81 | endif (GPSD_LIBRARIES AND GPSD_INCLUDE_DIRS) 82 | 83 | # maybe on CYGWIN gpsd works 84 | if (WIN32) 85 | set(GPSD_FOUND FALSE) 86 | set(GPSD_LIBRARIES "") 87 | set(GPSD_INCLUDE_DIRS "") 88 | endif (WIN32) 89 | -------------------------------------------------------------------------------- /cmake/modules/FindPortaudio.cmake: -------------------------------------------------------------------------------- 1 | # - Try to find Portaudio 2 | # Once done this will define 3 | # 4 | # PORTAUDIO_FOUND - system has Portaudio 5 | # PORTAUDIO_INCLUDE_DIRS - the Portaudio include directory 6 | # PORTAUDIO_LIBRARIES - Link these to use Portaudio 7 | 8 | set(PORTAUDIO_ROOT_DIR 9 | "${PORTAUDIO_ROOT_DIR}" 10 | CACHE 11 | PATH 12 | "Directory to search for portaudio") 13 | 14 | find_package(PkgConfig QUIET) 15 | if(PKG_CONFIG_FOUND) 16 | pkg_check_modules(PC_PORTAUDIO portaudio-2.0) 17 | endif() 18 | 19 | find_path(PORTAUDIO_INCLUDE_DIRS 20 | NAMES 21 | portaudio.h 22 | PATHS 23 | /usr/local/include 24 | /usr/include 25 | /opt/local/include 26 | HINTS 27 | ${PC_PORTAUDIO_INCLUDEDIR} 28 | ${PORTAUDIO_ROOT_DIR} 29 | ) 30 | 31 | find_library(PORTAUDIO_LIBRARIES 32 | NAMES 33 | portaudio 34 | PATHS 35 | /usr/local/lib 36 | /usr/lib 37 | /usr/lib64 38 | /opt/local/lib 39 | HINTS 40 | ${PC_PORTAUDIO_LIBDIR} 41 | ${PORTAUDIO_ROOT_DIR} 42 | ) 43 | 44 | mark_as_advanced(PORTAUDIO_INCLUDE_DIRS PORTAUDIO_LIBRARIES) 45 | 46 | # Found PORTAUDIO, but it may be version 18 which is not acceptable. 47 | if(EXISTS ${PORTAUDIO_INCLUDE_DIRS}/portaudio.h) 48 | include(CheckCXXSourceCompiles) 49 | set(CMAKE_REQUIRED_INCLUDES_SAVED ${CMAKE_REQUIRED_INCLUDES}) 50 | set(CMAKE_REQUIRED_INCLUDES ${PORTAUDIO_INCLUDE_DIRS}) 51 | CHECK_CXX_SOURCE_COMPILES( 52 | "#include \nPaDeviceIndex pa_find_device_by_name(const char *name); int main () {return 0;}" 53 | PORTAUDIO2_FOUND) 54 | set(CMAKE_REQUIRED_INCLUDES ${CMAKE_REQUIRED_INCLUDES_SAVED}) 55 | unset(CMAKE_REQUIRED_INCLUDES_SAVED) 56 | if(PORTAUDIO2_FOUND) 57 | INCLUDE(FindPackageHandleStandardArgs) 58 | FIND_PACKAGE_HANDLE_STANDARD_ARGS(PORTAUDIO DEFAULT_MSG PORTAUDIO_INCLUDE_DIRS PORTAUDIO_LIBRARIES) 59 | else(PORTAUDIO2_FOUND) 60 | message(STATUS 61 | " portaudio.h not compatible (requires API 2.0)") 62 | set(PORTAUDIO_FOUND FALSE) 63 | endif(PORTAUDIO2_FOUND) 64 | endif() 65 | -------------------------------------------------------------------------------- /cmake/modules/Findhamlib.cmake: -------------------------------------------------------------------------------- 1 | # - Try to find Hamlib 2 | # 3 | # HAMLIB_FOUND - system has Hamlib 4 | # HAMLIB_LIBRARIES - location of the library for hamlib 5 | # HAMLIB_INCLUDE_DIRS - location of the include files for hamlib 6 | # 7 | # Requires these CMake modules: 8 | # FindPackageHandleStandardArgs (known included with CMake >=2.6.2) 9 | # 10 | # Original Author: 11 | # 2019 Davide Gerhard 12 | 13 | set(HAMLIB_ROOT_DIR 14 | "${HAMLIB_ROOT_DIR}" 15 | CACHE 16 | PATH 17 | "Directory to search for hamlib") 18 | 19 | find_package(PkgConfig QUIET) 20 | if(PKG_CONFIG_FOUND) 21 | pkg_check_modules(PC_HAMLIB hamlib) 22 | endif() 23 | 24 | find_path(HAMLIB_INCLUDE_DIR 25 | NAMES hamlib/rig.h 26 | PATHS 27 | /usr/include 28 | /usr/local/include 29 | /opt/local/include 30 | HINTS 31 | ${PC_HAMLIB_INCLUDEDIR} 32 | ${HAMLIB_ROOT_DIR} 33 | ) 34 | 35 | find_library(HAMLIB_LIBRARY 36 | NAMES hamlib 37 | PATHS 38 | /usr/lib64/hamlib 39 | /usr/lib/hamlib 40 | /usr/lib64 41 | /usr/lib 42 | /usr/local/lib64/hamlib 43 | /usr/local/lib/hamlib 44 | /usr/local/lib64 45 | /usr/local/lib 46 | /opt/local/lib 47 | /opt/local/lib/hamlib 48 | HINTS 49 | ${PC_HAMLIB_LIBDIR} 50 | ${HAMLIB_ROOT_DIR} 51 | 52 | ) 53 | 54 | include(FindPackageHandleStandardArgs) 55 | find_package_handle_standard_args(hamlib 56 | DEFAULT_MSG 57 | HAMLIB_LIBRARY 58 | HAMLIB_INCLUDE_DIR 59 | ) 60 | 61 | if(HAMLIB_FOUND) 62 | list(APPEND HAMLIB_LIBRARIES ${HAMLIB_LIBRARY}) 63 | list(APPEND HAMLIB_INCLUDE_DIRS ${HAMLIB_INCLUDE_DIR}) 64 | mark_as_advanced(HAMLIB_ROOT_DIR) 65 | endif() 66 | 67 | mark_as_advanced(HAMLIB_INCLUDE_DIR HAMLIB_LIBRARY) 68 | -------------------------------------------------------------------------------- /cmake/modules/Findsndio.cmake: -------------------------------------------------------------------------------- 1 | # - Try to find sndio 2 | # 3 | # SNDIO_FOUND - system has sndio 4 | # SNDIO_LIBRARIES - location of the library for sndio 5 | # SNDIO_INCLUDE_DIRS - location of the include files for sndio 6 | 7 | set(SNDIO_ROOT_DIR 8 | "${SNDIO_ROOT_DIR}" 9 | CACHE 10 | PATH 11 | "Directory to search for sndio") 12 | 13 | # no need to check pkg-config 14 | 15 | find_path(SNDIO_INCLUDE_DIRS 16 | NAMES 17 | sndio.h 18 | PATHS 19 | /usr/local/include 20 | /usr/include 21 | /opt/local/include 22 | HINTS 23 | ${SNDIO_ROOT_DIR} 24 | ) 25 | 26 | find_library(SNDIO_LIBRARIES 27 | NAMES 28 | sndio 29 | PATHS 30 | /usr/local/lib 31 | /usr/lib 32 | /usr/lib64 33 | /opt/local/lib 34 | HINTS 35 | ${SNDIIO_ROOT_DIR} 36 | ) 37 | 38 | 39 | include(FindPackageHandleStandardArgs) 40 | find_package_handle_standard_args(SNDIO DEFAULT_MSG SNDIO_INCLUDE_DIRS SNDIO_LIBRARIES) 41 | 42 | mark_as_advanced(SNDIO_INCLUDE_DIRS SNDIO_LIBRARIES) 43 | -------------------------------------------------------------------------------- /cmake/modules/Findudev.cmake: -------------------------------------------------------------------------------- 1 | # - try to find the udev library 2 | # 3 | # Cache Variables: (probably not for direct use in your scripts) 4 | # UDEV_INCLUDE_DIR 5 | # UDEV_SOURCE_DIR 6 | # UDEV_LIBRARY 7 | # 8 | # Non-cache variables you might use in your CMakeLists.txt: 9 | # UDEV_FOUND 10 | # UDEV_INCLUDE_DIRS 11 | # UDEV_LIBRARIES 12 | # 13 | # Requires these CMake modules: 14 | # FindPackageHandleStandardArgs (known included with CMake >=2.6.2) 15 | # 16 | # Original Author: 17 | # 2014 Kevin M. Godby 18 | # 19 | # Distributed under the Boost Software License, Version 1.0. 20 | # (See accompanying file LICENSE_1_0.txt or copy at 21 | # http://www.boost.org/LICENSE_1_0.txt) 22 | 23 | set(UDEV_ROOT_DIR 24 | "${UDEV_ROOT_DIR}" 25 | CACHE 26 | PATH 27 | "Directory to search for udev") 28 | 29 | find_package(PkgConfig QUIET) 30 | if(PKG_CONFIG_FOUND) 31 | pkg_check_modules(PC_LIBUDEV libudev) 32 | endif() 33 | 34 | find_library(UDEV_LIBRARY 35 | NAMES 36 | udev 37 | PATHS 38 | ${PC_LIBUDEV_LIBRARY_DIRS} 39 | ${PC_LIBUDEV_LIBDIR} 40 | /usr/lib64 41 | /usr/lib 42 | /usr/local/lib 43 | HINTS 44 | "${UDEV_ROOT_DIR}" 45 | PATH_SUFFIXES 46 | lib 47 | ) 48 | 49 | get_filename_component(_libdir "${UDEV_LIBRARY}" PATH) 50 | 51 | find_path(UDEV_INCLUDE_DIR 52 | NAMES 53 | libudev.h 54 | PATHS 55 | /usr/include 56 | /usr/local/include 57 | ${PC_LIBUDEV_INCLUDE_DIRS} 58 | ${PC_LIBUDEV_INCLUDEDIR} 59 | HINTS 60 | "${_libdir}" 61 | "${_libdir}/.." 62 | "${UDEV_ROOT_DIR}" 63 | PATH_SUFFIXES 64 | include 65 | ) 66 | 67 | include(FindPackageHandleStandardArgs) 68 | find_package_handle_standard_args(udev 69 | DEFAULT_MSG 70 | UDEV_LIBRARY 71 | UDEV_INCLUDE_DIR 72 | ) 73 | 74 | if (UDEV_INCLUDE_DIR AND UDEV_LIBRARY) 75 | set(UDEV_FOUND TRUE) 76 | endif (UDEV_INCLUDE_DIR AND UDEV_LIBRARY) 77 | 78 | if(UDEV_FOUND) 79 | list(APPEND UDEV_LIBRARIES ${UDEV_LIBRARY}) 80 | list(APPEND UDEV_INCLUDE_DIRS ${UDEV_INCLUDE_DIR}) 81 | mark_as_advanced(UDEV_ROOT_DIR) 82 | endif() 83 | 84 | mark_as_advanced(UDEV_INCLUDE_DIR 85 | UDEV_LIBRARY) 86 | -------------------------------------------------------------------------------- /conf/99-direwolf-cmedia.rules: -------------------------------------------------------------------------------- 1 | # Normally, all of /dev/hidraw* are accessible only by root. 2 | # 3 | # $ ls -l /dev/hidraw* 4 | # crw------- 1 root root 247, 0 Sep 24 09:40 /dev/hidraw0 5 | # 6 | # An ordinary user, trying to access it will be denied. 7 | # 8 | # Unnecessarily running applications as root is generally a bad idea because it makes it too easy 9 | # to accidentally trash your system. We need to relax the restrictions so ordinary users can use these devices. 10 | # 11 | # If all went well with installation, the /etc/udev/rules.d directory should contain a file called 12 | # 99-direwolf-cmedia.rules containing: 13 | # 14 | 15 | SUBSYSTEM=="hidraw", ATTRS{idVendor}=="0d8c", GROUP="audio", MODE="0660" 16 | 17 | # 18 | # I used the "audio" group, mimicking the permissions on the sound side of the device. 19 | # 20 | # $ ls -l /dev/snd/pcm* 21 | # crw-rw----+ 1 root audio 116, 16 Sep 24 09:40 /dev/snd/pcmC0D0p 22 | # crw-rw----+ 1 root audio 116, 17 Sep 24 09:40 /dev/snd/pcmC0D1p 23 | # 24 | # You should see something similar to this where someone in the "audio" group has read-write access. 25 | # 26 | # $ ls -l /dev/hidraw* 27 | # crw-rw---- 1 root audio 247, 0 Oct 6 19:24 /dev/hidraw0 28 | # 29 | # Read the User Guide and run the "cm108" application for more information. 30 | # 31 | 32 | # 33 | # Same thing for the "All In One Cable." 34 | # 35 | 36 | SUBSYSTEM=="hidraw", ATTRS{idVendor}=="1209", ATTRS{idProduct}=="7388", GROUP="audio", MODE="0660" 37 | -------------------------------------------------------------------------------- /conf/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | # generate conf per platform 2 | file(READ "${CUSTOM_CONF_DIR}/generic.conf" file_content) 3 | 4 | if(LINUX) 5 | string(REGEX REPLACE "\n%W%[^\n]*" "" file_content "${file_content}") 6 | string(REGEX REPLACE "\n%M%[^\n]*" "" file_content "${file_content}") 7 | string(REGEX REPLACE "\n%L%([^\n]*)" "\n\\1" file_content "${file_content}") 8 | elseif(WIN32 OR CYGWIN) 9 | string(REGEX REPLACE "\n%M%[^\n]*" "" file_content "${file_content}") 10 | string(REGEX REPLACE "\n%L%[^\n]*" "" file_content "${file_content}") 11 | string(REGEX REPLACE "\n%W%([^\n]*)" "\n\\1" file_content "${file_content}") 12 | else() # macOS FreeBSD OpenBSD 13 | string(REGEX REPLACE "\n%W%[^\n]*" "" file_content "${file_content}") 14 | string(REGEX REPLACE "\n%L%[^\n]*" "" file_content "${file_content}") 15 | string(REGEX REPLACE "\n%M%([^\n]*)" "\n\\1" file_content "${file_content}") 16 | endif() 17 | 18 | # remove remark 19 | string(REGEX REPLACE "\n%R%[^\n]*" "" file_content "${file_content}") 20 | 21 | # clear common lines 22 | string(REGEX REPLACE "\n%C%([^\n]*)" "\n\\1" file_content "${file_content}") 23 | string(REGEX REPLACE "^%C%([^\n]*)" "\\1" file_content "${file_content}") 24 | 25 | file(WRITE "${CMAKE_BINARY_DIR}/direwolf.conf" "${file_content}") 26 | 27 | # install udev rules for CM108 28 | if(LINUX) 29 | install(FILES "${CUSTOM_CONF_DIR}/99-direwolf-cmedia.rules" DESTINATION /etc/udev/rules.d/) 30 | endif() 31 | 32 | install(FILES "${CMAKE_BINARY_DIR}/direwolf.conf" DESTINATION ${INSTALL_CONF_DIR}) 33 | install(FILES "${CUSTOM_CONF_DIR}/sdr.conf" DESTINATION ${INSTALL_CONF_DIR}) 34 | 35 | # Put sample configuration & startup files in home directory. 36 | # This step would be done as ordinary user. 37 | # Some people like to put the direwolf config file in /etc/ax25. 38 | # Note that all of these are also in $(DESTDIR)/share/doc/direwolf/examples/. 39 | if(NOT (WIN32 OR CYGWIN)) 40 | add_custom_target(install-conf 41 | COMMAND ${CMAKE_COMMAND} 42 | -DCUSTOM_BINARY_DIR="${CMAKE_BINARY_DIR}" 43 | -DCUSTOM_CONF_DIR="${CUSTOM_CONF_DIR}" 44 | -DCUSTOM_SCRIPTS_DIR="${CUSTOM_SCRIPTS_DIR}" 45 | -DCUSTOM_TELEMETRY_DIR="${CUSTOM_TELEMETRY_DIR}" 46 | -P "${CMAKE_SOURCE_DIR}/conf/install_conf.cmake" 47 | ) 48 | endif() 49 | -------------------------------------------------------------------------------- /conf/install_conf.cmake: -------------------------------------------------------------------------------- 1 | if(NOT EXISTS $ENV{HOME}/direwolf.conf) 2 | configure_file("${CUSTOM_BINARY_DIR}/direwolf.conf" $ENV{HOME}) 3 | endif() 4 | 5 | if(NOT EXISTS $ENV{HOME}/sdr.conf) 6 | configure_file("${CUSTOM_CONF_DIR}/sdr.conf" $ENV{HOME}) 7 | endif() 8 | 9 | if(NOT EXISTS $ENV{HOME}/dw-start.sh) 10 | configure_file("${CUSTOM_SCRIPTS_DIR}/dw-start.sh" $ENV{HOME}) 11 | endif() 12 | 13 | if(NOT EXISTS $ENV{HOME}/telem-m0xer-3.txt) 14 | configure_file("${CUSTOM_TELEMETRY_DIR}/telem-m0xer-3.txt" $ENV{HOME}) 15 | endif() 16 | 17 | if(NOT EXISTS $ENV{HOME}/telem-balloon.conf) 18 | configure_file("${CUSTOM_TELEMETRY_DIR}/telem-balloon.conf" $ENV{HOME}) 19 | endif() 20 | 21 | if(NOT EXISTS $ENV{HOME}/telem-volts.conf) 22 | configure_file("${CUSTOM_TELEMETRY_DIR}/telem-volts.conf" $ENV{HOME}) 23 | endif() 24 | -------------------------------------------------------------------------------- /conf/sdr.conf: -------------------------------------------------------------------------------- 1 | # 2 | # Sample configuration for SDR read-only IGate. 3 | # 4 | 5 | # We might not have an audio output device so set to null. 6 | # We will override the input half on the command line. 7 | ADEVICE null null 8 | CHANNEL 0 9 | MYCALL xxx 10 | 11 | # First you need to specify the name of a Tier 2 server. 12 | # The current preferred way is to use one of these regional rotate addresses: 13 | 14 | # noam.aprs2.net - for North America 15 | # soam.aprs2.net - for South America 16 | # euro.aprs2.net - for Europe and Africa 17 | # asia.aprs2.net - for Asia 18 | # aunz.aprs2.net - for Oceania 19 | 20 | IGSERVER noam.aprs2.net 21 | 22 | # You also need to specify your login name and passcode. 23 | # Contact the author if you can't figure out how to generate the passcode. 24 | 25 | IGLOGIN xxx 123456 26 | 27 | # That's all you need for a receive only IGate which relays 28 | # messages from the local radio channel to the global servers. 29 | 30 | 31 | -------------------------------------------------------------------------------- /data/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | # 2 | # Update: 1 May 2023 (still 1.7 dev version) 3 | # 4 | # The original intention was to allow an easy way to download the most 5 | # recent versions of some files. 6 | # 7 | # "update-data" would only work once. 8 | # 9 | # These locations are no longer being maintained: 10 | # http://www.aprs.org/aprs11/tocalls.txt -- 14 Dec 2021 11 | # http://www.aprs.org/symbols/symbols-new.txt -- 17 Mar 2021 12 | # http://www.aprs.org/symbols/symbolsX.txt -- 25 Nov 2015 13 | # so there is no reason to provide a capability grab the latest version. 14 | # 15 | # Rather than fixing an obsolete capability, it will just be removed. 16 | # 17 | # The destination field is often used to identify the manufacturer/model. 18 | # These are not hardcoded into Dire Wolf. Instead they are read from 19 | # a file called tocalls.txt at application start up time. 20 | # 21 | # The original permanent symbols are built in but the "new" symbols, 22 | # using overlays, are often updated. These are also read from files. 23 | # 24 | 25 | 26 | include(ExternalProject) 27 | 28 | set(TOCALLS_TXT "tocalls.txt") 29 | set(SYMBOLS-NEW_TXT "symbols-new.txt") 30 | set(SYMBOLSX_TXT "symbolsX.txt") 31 | set(CUSTOM_BINARY_DATA_DIR "${CMAKE_BINARY_DIR}/data") 32 | 33 | # we can also move to a separate cmake file and use file(download) 34 | # see conf/install_conf.cmake as example 35 | file(COPY "${CUSTOM_DATA_DIR}/${TOCALLS_TXT}" DESTINATION "${CUSTOM_BINARY_DATA_DIR}") 36 | file(COPY "${CUSTOM_DATA_DIR}/${SYMBOLS-NEW_TXT}" DESTINATION "${CUSTOM_BINARY_DATA_DIR}") 37 | file(COPY "${CUSTOM_DATA_DIR}/${SYMBOLSX_TXT}" DESTINATION "${CUSTOM_BINARY_DATA_DIR}") 38 | 39 | install(FILES "${CUSTOM_BINARY_DATA_DIR}/${TOCALLS_TXT}" DESTINATION ${INSTALL_DATA_DIR}) 40 | install(FILES "${CUSTOM_BINARY_DATA_DIR}/${SYMBOLS-NEW_TXT}" DESTINATION ${INSTALL_DATA_DIR}) 41 | install(FILES "${CUSTOM_BINARY_DATA_DIR}/${SYMBOLSX_TXT}" DESTINATION ${INSTALL_DATA_DIR}) 42 | -------------------------------------------------------------------------------- /debian/README.Debian: -------------------------------------------------------------------------------- 1 | In order to start direwolf as a service the configuration file 2 | /etc/direwolf.conf needs to exist. Otherwise attempting to start the service 3 | returns an 'Assertion failed' error. An example configuration file which may be 4 | used as a model can be found in 5 | /usr/share/doc/direwolf/examples/direwolf.conf.gz 6 | -------------------------------------------------------------------------------- /debian/changelog: -------------------------------------------------------------------------------- 1 | ../CHANGES.md -------------------------------------------------------------------------------- /debian/compat: -------------------------------------------------------------------------------- 1 | 10 -------------------------------------------------------------------------------- /debian/control: -------------------------------------------------------------------------------- 1 | Source: direwolf 2 | Maintainer: Debian Hamradio Maintainers 3 | Uploaders: Iain R. Learmonth 4 | Section: hamradio 5 | Priority: optional 6 | Build-Depends: debhelper (>= 9), 7 | libasound2-dev, 8 | libgps-dev, 9 | libhamlib-dev, 10 | dh-systemd 11 | Standards-Version: 4.1.0 12 | Vcs-Browser: https://anonscm.debian.org/cgit/pkg-hamradio/direwolf.git/ 13 | Vcs-Git: https://anonscm.debian.org/git/pkg-hamradio/direwolf.git 14 | Homepage: https://github.com/wb2osz/direwolf 15 | 16 | Package: direwolf 17 | Architecture: alpha amd64 arm64 armel armhf i386 mipsel ppc64el sh4 x32 18 | Depends: ${shlibs:Depends}, 19 | ${misc:Depends}, 20 | adduser, 21 | libhamlib2 22 | Suggests: gpsd, libhamlib-utils 23 | Breaks: direwolf-docs (<< 1.1-1) 24 | Replaces: direwolf-docs (<< 1.1-1) 25 | Description: Soundcard TNC for APRS 26 | Dire Wolf is a software "soundcard" modem/TNC and APRS encoder/decoder. It can 27 | be used stand-alone to receive APRS messages, as a digipeater, APRStt gateway, 28 | or Internet Gateway (IGate). It can also be used as a virtual TNC for other 29 | applications such as APRSIS32, UI-View32, Xastir, APRS-TW, YAAC, UISS, Linux 30 | AX25, SARTrack, and many others. -------------------------------------------------------------------------------- /debian/direwolf.postinst: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | set -e 4 | 5 | . /usr/share/debconf/confmodule 6 | 7 | add_group_if_missing() { 8 | if ! getent group direwolf >/dev/null; then 9 | addgroup --system --force-badname direwolf || true 10 | fi 11 | } 12 | 13 | add_user_if_missing() { 14 | if ! id -u direwolf > /dev/null 2>&1; then 15 | mkdir -m 02750 -p /var/lib/direwolf 16 | adduser --system --home /var/lib/direwolf \ 17 | --disabled-password \ 18 | --force-badname direwolf \ 19 | --ingroup direwolf 20 | adduser direwolf dialout 21 | chown direwolf:direwolf /var/lib/direwolf 22 | fi 23 | } 24 | 25 | add_group_if_missing 26 | add_user_if_missing 27 | 28 | db_stop 29 | 30 | #DEBHELPER# 31 | 32 | exit 0 33 | 34 | -------------------------------------------------------------------------------- /debian/direwolf.postrm: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | set -e 4 | 5 | case "$1" in 6 | purge) 7 | rm -rf /var/lib/direwolf/ 8 | ;; 9 | remove|upgrade|failed-upgrade|abort-install|abort-upgrade|disappear) 10 | ;; 11 | *) 12 | echo "postrm called with unknown argument \`$1'" >&2 13 | exit 1 14 | esac 15 | 16 | #DEBHELPER# 17 | 18 | exit 0 19 | 20 | -------------------------------------------------------------------------------- /debian/rules: -------------------------------------------------------------------------------- 1 | #!/usr/bin/make -f 2 | 3 | %: 4 | dh $@ --parallel 5 | 6 | override_dh_auto_configure: 7 | dh_auto_configure -- -DFORCE_SSE=1 8 | -------------------------------------------------------------------------------- /debian/source/format: -------------------------------------------------------------------------------- 1 | 3.0 (quilt) -------------------------------------------------------------------------------- /direwolf-block-diagram.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wb2osz/direwolf/390d4a8c2733565748cb85c96d0bcdf2562807cb/direwolf-block-diagram.png -------------------------------------------------------------------------------- /doc/2400-4800-PSK-for-APRS-Packet-Radio.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wb2osz/direwolf/390d4a8c2733565748cb85c96d0bcdf2562807cb/doc/2400-4800-PSK-for-APRS-Packet-Radio.pdf -------------------------------------------------------------------------------- /doc/A-Better-APRS-Packet-Demodulator-Part-1-1200-baud.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wb2osz/direwolf/390d4a8c2733565748cb85c96d0bcdf2562807cb/doc/A-Better-APRS-Packet-Demodulator-Part-1-1200-baud.pdf -------------------------------------------------------------------------------- /doc/A-Better-APRS-Packet-Demodulator-Part-2-9600-baud.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wb2osz/direwolf/390d4a8c2733565748cb85c96d0bcdf2562807cb/doc/A-Better-APRS-Packet-Demodulator-Part-2-9600-baud.pdf -------------------------------------------------------------------------------- /doc/A-Closer-Look-at-the-WA8LMF-TNC-Test-CD.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wb2osz/direwolf/390d4a8c2733565748cb85c96d0bcdf2562807cb/doc/A-Closer-Look-at-the-WA8LMF-TNC-Test-CD.pdf -------------------------------------------------------------------------------- /doc/AIS-Reception.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wb2osz/direwolf/390d4a8c2733565748cb85c96d0bcdf2562807cb/doc/AIS-Reception.pdf -------------------------------------------------------------------------------- /doc/APRS-Telemetry-Toolkit.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wb2osz/direwolf/390d4a8c2733565748cb85c96d0bcdf2562807cb/doc/APRS-Telemetry-Toolkit.pdf -------------------------------------------------------------------------------- /doc/APRStt-Implementation-Notes.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wb2osz/direwolf/390d4a8c2733565748cb85c96d0bcdf2562807cb/doc/APRStt-Implementation-Notes.pdf -------------------------------------------------------------------------------- /doc/APRStt-Listening-Example.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wb2osz/direwolf/390d4a8c2733565748cb85c96d0bcdf2562807cb/doc/APRStt-Listening-Example.pdf -------------------------------------------------------------------------------- /doc/APRStt-interface-for-SARTrack.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wb2osz/direwolf/390d4a8c2733565748cb85c96d0bcdf2562807cb/doc/APRStt-interface-for-SARTrack.pdf -------------------------------------------------------------------------------- /doc/AX25_plus_FEC_equals_FX25.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wb2osz/direwolf/390d4a8c2733565748cb85c96d0bcdf2562807cb/doc/AX25_plus_FEC_equals_FX25.pdf -------------------------------------------------------------------------------- /doc/Bluetooth-KISS-TNC.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wb2osz/direwolf/390d4a8c2733565748cb85c96d0bcdf2562807cb/doc/Bluetooth-KISS-TNC.pdf -------------------------------------------------------------------------------- /doc/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | 2 | install(FILES "${CUSTOM_DOC_DIR}/README.md" DESTINATION ${INSTALL_DOC_DIR}) 3 | install(FILES "${CUSTOM_DOC_DIR}/2400-4800-PSK-for-APRS-Packet-Radio.pdf" DESTINATION ${INSTALL_DOC_DIR}) 4 | install(FILES "${CUSTOM_DOC_DIR}/A-Better-APRS-Packet-Demodulator-Part-1-1200-baud.pdf" DESTINATION ${INSTALL_DOC_DIR}) 5 | install(FILES "${CUSTOM_DOC_DIR}/A-Better-APRS-Packet-Demodulator-Part-2-9600-baud.pdf" DESTINATION ${INSTALL_DOC_DIR}) 6 | install(FILES "${CUSTOM_DOC_DIR}/A-Closer-Look-at-the-WA8LMF-TNC-Test-CD.pdf" DESTINATION ${INSTALL_DOC_DIR}) 7 | install(FILES "${CUSTOM_DOC_DIR}/AIS-Reception.pdf" DESTINATION ${INSTALL_DOC_DIR}) 8 | install(FILES "${CUSTOM_DOC_DIR}/APRS-Telemetry-Toolkit.pdf" DESTINATION ${INSTALL_DOC_DIR}) 9 | install(FILES "${CUSTOM_DOC_DIR}/APRStt-Implementation-Notes.pdf" DESTINATION ${INSTALL_DOC_DIR}) 10 | install(FILES "${CUSTOM_DOC_DIR}/APRStt-interface-for-SARTrack.pdf" DESTINATION ${INSTALL_DOC_DIR}) 11 | install(FILES "${CUSTOM_DOC_DIR}/APRStt-Listening-Example.pdf" DESTINATION ${INSTALL_DOC_DIR}) 12 | install(FILES "${CUSTOM_DOC_DIR}/AX25_plus_FEC_equals_FX25.pdf" DESTINATION ${INSTALL_DOC_DIR}) 13 | install(FILES "${CUSTOM_DOC_DIR}/Bluetooth-KISS-TNC.pdf" DESTINATION ${INSTALL_DOC_DIR}) 14 | install(FILES "${CUSTOM_DOC_DIR}/Going-beyond-9600-baud.pdf" DESTINATION ${INSTALL_DOC_DIR}) 15 | install(FILES "${CUSTOM_DOC_DIR}/Raspberry-Pi-APRS.pdf" DESTINATION ${INSTALL_DOC_DIR}) 16 | install(FILES "${CUSTOM_DOC_DIR}/Raspberry-Pi-APRS-Tracker.pdf" DESTINATION ${INSTALL_DOC_DIR}) 17 | install(FILES "${CUSTOM_DOC_DIR}/Raspberry-Pi-SDR-IGate.pdf" DESTINATION ${INSTALL_DOC_DIR}) 18 | install(FILES "${CUSTOM_DOC_DIR}/Successful-APRS-IGate-Operation.pdf" DESTINATION ${INSTALL_DOC_DIR}) 19 | install(FILES "${CUSTOM_DOC_DIR}/User-Guide.pdf" DESTINATION ${INSTALL_DOC_DIR}) 20 | install(FILES "${CUSTOM_DOC_DIR}/WA8LMF-TNC-Test-CD-Results.pdf" DESTINATION ${INSTALL_DOC_DIR}) 21 | install(FILES "${CUSTOM_DOC_DIR}/Why-is-9600-only-twice-as-fast-as-1200.pdf" DESTINATION ${INSTALL_DOC_DIR}) 22 | -------------------------------------------------------------------------------- /doc/Going-beyond-9600-baud.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wb2osz/direwolf/390d4a8c2733565748cb85c96d0bcdf2562807cb/doc/Going-beyond-9600-baud.pdf -------------------------------------------------------------------------------- /doc/Raspberry-Pi-APRS-Tracker.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wb2osz/direwolf/390d4a8c2733565748cb85c96d0bcdf2562807cb/doc/Raspberry-Pi-APRS-Tracker.pdf -------------------------------------------------------------------------------- /doc/Raspberry-Pi-APRS.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wb2osz/direwolf/390d4a8c2733565748cb85c96d0bcdf2562807cb/doc/Raspberry-Pi-APRS.pdf -------------------------------------------------------------------------------- /doc/Raspberry-Pi-SDR-IGate.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wb2osz/direwolf/390d4a8c2733565748cb85c96d0bcdf2562807cb/doc/Raspberry-Pi-SDR-IGate.pdf -------------------------------------------------------------------------------- /doc/Successful-APRS-IGate-Operation.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wb2osz/direwolf/390d4a8c2733565748cb85c96d0bcdf2562807cb/doc/Successful-APRS-IGate-Operation.pdf -------------------------------------------------------------------------------- /doc/User-Guide.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wb2osz/direwolf/390d4a8c2733565748cb85c96d0bcdf2562807cb/doc/User-Guide.pdf -------------------------------------------------------------------------------- /doc/WA8LMF-TNC-Test-CD-Results.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wb2osz/direwolf/390d4a8c2733565748cb85c96d0bcdf2562807cb/doc/WA8LMF-TNC-Test-CD-Results.pdf -------------------------------------------------------------------------------- /doc/Why-is-9600-only-twice-as-fast-as-1200.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wb2osz/direwolf/390d4a8c2733565748cb85c96d0bcdf2562807cb/doc/Why-is-9600-only-twice-as-fast-as-1200.pdf -------------------------------------------------------------------------------- /external/LICENSE: -------------------------------------------------------------------------------- 1 | The Windows version of Dire Wolf contains additional 2 | open source covered by BSD, GPL, and other licenses. 3 | 4 | See "regex" and "misc" subdirectories in the source 5 | distribution for more details. -------------------------------------------------------------------------------- /external/geotranz/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | # UTM, USNG, MGRS conversions 2 | 3 | set(GEOTRANZ_LIBRARIES geotranz CACHE INTERNAL "geotranz") 4 | 5 | list(APPEND geotranz_SOURCES 6 | error_string.c 7 | mgrs.c 8 | polarst.c 9 | tranmerc.c 10 | ups.c 11 | usng.c 12 | utm.c 13 | ) 14 | 15 | add_library(geotranz STATIC 16 | ${geotranz_SOURCES} 17 | ) 18 | -------------------------------------------------------------------------------- /external/geotranz/README-FIRST.txt: -------------------------------------------------------------------------------- 1 | 2 | This directory contains a subset of geotrans 2.4.2 from 3 | 4 | https://github.com/smanders/geotranz 5 | 6 | -------------------------------------------------------------------------------- /external/geotranz/error_string.c: -------------------------------------------------------------------------------- 1 | 2 | #include 3 | #include 4 | 5 | #include "utm.h" 6 | #include "mgrs.h" 7 | #include "usng.h" 8 | 9 | #include "error_string.h" 10 | 11 | 12 | // Convert error codes to text. 13 | // Note that the code is a bit mask so it is possible to have multiple messages. 14 | // Caller should probably provide space for a couple hundred characters to be safe. 15 | 16 | 17 | static const struct { 18 | long mask; 19 | char *msg; 20 | } utm_err [] = { 21 | 22 | { UTM_NO_ERROR, "No errors occurred in function" }, 23 | { UTM_LAT_ERROR, "Latitude outside of valid range (-80.5 to 84.5 degrees)" }, 24 | { UTM_LON_ERROR, "Longitude outside of valid range (-180 to 360 degrees)" }, 25 | { UTM_EASTING_ERROR, "Easting outside of valid range (100,000 to 900,000 meters)" }, 26 | { UTM_NORTHING_ERROR, "Northing outside of valid range (0 to 10,000,000 meters)" }, 27 | { UTM_ZONE_ERROR, "Zone outside of valid range (1 to 60)" }, 28 | { UTM_HEMISPHERE_ERROR, "Invalid hemisphere ('N' or 'S')" }, 29 | { UTM_ZONE_OVERRIDE_ERROR,"Zone outside of valid range (1 to 60) and within 1 of 'natural' zone" }, 30 | { UTM_A_ERROR, "Semi-major axis less than or equal to zero" }, 31 | { UTM_INV_F_ERROR, "Inverse flattening outside of valid range (250 to 350)" }, 32 | { 0, NULL } }; 33 | 34 | 35 | static const struct { 36 | long mask; 37 | char *msg; 38 | } mgrs_err [] = { 39 | 40 | { MGRS_NO_ERROR, "No errors occurred in function" }, 41 | { MGRS_LAT_ERROR, "Latitude outside of valid range (-90 to 90 degrees)" }, 42 | { MGRS_LON_ERROR, "Longitude outside of valid range (-180 to 360 degrees)" }, 43 | { MGRS_STRING_ERROR, "An MGRS string error: string too long, too short, or badly formed" }, 44 | { MGRS_PRECISION_ERROR, "The precision must be between 0 and 5 inclusive." }, 45 | { MGRS_A_ERROR, "Inverse flattening outside of valid range (250 to 350)" }, 46 | { MGRS_INV_F_ERROR, "Invalid hemisphere ('N' or 'S')" }, 47 | { MGRS_EASTING_ERROR, "Easting outside of valid range (100,000 to 900,000 meters for UTM) (0 to 4,000,000 meters for UPS)" }, 48 | { MGRS_NORTHING_ERROR, "Northing outside of valid range (0 to 10,000,000 meters for UTM) (0 to 4,000,000 meters for UPS)" }, 49 | { MGRS_ZONE_ERROR, "Zone outside of valid range (1 to 60)" }, 50 | { MGRS_HEMISPHERE_ERROR, "Invalid hemisphere ('N' or 'S')" }, 51 | { MGRS_LAT_WARNING, "Latitude warning ???" }, 52 | { 0, NULL } }; 53 | 54 | 55 | static const struct { 56 | long mask; 57 | char *msg; 58 | } usng_err [] = { 59 | 60 | { USNG_NO_ERROR, "No errors occurred in function" }, 61 | { USNG_LAT_ERROR, "Latitude outside of valid range (-90 to 90 degrees)" }, 62 | { USNG_LON_ERROR, "Longitude outside of valid range (-180 to 360 degrees)" }, 63 | { USNG_STRING_ERROR, "A USNG string error: string too long, too short, or badly formed" }, 64 | { USNG_PRECISION_ERROR, "The precision must be between 0 and 5 inclusive." }, 65 | { USNG_A_ERROR, "Inverse flattening outside of valid range (250 to 350)" }, 66 | { USNG_INV_F_ERROR, "Invalid hemisphere ('N' or 'S')" }, 67 | { USNG_EASTING_ERROR, "Easting outside of valid range (100,000 to 900,000 meters for UTM) (0 to 4,000,000 meters for UPS)" }, 68 | { USNG_NORTHING_ERROR, "Northing outside of valid range (0 to 10,000,000 meters for UTM) (0 to 4,000,000 meters for UPS)" }, 69 | { USNG_ZONE_ERROR, "Zone outside of valid range (1 to 60)" }, 70 | { USNG_HEMISPHERE_ERROR, "Invalid hemisphere ('N' or 'S')" }, 71 | { USNG_LAT_WARNING, "Latitude warning ???" }, 72 | { 0, NULL } }; 73 | 74 | 75 | 76 | void utm_error_string (long err, char *str) 77 | { 78 | int n; 79 | 80 | strcpy (str, ""); 81 | 82 | for (n = 1; utm_err[n].mask != 0; n++) { 83 | if (err & utm_err[n].mask) { 84 | if (strlen(str) > 0) strcat(str, "\n"); 85 | strcat (str, utm_err[n].msg); 86 | } 87 | } 88 | 89 | if (strlen(str) == 0) { 90 | strcpy (str, utm_err[0].msg); 91 | } 92 | } 93 | 94 | void mgrs_error_string (long err, char *str) 95 | { 96 | int n; 97 | 98 | strcpy (str, ""); 99 | 100 | for (n = 1; mgrs_err[n].mask != 0; n++) { 101 | if (err & mgrs_err[n].mask) { 102 | if (strlen(str) > 0) strcat(str, "\n"); 103 | strcat (str, mgrs_err[n].msg); 104 | } 105 | } 106 | 107 | if (strlen(str) == 0) { 108 | strcpy (str, mgrs_err[0].msg); 109 | } 110 | } 111 | 112 | 113 | void usng_error_string (long err, char *str) 114 | { 115 | int n; 116 | 117 | strcpy (str, ""); 118 | 119 | for (n = 1; usng_err[n].mask != 0; n++) { 120 | if (err & usng_err[n].mask) { 121 | if (strlen(str) > 0) strcat(str, "\n"); 122 | strcat (str, usng_err[n].msg); 123 | } 124 | } 125 | 126 | if (strlen(str) == 0) { 127 | strcpy (str, usng_err[0].msg); 128 | } 129 | } 130 | 131 | 132 | -------------------------------------------------------------------------------- /external/geotranz/error_string.h: -------------------------------------------------------------------------------- 1 | 2 | 3 | void utm_error_string (long err, char *str); 4 | 5 | void mgrs_error_string (long err, char *str); 6 | 7 | void usng_error_string (long err, char *str); 8 | -------------------------------------------------------------------------------- /external/geotranz/readme.txt: -------------------------------------------------------------------------------- 1 | GEOTRANS 2.4.2 2 | 3 | The GEOTRANS 2.4.2 software was developed and tested on Windows XP, Solaris 7, Red Hat Linux Professional 9, and SuSE Linux 9.3 platforms, and should function correctly on more recent versions of those operating systems. 4 | 5 | There are eight different GEOTRANS 2.4.2 distribution files - four for Windows, in zip format, and four for UNIX/Linux, in tar/gzip format: 6 | 7 | win_user.zip - Windows end-user's package 8 | win_dev.zip - Windows developer's package 9 | master.zip - master copy (everything) in zip format 10 | mgrs.zip - MGRS & supporting projections in zip format 11 | 12 | unix_user.tgz - UNIX/Linux end-user's package 13 | unix_dev.tgz - UNIX/Linux developer's package 14 | master.tgz - master copy (everything) in tar/gzip format 15 | mgrs.tgz - MGRS & supporting projections in tar/gzip 16 | 17 | The Windows packages omit the UNIX/Linux-specific directories, while the UNIX/Linux packages omit the Windows-specific directories. 18 | 19 | The end-user packages contain only executables, DLLs or shared object libraries, documentation, and supporting data. 20 | 21 | The developer packages also include source code, as well as makefiles, MS Visual C++ workspace and project files, and everything else necessary to build the libraries and executables. 22 | 23 | The master packages can be considered to be cross-platform developer packages. They both contain the union of the Windows and UNIX/Linux developer packages. Only their format is different. 24 | 25 | The MGRS packages contain only the source code for the MGRS, UTM, UPS, Transverse Mercator, and Polar Stereographic conversion modules, and are intended for developers who only want to do MGRS conversions. Their content is identical. Only their format is different. 26 | 27 | You should only need to copy one of these packages, depending on your platform and your intended usage. 28 | 29 | GEOTRANS Terms of Use: 30 | 31 | 1. The GEOTRANS source code ("the software") is provided free of charge by the National Geospatial-Intelligence Agency (NGA) of the United States Department of Defense. Although NGA makes no copyright claim under Title 17 U.S.C., NGA claims copyrights in the source code under other legal regimes. NGA hereby grants to each user of the software a license to use and distribute the software, and develop derivative works. 32 | 33 | 2. NGA requests that products developed using the software credit the source of the software with the following statement, "The product was developed using GEOTRANS, a product of the National Geospatial-Intelligence Agency (NGA) and U.S. Army Engineering Research and Development Center." Do not use the name GEOTRANS for any derived work. 34 | 35 | 3. Warranty Disclaimer: The software was developed to meet only the internal requirements of the National Geospatial-Intelligence Agency (NGA). The software is provided "as is," and no warranty, express or implied, including but not limited to the implied warranties of merchantability and fitness for particular purpose or arising by statute or otherwise in law or from a course of dealing or usage in trade, is made by NGA as to the accuracy and functioning of the software. 36 | 37 | 4. NGA and its personnel are not required to provide technical support or general assistance with respect to public use of the software. Government customers may contact NGA. 38 | 39 | 5. Neither NGA nor its personnel will be liable for any claims, losses, or damages arising from or connected with the use of the software. The user agrees to hold harmless the United States National Geospatial-Intelligence Agency (NGA). The user's sole and exclusive remedy is to stop using the software. 40 | 41 | 6. Please be advised that pursuant to the United States Code, 10 U.S.C. 425, the name of the National Geospatial-Intelligence Agency, the initials "NGA", the seal of the National Geospatial-Intelligence Agency, or any colorable imitation thereof shall not be used to imply approval, endorsement, or authorization of a product without prior written permission from United States Secretary of Defense. Do not create the impression that NGA, the Secretary of Defense or the Director of National Intelligence has endorsed any product derived from GEOTRANS. 42 | -------------------------------------------------------------------------------- /external/geotranz/releasenotes.txt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wb2osz/direwolf/390d4a8c2733565748cb85c96d0bcdf2562807cb/external/geotranz/releasenotes.txt -------------------------------------------------------------------------------- /external/hidapi/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | set(HIDAPI_LIBRARIES "" CACHE INTERNAL "") 2 | 3 | if(WIN32 OR CYGWIN) # windows 4 | 5 | set(HIDAPI_LIBRARIES hidapi CACHE INTERNAL "hidapi") 6 | 7 | list(APPEND hidapi_SOURCES 8 | # Functions for accessing HID devices on Windows. 9 | # These were copied from https://github.com/libusb/hidapi 10 | ${CUSTOM_HIDAPI_DIR}/hid.c 11 | ) 12 | 13 | add_library(hidapi STATIC 14 | ${hidapi_SOURCES} 15 | ) 16 | 17 | set_target_properties(hidapi 18 | PROPERTIES COMPILE_FLAGS "-Dbool=int -Dtrue=1 -Dfalse=0 -DUSE_HIDAPI_STATIC" 19 | ) 20 | 21 | endif() 22 | -------------------------------------------------------------------------------- /external/hidapi/LICENSE-bsd.txt: -------------------------------------------------------------------------------- 1 | Copyright (c) 2010, Alan Ott, Signal 11 Software 2 | All rights reserved. 3 | 4 | Redistribution and use in source and binary forms, with or without 5 | modification, are permitted provided that the following conditions are met: 6 | 7 | * Redistributions of source code must retain the above copyright notice, 8 | this list of conditions and the following disclaimer. 9 | * Redistributions in binary form must reproduce the above copyright 10 | notice, this list of conditions and the following disclaimer in the 11 | documentation and/or other materials provided with the distribution. 12 | * Neither the name of Signal 11 Software nor the names of its 13 | contributors may be used to endorse or promote products derived from 14 | this software without specific prior written permission. 15 | 16 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 17 | AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 18 | IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 19 | ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE 20 | LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 21 | CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 22 | SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 23 | INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 24 | CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 25 | ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 26 | POSSIBILITY OF SUCH DAMAGE. 27 | -------------------------------------------------------------------------------- /external/hidapi/LICENSE-orig.txt: -------------------------------------------------------------------------------- 1 | HIDAPI - Multi-Platform library for 2 | communication with HID devices. 3 | 4 | Copyright 2009, Alan Ott, Signal 11 Software. 5 | All Rights Reserved. 6 | 7 | This software may be used by anyone for any reason so 8 | long as the copyright notice in the source files 9 | remains intact. 10 | -------------------------------------------------------------------------------- /external/hidapi/LICENSE.txt: -------------------------------------------------------------------------------- 1 | HIDAPI can be used under one of three licenses. 2 | 3 | 1. The GNU General Public License, version 3.0, in LICENSE-gpl3.txt 4 | 2. A BSD-Style License, in LICENSE-bsd.txt. 5 | 3. The more liberal original HIDAPI license. LICENSE-orig.txt 6 | 7 | The license chosen is at the discretion of the user of HIDAPI. For example: 8 | 1. An author of GPL software would likely use HIDAPI under the terms of the 9 | GPL. 10 | 11 | 2. An author of commercial closed-source software would likely use HIDAPI 12 | under the terms of the BSD-style license or the original HIDAPI license. 13 | 14 | -------------------------------------------------------------------------------- /external/hidapi/README.md: -------------------------------------------------------------------------------- 1 | This is from https://github.com/libusb/hidapi 2 | -------------------------------------------------------------------------------- /external/misc/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | 2 | set(MISC_LIBRARIES misc CACHE INTERNAL "misc") 3 | 4 | include_directories( 5 | ${CMAKE_SOURCE_DIR}/src 6 | ) 7 | 8 | if(LINUX) 9 | # Previously - 10 | # list(APPEND misc_SOURCES 11 | # # Provide our own copy of strlcpy and strlcat 12 | # # because they are not included with Linux. 13 | # ${CUSTOM_MISC_DIR}/strlcpy.c 14 | # ${CUSTOM_MISC_DIR}/strlcat.c 15 | # ) 16 | # It seems that Alpine Linux and Void Linux have strlcpy and 17 | # strlcat so we need to handle the situation more delicately. 18 | # When doing it this way, there is probably no reason to 19 | # distinguish between Linux and BSD-like systems here. 20 | # If we kept going, the same thing could be done for each 21 | # of the functions and no OS check would be needed. 22 | 23 | if (NOT HAVE_STRLCPY) 24 | list(APPEND misc_SOURCES 25 | ${CUSTOM_MISC_DIR}/strlcpy.c 26 | ) 27 | endif() 28 | 29 | if (NOT HAVE_STRLCAT) 30 | list(APPEND misc_SOURCES 31 | ${CUSTOM_MISC_DIR}/strlcat.c 32 | ) 33 | endif() 34 | 35 | # Add_library doesn't like to get an empty source file list. 36 | # I tried several variations on this theme to test whether the list 37 | # was not empty and was not successful in getting it to work 38 | # on both Alpine and RPi. 39 | #if("${misc_SOURCES}") 40 | # This is less elegant and less maintainable but it works. 41 | 42 | if ((NOT HAVE_STRLCPY) OR (NOT HAVE_STRLCAT)) 43 | add_library(misc STATIC 44 | ${misc_SOURCES} 45 | ) 46 | else() 47 | set(MISC_LIBRARIES "" CACHE INTERNAL "") 48 | endif() 49 | 50 | 51 | 52 | elseif(WIN32 OR CYGWIN) # windows 53 | 54 | list(APPEND misc_SOURCES 55 | # There are several string functions found in Linux 56 | # but not on Windows. Need to provide our own copy. 57 | ${CUSTOM_MISC_DIR}/strsep.c 58 | ${CUSTOM_MISC_DIR}/strtok_r.c 59 | ${CUSTOM_MISC_DIR}/strcasestr.c 60 | ${CUSTOM_MISC_DIR}/strlcpy.c 61 | ${CUSTOM_MISC_DIR}/strlcat.c 62 | ) 63 | 64 | add_library(misc STATIC 65 | ${misc_SOURCES} 66 | ) 67 | 68 | else() 69 | 70 | # on macOS, OpenBSD and FreeBSD not misc is necessary 71 | set(MISC_LIBRARIES "" CACHE INTERNAL "") 72 | 73 | endif() 74 | -------------------------------------------------------------------------------- /external/misc/README: -------------------------------------------------------------------------------- 1 | 2 | Files in this directory fill in the gaps missing for some operating systems. 3 | 4 | 5 | -------------------------------------- 6 | 7 | These are part of the standard C library for Linux, BSD Unix, and similar operating systems. 8 | They are not present for MS Windows so we need to supply our own copy. 9 | 10 | From http://ftp.netbsd.org/pub/pkgsrc/current/pkgsrc/net/tnftp/files/libnetbsd/strsep.c 11 | and other BSD locations. 12 | 13 | strsep.c 14 | strcasestr.c 15 | strtok_r.c 16 | 17 | -------------------------------------- 18 | 19 | 20 | These are needed for the Linux and Windows versions. 21 | They should be part of the standard C library for OpenBSD, FreeBSD, Mac OS X. 22 | 23 | http://ftp.netbsd.org/pub/pkgsrc/current/pkgsrc/net/tnftp/files/libnetbsd/strlcpy.c 24 | http://ftp.netbsd.org/pub/pkgsrc/current/pkgsrc/net/tnftp/files/libnetbsd/strlcat.c 25 | 26 | strlcpy.c 27 | strlcat.c -------------------------------------------------------------------------------- /external/misc/strcasestr.c: -------------------------------------------------------------------------------- 1 | /*- 2 | * Copyright (c) 1990, 1993 3 | * The Regents of the University of California. All rights reserved. 4 | * 5 | * This code is derived from software contributed to Berkeley by 6 | * Chris Torek. 7 | * 8 | * Redistribution and use in source and binary forms, with or without 9 | * modification, are permitted provided that the following conditions 10 | * are met: 11 | * 1. Redistributions of source code must retain the above copyright 12 | * notice, this list of conditions and the following disclaimer. 13 | * 2. Redistributions in binary form must reproduce the above copyright 14 | * notice, this list of conditions and the following disclaimer in the 15 | * documentation and/or other materials provided with the distribution. 16 | * 3. All advertising materials mentioning features or use of this software 17 | * must display the following acknowledgement: 18 | * This product includes software developed by the University of 19 | * California, Berkeley and its contributors. 20 | * 4. Neither the name of the University nor the names of its contributors 21 | * may be used to endorse or promote products derived from this software 22 | * without specific prior written permission. 23 | * 24 | * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND 25 | * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 26 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 27 | * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE 28 | * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 29 | * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 30 | * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 31 | * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 32 | * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 33 | * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 34 | * SUCH DAMAGE. 35 | */ 36 | 37 | //#include 38 | 39 | #include 40 | #include 41 | 42 | /* 43 | * Find the first occurrence of find in s, ignore case. 44 | */ 45 | char * 46 | strcasestr(const char *s, const char *find) 47 | { 48 | char c, sc; 49 | size_t len; 50 | 51 | if ((c = *find++) != 0) { 52 | c = tolower((unsigned char)c); 53 | len = strlen(find); 54 | do { 55 | do { 56 | if ((sc = *s++) == 0) 57 | return (NULL); 58 | } while ((char)tolower((unsigned char)sc) != c); 59 | } while (strncasecmp(s, find, len) != 0); 60 | s--; 61 | } 62 | return ((char *)s); 63 | } 64 | -------------------------------------------------------------------------------- /external/misc/strlcat.c: -------------------------------------------------------------------------------- 1 | 2 | 3 | /*------------------------------------------------------------------ 4 | * 5 | * Module: strlcat.c 6 | * 7 | * Purpose: Safe string functions to guard against buffer overflow. 8 | * 9 | * Description: The size of character strings, especially when coming from the 10 | * outside, can sometimes exceed a fixed size storage area. 11 | * 12 | * There was one case where a MIC-E format packet had an enormous 13 | * comment that exceeded an internal buffer of 256 characters, 14 | * resulting in a crash. 15 | * 16 | * We are not always meticulous about checking sizes to avoid overflow. 17 | * Use of these functions, instead of strcpy and strcat, should 18 | * help avoid issues. 19 | * 20 | * Orgin: From OpenBSD as the copyright notice indicates. 21 | * The GNU folks didn't think it was appropriate for inclusion 22 | * in glibc. https://lwn.net/Articles/507319/ 23 | * 24 | * Modifications: Added extra debug output when strings are truncated. 25 | * Not sure if I will leave this in the release version 26 | * or just let it happen silently. 27 | * 28 | *---------------------------------------------------------------*/ 29 | 30 | #include "direwolf.h" 31 | 32 | #include 33 | #include 34 | 35 | #include "textcolor.h" 36 | 37 | 38 | /* $NetBSD: strlcat.c,v 1.5 2014/10/31 18:59:32 spz Exp $ */ 39 | /* from NetBSD: strlcat.c,v 1.16 2003/10/27 00:12:42 lukem Exp */ 40 | /* from OpenBSD: strlcat.c,v 1.10 2003/04/12 21:56:39 millert Exp */ 41 | 42 | /* 43 | * Copyright (c) 1998 Todd C. Miller 44 | * 45 | * Permission to use, copy, modify, and distribute this software for any 46 | * purpose with or without fee is hereby granted, provided that the above 47 | * copyright notice and this permission notice appear in all copies. 48 | * 49 | * THE SOFTWARE IS PROVIDED "AS IS" AND TODD C. MILLER DISCLAIMS ALL 50 | * WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES 51 | * OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL TODD C. MILLER BE LIABLE 52 | * FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES 53 | * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION 54 | * OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN 55 | * CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. 56 | */ 57 | 58 | 59 | 60 | /* 61 | * Appends src to string dst of size siz (unlike strncat, siz is the 62 | * full size of dst, not space left). At most siz-1 characters 63 | * will be copied. Always NUL terminates (unless siz <= strlen(dst)). 64 | * Returns strlen(src) + MIN(siz, strlen(initial dst)). 65 | * If retval >= siz, truncation occurred. 66 | */ 67 | 68 | #if DEBUG_STRL 69 | size_t strlcat_debug(char *__restrict__ dst, const char *__restrict__ src, size_t siz, const char *file, const char *func, int line) 70 | #else 71 | size_t strlcat_debug(char *__restrict__ dst, const char *__restrict__ src, size_t siz) 72 | #endif 73 | { 74 | char *d = dst; 75 | const char *s = src; 76 | size_t n = siz; 77 | size_t dlen; 78 | size_t retval; 79 | 80 | #if DEBUG_STRL 81 | if (dst == NULL) { 82 | text_color_set (DW_COLOR_ERROR); 83 | dw_printf ("ERROR: strlcat dst is NULL. (%s %s %d)\n", file, func, line); 84 | return (0); 85 | } 86 | if (src == NULL) { 87 | text_color_set (DW_COLOR_ERROR); 88 | dw_printf ("ERROR: strlcat src is NULL. (%s %s %d)\n", file, func, line); 89 | return (0); 90 | } 91 | if (siz == 1 || siz == 4) { 92 | text_color_set (DW_COLOR_ERROR); 93 | dw_printf ("Suspicious strlcat siz. Is it using sizeof a pointer variable? (%s %s %d)\n", file, func, line); 94 | } 95 | #endif 96 | 97 | /* Find the end of dst and adjust bytes left but don't go past end */ 98 | while (n-- != 0 && *d != '\0') 99 | d++; 100 | dlen = d - dst; 101 | n = siz - dlen; 102 | 103 | if (n == 0) { 104 | retval = dlen + strlen(s); 105 | goto the_end; 106 | } 107 | while (*s != '\0') { 108 | if (n != 1) { 109 | *d++ = *s; 110 | n--; 111 | } 112 | s++; 113 | } 114 | *d = '\0'; 115 | 116 | retval = dlen + (s - src); /* count does not include NUL */ 117 | the_end: 118 | 119 | #if DEBUG_STRL 120 | if (retval >= siz) { 121 | text_color_set (DW_COLOR_ERROR); 122 | dw_printf ("WARNING: strlcat result length %d exceeds maximum length %d. (%s %s %d)\n", 123 | (int)retval, (int)(siz-1), file, func, line); 124 | } 125 | #endif 126 | return (retval); 127 | } -------------------------------------------------------------------------------- /external/misc/strlcpy.c: -------------------------------------------------------------------------------- 1 | 2 | 3 | /*------------------------------------------------------------------ 4 | * 5 | * Module: strlcpy.c 6 | * 7 | * Purpose: Safe string functions to guard against buffer overflow. 8 | * 9 | * Description: The size of character strings, especially when coming from the 10 | * outside, can sometimes exceed a fixed size storage area. 11 | * 12 | * There was one case where a MIC-E format packet had an enormous 13 | * comment that exceeded an internal buffer of 256 characters, 14 | * resulting in a crash. 15 | * 16 | * We are not always meticulous about checking sizes to avoid overflow. 17 | * Use of these functions, instead of strcpy and strcat, should 18 | * help avoid issues. 19 | * 20 | * Orgin: From OpenBSD as the copyright notice indicates. 21 | * The GNU folks didn't think it was appropriate for inclusion 22 | * in glibc. https://lwn.net/Articles/507319/ 23 | * 24 | * Modifications: Added extra debug output when strings are truncated. 25 | * Not sure if I will leave this in the release version 26 | * or just let it happen silently. 27 | * 28 | *---------------------------------------------------------------*/ 29 | 30 | 31 | 32 | /* $NetBSD: strlcpy.c,v 1.5 2014/10/31 18:59:32 spz Exp $ */ 33 | /* from NetBSD: strlcpy.c,v 1.14 2003/10/27 00:12:42 lukem Exp */ 34 | /* from OpenBSD: strlcpy.c,v 1.7 2003/04/12 21:56:39 millert Exp */ 35 | 36 | /* 37 | * Copyright (c) 1998 Todd C. Miller 38 | * 39 | * Permission to use, copy, modify, and distribute this software for any 40 | * purpose with or without fee is hereby granted, provided that the above 41 | * copyright notice and this permission notice appear in all copies. 42 | * 43 | * THE SOFTWARE IS PROVIDED "AS IS" AND TODD C. MILLER DISCLAIMS ALL 44 | * WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES 45 | * OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL TODD C. MILLER BE LIABLE 46 | * FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES 47 | * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION 48 | * OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN 49 | * CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. 50 | */ 51 | 52 | #include "direwolf.h" 53 | 54 | #include 55 | #include 56 | 57 | #include "textcolor.h" 58 | 59 | /* 60 | * Copy src to string dst of size siz. At most siz-1 characters 61 | * will be copied. Always NUL terminates (unless siz == 0). 62 | * Returns strlen(src); if retval >= siz, truncation occurred. 63 | */ 64 | 65 | #if DEBUG_STRL 66 | size_t strlcpy_debug(char *__restrict__ dst, const char *__restrict__ src, size_t siz, const char *file, const char *func, int line) 67 | #else 68 | size_t strlcpy_debug(char *__restrict__ dst, const char *__restrict__ src, size_t siz) 69 | #endif 70 | { 71 | char *d = dst; 72 | const char *s = src; 73 | size_t n = siz; 74 | size_t retval; 75 | 76 | #if DEBUG_STRL 77 | if (dst == NULL) { 78 | text_color_set (DW_COLOR_ERROR); 79 | dw_printf ("ERROR: strlcpy dst is NULL. (%s %s %d)\n", file, func, line); 80 | return (0); 81 | } 82 | if (src == NULL) { 83 | text_color_set (DW_COLOR_ERROR); 84 | dw_printf ("ERROR: strlcpy src is NULL. (%s %s %d)\n", file, func, line); 85 | return (0); 86 | } 87 | if (siz == 1 || siz == 4) { 88 | text_color_set (DW_COLOR_ERROR); 89 | dw_printf ("Suspicious strlcpy siz. Is it using sizeof a pointer variable? (%s %s %d)\n", file, func, line); 90 | } 91 | #endif 92 | 93 | /* Copy as many bytes as will fit */ 94 | if (n != 0 && --n != 0) { 95 | do { 96 | if ((*d++ = *s++) == 0) 97 | break; 98 | } while (--n != 0); 99 | } 100 | 101 | /* Not enough room in dst, add NUL and traverse rest of src */ 102 | if (n == 0) { 103 | if (siz != 0) 104 | *d = '\0'; /* NUL-terminate dst */ 105 | while (*s++) 106 | ; 107 | } 108 | 109 | retval = s - src - 1; /* count does not include NUL */ 110 | 111 | #if DEBUG_STRL 112 | if (retval >= siz) { 113 | text_color_set (DW_COLOR_ERROR); 114 | dw_printf ("WARNING: strlcpy result length %d exceeds maximum length %d. (%s %s %d)\n", 115 | (int)retval, (int)(siz-1), file, func, line); 116 | } 117 | #endif 118 | return (retval); 119 | } 120 | 121 | -------------------------------------------------------------------------------- /external/misc/strsep.c: -------------------------------------------------------------------------------- 1 | /* $NetBSD: strsep.c,v 1.5 2014/10/31 18:59:32 spz Exp $ */ 2 | /* from NetBSD: strsep.c,v 1.14 2003/08/07 16:43:52 agc Exp */ 3 | 4 | /*- 5 | * Copyright (c) 1990, 1993 6 | * The Regents of the University of California. All rights reserved. 7 | * 8 | * Redistribution and use in source and binary forms, with or without 9 | * modification, are permitted provided that the following conditions 10 | * are met: 11 | * 1. Redistributions of source code must retain the above copyright 12 | * notice, this list of conditions and the following disclaimer. 13 | * 2. Redistributions in binary form must reproduce the above copyright 14 | * notice, this list of conditions and the following disclaimer in the 15 | * documentation and/or other materials provided with the distribution. 16 | * 3. Neither the name of the University nor the names of its contributors 17 | * may be used to endorse or promote products derived from this software 18 | * without specific prior written permission. 19 | * 20 | * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND 21 | * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 22 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 23 | * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE 24 | * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 25 | * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 26 | * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 27 | * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 28 | * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 29 | * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 30 | * SUCH DAMAGE. 31 | */ 32 | 33 | //#include "tnftp.h" 34 | #include 35 | 36 | /* 37 | * Get next token from string *stringp, where tokens are possibly-empty 38 | * strings separated by characters from delim. 39 | * 40 | * Writes NULs into the string at *stringp to end tokens. 41 | * delim need not remain constant from call to call. 42 | * On return, *stringp points past the last NUL written (if there might 43 | * be further tokens), or is NULL (if there are definitely no more tokens). 44 | * 45 | * If *stringp is NULL, strsep returns NULL. 46 | */ 47 | char * 48 | strsep(char **stringp, const char *delim) 49 | { 50 | char *s; 51 | const char *spanp; 52 | int c, sc; 53 | char *tok; 54 | 55 | if ((s = *stringp) == NULL) 56 | return (NULL); 57 | for (tok = s;;) { 58 | c = *s++; 59 | spanp = delim; 60 | do { 61 | if ((sc = *spanp++) == c) { 62 | if (c == 0) 63 | s = NULL; 64 | else 65 | s[-1] = 0; 66 | *stringp = s; 67 | return (tok); 68 | } 69 | } while (sc != 0); 70 | } 71 | /* NOTREACHED */ 72 | } 73 | -------------------------------------------------------------------------------- /external/misc/strtok_r.c: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 1988 Regents of the University of California. 3 | * All rights reserved. 4 | * 5 | * Redistribution and use in source and binary forms, with or without 6 | * modification, are permitted provided that the following conditions 7 | * are met: 8 | * 1. Redistributions of source code must retain the above copyright 9 | * notice, this list of conditions and the following disclaimer. 10 | * 2. Redistributions in binary form must reproduce the above copyright 11 | * notice, this list of conditions and the following disclaimer in the 12 | * documentation and/or other materials provided with the distribution. 13 | * 3. Neither the name of the University nor the names of its contributors 14 | * may be used to endorse or promote products derived from this software 15 | * without specific prior written permission. 16 | * 17 | * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND 18 | * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 19 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 20 | * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE 21 | * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 22 | * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 23 | * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 24 | * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 25 | * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 26 | * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 27 | * SUCH DAMAGE. 28 | */ 29 | 30 | #include 31 | 32 | #define _DEFUN(name,arglist,args) name(args) 33 | #define _AND , 34 | 35 | char * 36 | _DEFUN (__strtok_r, (s, delim, lasts, skip_leading_delim), 37 | register char *s _AND 38 | register const char *delim _AND 39 | char **lasts _AND 40 | int skip_leading_delim) 41 | { 42 | register char *spanp; 43 | register int c, sc; 44 | char *tok; 45 | 46 | 47 | if (s == NULL && (s = *lasts) == NULL) 48 | return (NULL); 49 | 50 | /* 51 | * Skip (span) leading delimiters (s += strspn(s, delim), sort of). 52 | */ 53 | cont: 54 | c = *s++; 55 | for (spanp = (char *)delim; (sc = *spanp++) != 0;) { 56 | if (c == sc) { 57 | if (skip_leading_delim) { 58 | goto cont; 59 | } 60 | else { 61 | *lasts = s; 62 | s[-1] = 0; 63 | return (s - 1); 64 | } 65 | } 66 | } 67 | 68 | if (c == 0) { /* no non-delimiter characters */ 69 | *lasts = NULL; 70 | return (NULL); 71 | } 72 | tok = s - 1; 73 | 74 | /* 75 | * Scan token (scan for delimiters: s += strcspn(s, delim), sort of). 76 | * Note that delim must have one NUL; we stop if we see that, too. 77 | */ 78 | for (;;) { 79 | c = *s++; 80 | spanp = (char *)delim; 81 | do { 82 | if ((sc = *spanp++) == c) { 83 | if (c == 0) 84 | s = NULL; 85 | else 86 | s[-1] = 0; 87 | *lasts = s; 88 | return (tok); 89 | } 90 | } while (sc != 0); 91 | } 92 | /* NOTREACHED */ 93 | } 94 | 95 | char * 96 | _DEFUN (strtok_r, (s, delim, lasts), 97 | register char *s _AND 98 | register const char *delim _AND 99 | char **lasts) 100 | { 101 | return __strtok_r (s, delim, lasts, 1); 102 | } 103 | -------------------------------------------------------------------------------- /external/regex/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | set(REGEX_LIBRARIES "" CACHE INTERNAL "") 2 | 3 | if(WIN32 OR CYGWIN) # windows 4 | 5 | set(REGEX_LIBRARIES regex CACHE INTERNAL "regex") 6 | 7 | list(APPEND regex_SOURCES 8 | # When building for Linux, we use regular expression 9 | # functions supplied by the gnu C library. 10 | # For the native WIN32 version, we need to use our own copy. 11 | # These were copied from http://gnuwin32.sourceforge.net/packages/regex.htm 12 | # Consider upgrading from https://www.gnu.org/software/libc/sources.html 13 | ${CUSTOM_REGEX_DIR}/regex.c 14 | ) 15 | 16 | add_library(regex STATIC 17 | ${regex_SOURCES} 18 | ) 19 | 20 | set_target_properties(regex 21 | PROPERTIES COMPILE_FLAGS "-Dbool=int -Dtrue=1 -Dfalse=0 -DREGEX_STATIC" 22 | ) 23 | 24 | endif() 25 | -------------------------------------------------------------------------------- /external/regex/NEWS: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wb2osz/direwolf/390d4a8c2733565748cb85c96d0bcdf2562807cb/external/regex/NEWS -------------------------------------------------------------------------------- /external/regex/README: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wb2osz/direwolf/390d4a8c2733565748cb85c96d0bcdf2562807cb/external/regex/README -------------------------------------------------------------------------------- /external/regex/README-dire-wolf.txt: -------------------------------------------------------------------------------- 1 | This is NOT used for the Linux version. 2 | For Linux and Cygwin, we use the built-in regular expression library. 3 | For the Windows version, we need to include our own version. 4 | 5 | The source was obtained from: 6 | 7 | http://gnuwin32.sourceforge.net/packages/regex.htm 8 | 9 | That is very old with loads of compile warnings. Should we upgrade from here? 10 | 11 | https://www.gnu.org/software/libc/sources.html -------------------------------------------------------------------------------- /external/regex/re_comp.h: -------------------------------------------------------------------------------- 1 | /* Copyright (C) 1996 Free Software Foundation, Inc. 2 | This file is part of the GNU C Library. 3 | 4 | The GNU C Library is free software; you can redistribute it and/or 5 | modify it under the terms of the GNU Lesser General Public 6 | License as published by the Free Software Foundation; either 7 | version 2.1 of the License, or (at your option) any later version. 8 | 9 | The GNU C Library is distributed in the hope that it will be useful, 10 | but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 12 | Lesser General Public License for more details. 13 | 14 | You should have received a copy of the GNU Lesser General Public 15 | License along with the GNU C Library; if not, write to the Free 16 | Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 17 | 02111-1307 USA. */ 18 | 19 | #ifndef _RE_COMP_H 20 | #define _RE_COMP_H 1 21 | 22 | /* This is only a wrapper around the file. XPG4.2 mentions 23 | this name. */ 24 | #include 25 | 26 | #endif /* re_comp.h */ 27 | -------------------------------------------------------------------------------- /external/regex/regex.c: -------------------------------------------------------------------------------- 1 | /* Extended regular expression matching and search library. 2 | Copyright (C) 2002, 2003, 2005 Free Software Foundation, Inc. 3 | This file is part of the GNU C Library. 4 | Contributed by Isamu Hasegawa . 5 | 6 | The GNU C Library is free software; you can redistribute it and/or 7 | modify it under the terms of the GNU Lesser General Public 8 | License as published by the Free Software Foundation; either 9 | version 2.1 of the License, or (at your option) any later version. 10 | 11 | The GNU C Library is distributed in the hope that it will be useful, 12 | but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 14 | Lesser General Public License for more details. 15 | 16 | You should have received a copy of the GNU Lesser General Public 17 | License along with the GNU C Library; if not, write to the Free 18 | Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 19 | 02111-1307 USA. */ 20 | 21 | #ifdef HAVE_CONFIG_H 22 | #include "config.h" 23 | #endif 24 | 25 | /* Make sure noone compiles this code with a C++ compiler. */ 26 | #ifdef __cplusplus 27 | # error "This is C code, use a C compiler" 28 | #endif 29 | 30 | #ifdef _LIBC 31 | /* We have to keep the namespace clean. */ 32 | # define regfree(preg) __regfree (preg) 33 | # define regexec(pr, st, nm, pm, ef) __regexec (pr, st, nm, pm, ef) 34 | # define regcomp(preg, pattern, cflags) __regcomp (preg, pattern, cflags) 35 | # define regerror(errcode, preg, errbuf, errbuf_size) \ 36 | __regerror(errcode, preg, errbuf, errbuf_size) 37 | # define re_set_registers(bu, re, nu, st, en) \ 38 | __re_set_registers (bu, re, nu, st, en) 39 | # define re_match_2(bufp, string1, size1, string2, size2, pos, regs, stop) \ 40 | __re_match_2 (bufp, string1, size1, string2, size2, pos, regs, stop) 41 | # define re_match(bufp, string, size, pos, regs) \ 42 | __re_match (bufp, string, size, pos, regs) 43 | # define re_search(bufp, string, size, startpos, range, regs) \ 44 | __re_search (bufp, string, size, startpos, range, regs) 45 | # define re_compile_pattern(pattern, length, bufp) \ 46 | __re_compile_pattern (pattern, length, bufp) 47 | # define re_set_syntax(syntax) __re_set_syntax (syntax) 48 | # define re_search_2(bufp, st1, s1, st2, s2, startpos, range, regs, stop) \ 49 | __re_search_2 (bufp, st1, s1, st2, s2, startpos, range, regs, stop) 50 | # define re_compile_fastmap(bufp) __re_compile_fastmap (bufp) 51 | 52 | # include "../locale/localeinfo.h" 53 | #endif 54 | 55 | /* On some systems, limits.h sets RE_DUP_MAX to a lower value than 56 | GNU regex allows. Include it before , which correctly 57 | #undefs RE_DUP_MAX and sets it to the right value. */ 58 | #include 59 | 60 | #include 61 | #include "regex_internal.h" 62 | 63 | #include "regex_internal.c" 64 | #include "regcomp.c" 65 | #include "regexec.c" 66 | 67 | /* Binary backward compatibility. */ 68 | #if _LIBC 69 | # include 70 | # if SHLIB_COMPAT (libc, GLIBC_2_0, GLIBC_2_3) 71 | link_warning (re_max_failures, "the 're_max_failures' variable is obsolete and will go away.") 72 | int re_max_failures = 2000; 73 | # endif 74 | #endif 75 | -------------------------------------------------------------------------------- /fx25.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wb2osz/direwolf/390d4a8c2733565748cb85c96d0bcdf2562807cb/fx25.png -------------------------------------------------------------------------------- /man/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | if(NOT (WIN32 OR CYGWIN)) 2 | install(FILES "${CUSTOM_MAN_DIR}/aclients.1" DESTINATION ${INSTALL_MAN_DIR}) 3 | install(FILES "${CUSTOM_MAN_DIR}/atest.1" DESTINATION ${INSTALL_MAN_DIR}) 4 | install(FILES "${CUSTOM_MAN_DIR}/decode_aprs.1" DESTINATION ${INSTALL_MAN_DIR}) 5 | install(FILES "${CUSTOM_MAN_DIR}/direwolf.1" DESTINATION ${INSTALL_MAN_DIR}) 6 | install(FILES "${CUSTOM_MAN_DIR}/gen_packets.1" DESTINATION ${INSTALL_MAN_DIR}) 7 | install(FILES "${CUSTOM_MAN_DIR}/kissutil.1" DESTINATION ${INSTALL_MAN_DIR}) 8 | install(FILES "${CUSTOM_MAN_DIR}/ll2utm.1" DESTINATION ${INSTALL_MAN_DIR}) 9 | install(FILES "${CUSTOM_MAN_DIR}/log2gpx.1" DESTINATION ${INSTALL_MAN_DIR}) 10 | install(FILES "${CUSTOM_MAN_DIR}/text2tt.1" DESTINATION ${INSTALL_MAN_DIR}) 11 | install(FILES "${CUSTOM_MAN_DIR}/tt2text.1" DESTINATION ${INSTALL_MAN_DIR}) 12 | install(FILES "${CUSTOM_MAN_DIR}/utm2ll.1" DESTINATION ${INSTALL_MAN_DIR}) 13 | endif(NOT (WIN32 OR CYGWIN)) 14 | -------------------------------------------------------------------------------- /man/aclients.1: -------------------------------------------------------------------------------- 1 | .TH ACLIENTS 1 2 | 3 | .SH NAME 4 | aclients \- Test program for side-by-side TNC performance comparison. 5 | 6 | 7 | .SH SYNOPSIS 8 | .B aclients 9 | .I tnc ... 10 | .RS 11 | .P 12 | Each \fItnc\fR reference is a port, =, and a description. 13 | .P 14 | .RE 15 | 16 | .SH DESCRIPTION 17 | \fBaclients\fR is used to compare how well different TNCs decode AS.25 frames. 18 | The port can be a serial port name, host_name:tcp_port, ip_addr:port, or simply tcp_port. 19 | .P 20 | 21 | 22 | 23 | .SH OPTIONS 24 | None. 25 | 26 | 27 | 28 | .SH EXAMPLES 29 | 30 | .B aclients /dev/ttyS0=KPC3+ /dev/ttyUSB0=D710A 8000=DireWolf 192.168.1.64:8002=other 31 | .P 32 | Serial port /dev/ttyS0 is connected to a KPC3+ with monitor mode turned on. 33 | .P 34 | Serial port /dev/ttyUSB0 is connected to a TM-D710A with monitor mode turned on. 35 | .P 36 | The Dire Wolf software TNC is available on network port 8000. 37 | .P 38 | Some other software TNC is available on network port 8002 on host 192.168.1.64. 39 | .P 40 | Packets from each are displayed in columns so it is easy to see how well each decodes 41 | the received signals. 42 | .P 43 | 44 | The "Receive Performance" section of the \fBUser Guide\fR contains some complete examples 45 | of how to set up tests and the results. 46 | 47 | 48 | .SH SEE ALSO 49 | More detailed information is in the pdf files in /usr/local/share/doc/direwolf, or possibly /usr/share/doc/direwolf, depending on installation location. 50 | 51 | Applications in this package: aclients, atest, decode_aprs, direwolf, gen_packets, kissutil, ll2utm, log2gpx, text2tt, tt2text, utm2ll 52 | 53 | -------------------------------------------------------------------------------- /man/atest.1: -------------------------------------------------------------------------------- 1 | .TH ATEST 1 2 | 3 | .SH NAME 4 | atest \- Decode AX.25 frames from an audio file. 5 | 6 | 7 | .SH SYNOPSIS 8 | .B atest 9 | [ \fIoptions\fR ] 10 | .I wav-file-in 11 | .RS 12 | .P 13 | \fIwav-file-in\fR is a WAV format audio file. 14 | .P 15 | .RE 16 | 17 | .SH DESCRIPTION 18 | \fBatest\fR is a test application which decodes AX.25 frames from an audio recording. This provides an easy way to test Dire Wolf decoding performance much quicker than normal real-time. 19 | 20 | 21 | 22 | .SH OPTIONS 23 | 24 | 25 | .TP 26 | .BI "-B " "n" 27 | Data rate in bits/sec. Standard values are 300, 1200, 2400, 4800, 9600. 28 | .PD 0 29 | .RS 30 | .RS 31 | 300 bps defaults to AFSK tones of 1600 & 1800. 32 | .P 33 | 1200 bps uses AFSK tones of 1200 & 2200. 34 | .P 35 | 2400 bps uses QPSK based on V.26 standard. 36 | .P 37 | 4800 bps uses 8PSK based on V.27 standard. 38 | .P 39 | 9600 bps and up uses K9NG/G3RUH standard. 40 | .P 41 | AIS for ship Automatic Identification System. 42 | .P 43 | EAS for Emergency Alert System (EAS) Specific Area Message Encoding (SAME). 44 | .RE 45 | .RE 46 | .PD 47 | 48 | .TP 49 | .BI "-g " 50 | Force G3RUH modem regardless of data rate. 51 | 52 | .TP 53 | .BI "-j " 54 | 2400 bps QPSK compatible with Dire Wolf <= 1.5. 55 | 56 | .TP 57 | .BI "-J " 58 | 2400 bps QPSK compatible with MFJ-2400. 59 | 60 | .TP 61 | .BI "-D " "n" 62 | Divide audio sample rate by n. 63 | 64 | .TP 65 | .BI "-h " 66 | Print frame contents as hexadecimal bytes. 67 | 68 | .TP 69 | .BI "-F " "n" 70 | Amount of effort to try fixing frames with an invalid CRC. 71 | 0 (default) = consider only correct frames. 72 | 1 = Try to fix only a single bit. 73 | more = Try modifying more bits to get a good CRC. 74 | 75 | .TP 76 | .BI "-L " 77 | Error if Less than this number decoded. 78 | 79 | .TP 80 | .BI "-G " 81 | Error if Greater than this number decoded. 82 | 83 | .TP 84 | .BI "-P " "m" 85 | Select the demodulator type such as D (default for 300 bps), E+ (default for 1200 bps), PQRS for 2400 bps, etc. 86 | 87 | 88 | 89 | .SH EXAMPLES 90 | .P 91 | .PD 0 92 | .B gen_packets -o test1.wav 93 | .P 94 | .B atest test1.wav 95 | .PD 96 | .P 97 | .PD 0 98 | .B gen_packets -B 300 -o test3.wav 99 | .P 100 | .B atest -B 300 test3.wav 101 | .PD 102 | .P 103 | .PD 0 104 | .B gen_packets -B 9600 -o test9.wav 105 | .P 106 | .B atest -B 9600 test9.wav 107 | .PD 108 | .P 109 | .RS 110 | This generates and decodes 3 test files with 1200, 300, and 9600 bits per second. 111 | .RE 112 | .P 113 | .PD 0 114 | .B atest 02_Track_2.wav 115 | .P 116 | .B atest -P E- 02_Track_2.wav 117 | .P 118 | .B atest -F 1 02_Track_2.wav 119 | .P 120 | .B atest -P E- -F 1 02_Track_2.wav 121 | .PD 122 | .P 123 | .RS 124 | Try different combinations of options to compare decoding performance. 125 | .RE 126 | .P 127 | 128 | .SH SEE ALSO 129 | More detailed information is in the pdf files in /usr/local/share/doc/direwolf, or possibly /usr/share/doc/direwolf, depending on installation location. 130 | 131 | Applications in this package: aclients, atest, cm108, decode_aprs, direwolf, gen_packets, kissutil, ll2utm, log2gpx, text2tt, tt2text, utm2ll 132 | 133 | -------------------------------------------------------------------------------- /man/decode_aprs.1: -------------------------------------------------------------------------------- 1 | .TH DECODE_APRS 1 2 | 3 | .SH NAME 4 | decode_aprs \- Convert APRS raw data to human readable form. 5 | 6 | 7 | .SH SYNOPSIS 8 | .B decode_aprs 9 | [ \fItext-file\fR ] 10 | .RS 11 | .P 12 | \fItext-file\fR should contain AX.25 packets in the standard monitoring format or 13 | as a series two digit hexadecimal numbers. 14 | If the first number is 00 or c0, it will be treated as a KISS frame. 15 | If no file specified, data will be read from stdin. 16 | .P 17 | .RE 18 | 19 | .SH DESCRIPTION 20 | \fBdecode_aprs\fR is useful for understanding sometimes obscure APRS packets and finding errors. 21 | 22 | 23 | .SH OPTIONS 24 | None. 25 | 26 | 27 | 28 | .SH EXAMPLES 29 | 30 | You see something like this show up on your screen: 31 | .P 32 | .RS 33 | M0XER-3>APRS63,WIDE2-1:!/4\\;u/)K$O J]YD/A=041216|h`RY(1>q!(| 34 | .RE 35 | .P 36 | What does it mean? If you haven't spent a lot of time studying the APRS protocol 37 | specification, most of it probably looks like random noise. 38 | Pipe it into decode_aprs to find out. 39 | .P 40 | .RS 41 | .B echo 'M0XER-3>APRS63,WIDE2-1:!/4\\\\;u/)K$O J]YD/A=041216|h`RY(1>q!(|' | decode_aprs 42 | .RE 43 | .P 44 | 45 | http://www.findu.com/cgi-bin/errors.cgi has a never-ending collection of packets 46 | with errors. Sometimes it's not obvious what is wrong with them. 47 | Dire Wolf will usually tell you what is wrong. First, 48 | cut-n-paste the bad packets into a text file. Here a few examples: 49 | .P 50 | .RS 51 | .nf 52 | n2cma>APRS,TCPIP*,qAC,SEVENTH:@212127z43.2333n/77.1w_338/002g001t025P000h65b10208.wview_5_19_0 53 | .P 54 | K0YTH-10>APNU3B,NULL,qAR,K0DMF-10:!4601.5NS09255.52W#PHG6360/W2,MNn 444.575 55 | .P 56 | 00 82 a0 ae ae 62 60 e0 82 96 68 84 40 40 60 9c 68 b0 ae 86 40 e0 40 ae 92 88 8a 64 63 03 f0 3e 45 4d 36 34 6e 65 2f 23 20 45 63 68 6f 6c 69 6e 6b 20 31 34 35 2e 33 31 30 2f 31 30 30 68 7a 20 54 6f 6e 65 57 | +.fi 58 | .RE 59 | .P 60 | If you simply fed this into decode_aprs, it would complain about the 61 | lower case in qA-something, added by the IGate, in the via path. 62 | We can take it out with something like this: 63 | .P 64 | .RS 65 | .B cat findu-errors.txt | sed -e 's/,qA.*:/:/' | decode_aprs 66 | .RE 67 | .P 68 | In the first case, we get, 69 | .P 70 | .RS 71 | Address has lower case letters. "n2cma" must be all upper case. 72 | .RE 73 | .P 74 | After changing the source address to upper case, there are other issues. Identifying them is left as an exercise for the reader. 75 | .P 76 | In the second example, 77 | .P 78 | .RS 79 | .PD 0 80 | Invalid character in latitude. Found 'N' when expecting 0-9 for hundredths of minutes. 81 | .P 82 | Invalid character in longitude. Found '9' when expecting 0 or 1 for hundreds of degrees. 83 | .PD 84 | .RE 85 | 86 | .P 87 | In the third example, 88 | .P 89 | .RS 90 | .PD 0 91 | Warning: Lower case letter in Maidenhead locator. Specification requires upper case. 92 | .P 93 | Digi2 Address, " WIDE2-1" contains character other than letter or digit in character position 1. 94 | .PD 95 | .RE 96 | 97 | 98 | 99 | .SH SEE ALSO 100 | More detailed information is in the pdf files in /usr/local/share/doc/direwolf, or possibly /usr/share/doc/direwolf, depending on installation location. 101 | 102 | Applications in this package: aclients, atest, decode_aprs, direwolf, gen_packets, ll2utm, log2gpx, text2tt, tt2text, utm2ll 103 | 104 | -------------------------------------------------------------------------------- /man/gen_packets.1: -------------------------------------------------------------------------------- 1 | .TH GEN_PACKETS 1 2 | 3 | .SH NAME 4 | gen_packets \- Generate audio file for AX.25 frames. 5 | 6 | 7 | .SH SYNOPSIS 8 | .B gen_packets \-o 9 | .I wav-file-out 10 | [ \fIoptions\fR ] [ \fItext-file\fR | \- ] 11 | .RS 12 | .P 13 | \fIwav-file-out\fR is the result. The \-o option is required. 14 | .P 15 | \fItext-file\fR may contain AX.25 packets in the standard monitoring format. Use "-" to read from stdin. If not specified, a default builtin message will be used. 16 | .RE 17 | 18 | .SH DESCRIPTION 19 | \fBgen_packets\fR is a test application which converts text to AX.25 audio for testing packet decoders. 20 | 21 | It is very flexible allowing a wide range of audio sample rates, data speeds, and AFSK tones. It will even generate the scrambled signals commonly used for 9600 baud operation. 22 | 23 | 24 | .SH OPTIONS 25 | 26 | .TP 27 | .BI "-a " "n" 28 | Signal amplitude in range of 0-200%. Default 50. Note that 100% is corresponds to signal peaks of +/- 16383 so we have plenty of headroom to avoid saturation. 29 | 30 | .TP 31 | .BI "-b " "n" 32 | Bits / second for data. Default is 1200. 33 | 34 | .TP 35 | .BI "-B " "n" 36 | Data rate in bits/sec for first channel. Standard values are 300, 1200, 2400, 4800, 9600. 37 | .PD 0 38 | .RS 39 | .RS 40 | 300 bps defaults to AFSK tones of 1600 & 1800. 41 | .P 42 | 1200 bps uses AFSK tones of 1200 & 2200. 43 | .P 44 | 2400 bps uses QPSK based on V.26 standard. 45 | .P 46 | 4800 bps uses 8PSK based on V.27 standard. 47 | .P 48 | 9600 bps and up uses K9NG/G3RUH standard. 49 | .P 50 | EAS for Emergency Alert System (EAS) Specific Area Message Encoding (SAME). 51 | .RE 52 | .RE 53 | .PD 54 | 55 | .TP 56 | .BI "-g " 57 | Force G3RUH modem regardless of data rate. 58 | 59 | .TP 60 | .BI "-j " 61 | 2400 bps QPSK compatible with Dire Wolf <= 1.5. 62 | 63 | .TP 64 | .BI "-J " 65 | 2400 bps QPSK compatible with MFJ-2400. 66 | 67 | .TP 68 | .BI "-X " "n" 69 | 1 to enable FX.25 transmit. 16, 32, 64 for specific number of check bytes. 70 | 71 | .TP 72 | .BI "-I " "n" 73 | Enable IL2P transmit. n=1 is recommended. 0 uses weaker FEC. 74 | 75 | .TP 76 | .BI "-i " "n" 77 | Enable IL2P transmit, inverted polarity. n=1 is recommended. 0 uses weaker FEC. 78 | 79 | 80 | .TP 81 | .BI "-m " "n" 82 | Mark frequency. Default is 1200. 83 | 84 | .TP 85 | .BI "-s " "n" 86 | Space frequency. Default is 2200. 87 | 88 | .TP 89 | .BI "-r " "n" 90 | Audio sample Rate. Default is 44100. 91 | 92 | .TP 93 | .BI "-n " "n" 94 | Generate specified number of frames with increasing noise. (For built-in message only.) 95 | 96 | .TP 97 | .BI "-o " "file" 98 | Send output to .wav file. 99 | 100 | .TP 101 | .B "-8" 102 | 8 bit audio rather than 16. 103 | 104 | .TP 105 | .BI "-2" 106 | 2 channels of audio rather than 1. 107 | 108 | .TP 109 | .BI "-v" "max[,incr]" 110 | Variable speed with specified maximum error and optional increment. 111 | 112 | 113 | .SH EXAMPLES 114 | .P 115 | .B gen_packets \-o x.wav 116 | .P 117 | .RS 118 | With all defaults, a built-in test message is generated 119 | with standard Bell 202 tones used for packet radio on ordinary 120 | VHF FM transceivers. 121 | .RE 122 | .P 123 | .B gen_packets \-o x.wav \-g \-b 9600 124 | .PD 0 125 | .P 126 | .PD 127 | .B gen_packets \-o x.wav \-B 9600 128 | .P 129 | .RS 130 | Both of these are equivalent. "-B 9600" automatically selects scrambled baseband rather than AFSK. 131 | .RE 132 | .P 133 | .B gen_packets \-o x.wav \-m 1600 \-s 1800 \-b 300 134 | .PD 0 135 | .P 136 | .PD 137 | .B gen_packets \-o x.wav \-B 300 138 | .P 139 | .RS 140 | Both of these generate 200 Hz shift, 300 baud, suitable for HF SSB transceiver. 141 | .RE 142 | .P 143 | .B echo \-n 'WB2OSZ>WORLD:Hello, world!' | gen_packets \-a 25 \-o x.wav \- 144 | .PD 0 145 | .P 146 | .PD 147 | .B atest x.wav 148 | .P 149 | .RS 150 | Read message from stdin and put quarter volume sound into the file x.wav. Decode the sound file. 151 | .RE 152 | .P 153 | 154 | .SH SEE ALSO 155 | More detailed information is in the pdf files in /usr/local/share/doc/direwolf, or possibly /usr/share/doc/direwolf, depending on installation location. 156 | 157 | Applications in this package: aclients, atest, cm108, decode_aprs, direwolf, gen_packets, kissutil, ll2utm, log2gpx, text2tt, tt2text, utm2ll 158 | 159 | -------------------------------------------------------------------------------- /man/kissutil.1: -------------------------------------------------------------------------------- 1 | .TH KISSUTIL 1 2 | 3 | .SH NAME 4 | kissutil \- KISS TNC troubleshooting and Application Interface. 5 | 6 | 7 | .SH SYNOPSIS 8 | .B kissutil 9 | [ \fIoptions\fR ] 10 | 11 | 12 | 13 | .SH DESCRIPTION 14 | \fBkissutil\fR can be used interactively for troubleshooting a KISS TNC. 15 | It is usable with direwolf and other generic KISS TNCs connected to a serial port. 16 | It can also be used as an application interface where each side places files in a 17 | directory for the other to process. 18 | See User Guide for more details. 19 | 20 | 21 | .SH OPTIONS 22 | .TP 23 | .BI "-h " "host" 24 | Hostname or IP address for a TCP KISS TNC. Default is localhost. 25 | 26 | .TP 27 | .BI "-p " "port" 28 | A number may be specified for a TCP port other than the default 8001. 29 | If not a number, it is considered to be a serial port name such as /dev/ttyS0 or COM3. 30 | 31 | .TP 32 | .BI "-s " "speed" 33 | Speed for serial port. e.g. 9600. 34 | 35 | .TP 36 | .BI "-o " "rec-directory" 37 | For each received frame, a new file is created here. 38 | It is expected that some other application will process files in this directory then delete them. 39 | 40 | .TP 41 | .BI "-T " "format" 42 | Each received frame will be preceded by a timestamp in the specified format. 43 | See strftime documentation for a description of the format string. 44 | Example: %H:%M:%S for current time in hours, minutes, seconds. 45 | 46 | .TP 47 | .BI "-f " "xmit-directory" 48 | Files in this directory are transmitted and deleted. 49 | Another application places a file here when it wants something to be transmitted. 50 | 51 | .TP 52 | .BI "-v " 53 | Verbose - Display the KISS frames going to and from the TNC. 54 | 55 | 56 | .SH SEE ALSO 57 | More detailed information is in the pdf files in /usr/local/share/doc/direwolf, or possibly /usr/share/doc/direwolf, depending on installation location. 58 | 59 | Applications in this package: aclients, atest, decode_aprs, direwolf, gen_packets, kissutil, ll2utm, log2gpx, text2tt, tt2text, utm2ll 60 | 61 | -------------------------------------------------------------------------------- /man/ll2utm.1: -------------------------------------------------------------------------------- 1 | .TH LL2UTM 1 2 | 3 | .SH NAME 4 | ll2utm \- Convert Latitude and Longitude to UTM coordinates. 5 | 6 | 7 | .SH SYNOPSIS 8 | .B ll2utm 9 | .I latitude longitude 10 | .P 11 | Latitude and longitude are in decimal degrees. Use negative for south or west. 12 | 13 | .SH DESCRIPTION 14 | \fBll2utm\fR converts Latitude and Longitude to UTM coordinates. 15 | 16 | 17 | .SH OPTIONS 18 | .TP 19 | None. 20 | 21 | 22 | .SH EXAMPLES 23 | .P 24 | .B ll2utm 42.619 -71.34717 25 | .P 26 | zone = 19T, easting = 307504, northing = 4721177 27 | .P 28 | 29 | 30 | .SH SEE ALSO 31 | More detailed information is in the pdf files in /usr/local/share/doc/direwolf, or possibly /usr/share/doc/direwolf, depending on installation location. 32 | 33 | Applications in this package: aclients, atest, decode_aprs, direwolf, gen_packets, kissutil, ll2utm, log2gpx, text2tt, tt2text, utm2ll 34 | 35 | -------------------------------------------------------------------------------- /man/log2gpx.1: -------------------------------------------------------------------------------- 1 | .TH LOG2GPX 1 2 | 3 | .SH NAME 4 | log2gpx \- Convert Dire Wolf log files to GPX format. 5 | 6 | 7 | .SH SYNOPSIS 8 | .B log2gpx 9 | [ \fIfile\fR ... ] 10 | .P 11 | The command line can contain one or more log file names. If no files are specified, stdin is used. 12 | .P 13 | The result is always written to stdout. Redirect stdout to save results to a file. 14 | 15 | 16 | .SH DESCRIPTION 17 | \fBlog2gpx\fR converts Dire Wolf log files to the GPX format used by many mapping applications. 18 | .P 19 | Stationary entities are converted to waypoints. Moving entities are converted to tracks. 20 | 21 | .SH OPTIONS 22 | .TP 23 | None. 24 | 25 | 26 | .SH EXAMPLES 27 | .P 28 | .B direwolf -l logdir 29 | .P 30 | .B log2gpx logdir/* > everybody.gpx 31 | .P 32 | .B egrep -e '^[^,]+,[^,]+,[^,]+,WB2OSZ,' logdir/* | log2gpx > justme.gpx 33 | .P 34 | 35 | 36 | .SH SEE ALSO 37 | More detailed information is in the pdf files in /usr/local/share/doc/direwolf, or possibly /usr/share/doc/direwolf, depending on installation location. 38 | 39 | Applications in this package: aclients, atest, decode_aprs, direwolf, gen_packets, kissutil, ll2utm, log2gpx, text2tt, tt2text, utm2ll 40 | 41 | -------------------------------------------------------------------------------- /man/text2tt.1: -------------------------------------------------------------------------------- 1 | .TH TEXT2TT 1 2 | 3 | .SH NAME 4 | text2tt \- Convert text to Touch Tone representation 5 | 6 | 7 | .SH SYNOPSIS 8 | .B text2tt 9 | .I text ... 10 | .P 11 | 12 | 13 | .SH DESCRIPTION 14 | \fBtext2tt\fR converts text to the Touch Tone sequence used by APRStt. There are two types 15 | of encoding: 16 | .RS 17 | .HP 18 | .BR "Multi-Press" " - Used for comments." 19 | .RS 20 | .P 21 | Letters are represented by one or more presses of the same key depending on their order listed on the button. e.g. Press 5 key once for J, twice for K, thrice for L. 22 | .P 23 | To specify a digit use the number of letters listed on the button plus one. e.g. Press 5 key four times to get digit 5. When two characters in a row use the same key, use the "A" key as a separator. 24 | .RE 25 | .P 26 | .BR "Two-Key" " - Used for callsigns." 27 | .RS 28 | .P 29 | Digits are represented by a single key press. 30 | .P 31 | Letters (or space) are represented by the corresponding key followed by A, B, C, or D depending on the order of the letter in the order listed. 32 | .RE 33 | .RE 34 | .P 35 | This application will convert using both methods. 36 | 37 | 38 | .SH OPTIONS 39 | .TP 40 | None. 41 | 42 | 43 | .SH EXAMPLES 44 | .P 45 | .B text2tt abcdefg 0123 46 | .P 47 | .PD 0 48 | .P 49 | Push buttons for multi-press method: 50 | .P 51 | "2A22A2223A33A33340A00122223333" 52 | .P 53 | Push buttons for two-key method: 54 | .P 55 | "2A2B2C3A3B3C4A0A0123" 56 | .PD 57 | .P 58 | 59 | 60 | .SH SEE ALSO 61 | More detailed information is in the pdf files in /usr/local/share/doc/direwolf, or possibly /usr/share/doc/direwolf, depending on installation location. 62 | 63 | Applications in this package: aclients, atest, decode_aprs, direwolf, gen_packets, kissutil, ll2utm, log2gpx, text2tt, tt2text, utm2ll 64 | 65 | -------------------------------------------------------------------------------- /man/tt2text.1: -------------------------------------------------------------------------------- 1 | .TH TT2TEXT 1 2 | 3 | .SH NAME 4 | tt2text \- Convert Touch Tone sequence to text 5 | 6 | 7 | .SH SYNOPSIS 8 | .B tt2text 9 | .I touch-tone-squence 10 | .P 11 | 12 | 13 | .SH DESCRIPTION 14 | \fBtt2text\fR converts a Touch Tone sequence to text. There are two types 15 | of encoding: 16 | .RS 17 | .HP 18 | .BR "Multi-Press" " - Used for comments." 19 | .RS 20 | .P 21 | Letters are represented by one or more presses of the same key depending on their order listed on the button. e.g. Press 5 key once for J, twice for K, thrice for L. 22 | .P 23 | To specify a digit use the number of letters listed on the button plus one. e.g. Press 5 key four times to get digit 5. When two characters in a row use the same key, use the "A" key as a separator. 24 | .RE 25 | .P 26 | .BR "Two-Key" " - Used for callsigns." 27 | .RS 28 | .P 29 | Digits are represented by a single key press. 30 | .P 31 | Letters (or space) are represented by the corresponding key followed by A, B, C, or D depending on the order of the letter in the order listed. 32 | .RE 33 | .RE 34 | .P 35 | This application will try to decode the sequence using both methods. 36 | 37 | 38 | .SH OPTIONS 39 | .TP 40 | None. 41 | 42 | 43 | .SH EXAMPLES 44 | .P 45 | .B tt2text 2A22A2223A33A33340A00122223333 46 | .P 47 | .PD 0 48 | .P 49 | Could be either type of encoding. 50 | .P 51 | Decoded text from multi-press method: 52 | .P 53 | "ABCDEFG 0123" 54 | .P 55 | Decoded text from two-key method: 56 | .P 57 | "A2A222D3D3334 00122223333" 58 | .PD 59 | .P 60 | 61 | 62 | .SH SEE ALSO 63 | More detailed information is in the pdf files in /usr/local/share/doc/direwolf, or possibly /usr/share/doc/direwolf, depending on installation location. 64 | 65 | Applications in this package: aclients, atest, decode_aprs, direwolf, gen_packets, kissutil, ll2utm, log2gpx, text2tt, tt2text, utm2ll 66 | 67 | -------------------------------------------------------------------------------- /man/utm2ll.1: -------------------------------------------------------------------------------- 1 | .TH UTM2LL 1 2 | 3 | .SH NAME 4 | utm2ll \- Convert UTM coordinates to Latitude and Longitude. 5 | 6 | 7 | .SH SYNOPSIS 8 | .B utm2ll 9 | .I zone easting northing 10 | .RS 11 | .P 12 | \fIzone\fR is UTM zone 1 thru 60 with optional latitudinal band. 13 | .P 14 | \fIeasting\fR is x coordinate in meters. 15 | .P 16 | \fInorthing\fR is y coordinate in meters. 17 | .RE 18 | 19 | .SH DESCRIPTION 20 | \fBll2utm\fR converts UTM coordinates to latitude and longitude. 21 | 22 | 23 | .SH OPTIONS 24 | .TP 25 | None. 26 | 27 | 28 | .SH EXAMPLES 29 | .P 30 | .B utm2ll 19T 306130 4726010 31 | .P 32 | latitude = 42.662139, longitude = -71.365553 33 | .P 34 | 35 | 36 | .SH SEE ALSO 37 | More detailed information is in the pdf files in /usr/local/share/doc/direwolf, or possibly /usr/share/doc/direwolf, depending on installation location. 38 | 39 | Applications in this package: aclients, atest, decode_aprs, direwolf, gen_packets, kissutil, ll2utm, log2gpx, text2tt, tt2text, utm2ll 40 | 41 | -------------------------------------------------------------------------------- /scripts/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | 2 | if(NOT (WIN32 OR CYGWIN)) 3 | install(PROGRAMS "${CUSTOM_SCRIPTS_DIR}/dwespeak.sh" DESTINATION ${INSTALL_BIN_DIR}) 4 | install(PROGRAMS "${CUSTOM_SCRIPTS_DIR}/dw-start.sh" DESTINATION ${INSTALL_SCRIPTS_DIR}) 5 | add_subdirectory(telemetry-toolkit) 6 | endif() 7 | -------------------------------------------------------------------------------- /scripts/dwespeak.bat: -------------------------------------------------------------------------------- 1 | echo off 2 | 3 | set chan=%1 4 | set msg=%2 5 | 6 | sleep 1 7 | 8 | "C:\Program Files (x86)\eSpeak\command_line\espeak.exe" -v en-sc %msg% -------------------------------------------------------------------------------- /scripts/dwespeak.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | chan=$1 3 | msg=$2 4 | sleep 1 5 | espeak -v en-sc "$msg" 6 | -------------------------------------------------------------------------------- /scripts/telemetry-toolkit/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | install(PROGRAMS "${CUSTOM_TELEMETRY_DIR}/telem-balloon.pl" DESTINATION ${INSTALL_BIN_DIR}) 2 | install(PROGRAMS "${CUSTOM_TELEMETRY_DIR}/telem-bits.pl" DESTINATION ${INSTALL_BIN_DIR}) 3 | install(PROGRAMS "${CUSTOM_TELEMETRY_DIR}/telem-data.pl" DESTINATION ${INSTALL_BIN_DIR}) 4 | install(PROGRAMS "${CUSTOM_TELEMETRY_DIR}/telem-data91.pl" DESTINATION ${INSTALL_BIN_DIR}) 5 | install(PROGRAMS "${CUSTOM_TELEMETRY_DIR}/telem-eqns.pl" DESTINATION ${INSTALL_BIN_DIR}) 6 | install(PROGRAMS "${CUSTOM_TELEMETRY_DIR}/telem-parm.pl" DESTINATION ${INSTALL_BIN_DIR}) 7 | install(PROGRAMS "${CUSTOM_TELEMETRY_DIR}/telem-seq.sh" DESTINATION ${INSTALL_BIN_DIR}) 8 | install(PROGRAMS "${CUSTOM_TELEMETRY_DIR}/telem-unit.pl" DESTINATION ${INSTALL_BIN_DIR}) 9 | install(PROGRAMS "${CUSTOM_TELEMETRY_DIR}/telem-volts.py" DESTINATION ${INSTALL_BIN_DIR}) 10 | 11 | install(FILES "${CUSTOM_TELEMETRY_DIR}/telem-m0xer-3.txt" DESTINATION ${INSTALL_CONF_DIR}) 12 | install(FILES "${CUSTOM_TELEMETRY_DIR}/telem-balloon.conf" DESTINATION ${INSTALL_CONF_DIR}) 13 | install(FILES "${CUSTOM_TELEMETRY_DIR}/telem-volts.conf" DESTINATION ${INSTALL_CONF_DIR}) 14 | -------------------------------------------------------------------------------- /scripts/telemetry-toolkit/telem-balloon.conf: -------------------------------------------------------------------------------- 1 | # Sample configuration for demonstration of sending telemetry. 2 | # Here we try to replicate actual data heard for a balloon. 3 | 4 | CHANNEL 0 5 | MYCALL M0XER-3 6 | 7 | # These will send the beacons to the transmitter (which you disconnected, right?) 8 | 9 | # First the metadata. 10 | 11 | # Channel 1: Battery voltage, Volts, scaled up by 100 12 | # Channel 2: Solar voltage, Volts, scaled up by 100 13 | # Channel 3: Temperature, degrees C, sent as Kelvin x 10 14 | # Channel 4: Number of satellites, no units 15 | 16 | # Note: When using Strawberry perl, as specified in the example, Windows knows 17 | # that the .pl file type is associated with it. When using a different implementation 18 | # of perl, which doesn't make this association of file type to application, it might 19 | # be necessary to use something like this instead: 20 | # 21 | # ... infocmd="c:\strawberry\perl\bin\perl.exe telem-parm.pl M0XER-3 Vbat Vsolar Temp Sat" 22 | 23 | # Here we use the generic scripts to generate the messages with metadata. 24 | # The "infocmd=..." option means use the result for the info part of the packet. 25 | 26 | CBEACON delay=0:10 every=1:00 infocmd="telem-parm.pl M0XER-3 Vbat Vsolar Temp Sat" 27 | CBEACON delay=0:12 every=1:00 infocmd="telem-unit.pl M0XER-3 V V C """" m" 28 | CBEACON delay=0:14 every=1:00 infocmd="telem-eqns.pl M0XER-3 0 0.001 0 0 0.001 0 0 0.1 -273.2 0 1 0 0 1 0" 29 | CBEACON delay=0:16 every=1:00 infocmd="telem-bits.pl M0XER-3 11111111 ""10mW research balloon""" 30 | 31 | # Now the telemetry data. 32 | # In a real situation, the location and telemetry data would come from sensors. 33 | # Here we have just hardcoded 3 sets of historical data as a demonstration. 34 | 35 | # telem-balloon.pl accumulates the data then invokes telem-data91.pl to convert 36 | # it to the compressed format. This is inserted into the position comment with "commentcmd=..." 37 | 38 | PBEACON compress=1 delay=0:20 every=1:00 via=WIDE2-1 symbol=Balloon lat=61^34.2876N lon=155^40.0931W alt=12953 commentcmd="telem-balloon.pl 3307 4.383 0.436 -34.6 12" 39 | PBEACON compress=1 delay=0:22 every=1:00 via=WIDE2-1 symbol=Balloon lat=51^07.4402N lon=124^14.4472W alt=12563 commentcmd="telem-balloon.pl 6524 4.515 0.653 -1.3 7" 40 | PBEACON compress=1 delay=0:24 every=1:00 via=WIDE2-1 symbol=Balloon lat=55^58.5558N lon=122^28.5933W alt=12680 commentcmd="telem-balloon.pl 7458 4.521 0.587 -8.3 7" 41 | 42 | 43 | # Now we do the same thing again. 44 | 45 | # This time, add the SENDTO=R0 option to simulate reception. 46 | # These will be sent to any attached applications so you can see how they process the data. 47 | 48 | CBEACON SENDTO=R0 delay=0:30 every=1:00 infocmd="telem-parm.pl M0XER-3 Vbat Vsolar Temp Sat" 49 | CBEACON SENDTO=R0 delay=0:32 every=1:00 infocmd="telem-unit.pl M0XER-3 V V C """" m" 50 | CBEACON SENDTO=R0 delay=0:34 every=1:00 infocmd="telem-eqns.pl M0XER-3 0 0.001 0 0 0.001 0 0 0.1 -273.2 0 1 0 0 1 0" 51 | CBEACON SENDTO=R0 delay=0:36 every=1:00 infocmd="telem-bits.pl M0XER-3 11111111 ""10mW research balloon""" 52 | 53 | PBEACON SENDTO=R0 compress=1 delay=0:40 every=1:00 via=WIDE2-1 symbol=Balloon lat=61^34.2876N lon=155^40.0931W alt=12953 commentcmd="telem-balloon.pl 3307 4.383 0.436 -34.6 12" 54 | PBEACON SENDTO=R0 compress=1 delay=0:42 every=1:00 via=WIDE2-1 symbol=Balloon lat=51^07.4402N lon=124^14.4472W alt=12563 commentcmd="telem-balloon.pl 6524 4.515 0.653 -1.3 7" 55 | PBEACON SENDTO=R0 compress=1 delay=0:44 every=1:00 via=WIDE2-1 symbol=Balloon lat=55^58.5558N lon=122^28.5933W alt=12680 commentcmd="telem-balloon.pl 7458 4.521 0.587 -8.3 7" 56 | -------------------------------------------------------------------------------- /scripts/telemetry-toolkit/telem-balloon.pl: -------------------------------------------------------------------------------- 1 | #!/usr/bin/perl 2 | 3 | # Part of Dire Wolf APRS Telemetry Toolkit, WB2OSZ, 2015 4 | 5 | # In a real situation this would obtain data from sensors. 6 | # For demonstration purposes we use historical data supplied on the command line. 7 | 8 | if ($#ARGV+1 != 5) { 9 | print STDERR "5 command line arguments must be provided.\n"; 10 | usage(); 11 | } 12 | 13 | ($seq,$vbat,$vsolar,$temp,$sat) = @ARGV; 14 | 15 | # Scale to integer in range of 0 to 8280. 16 | # This must be the inverse of the mapping in the EQNS message. 17 | 18 | $vbat = int(($vbat * 1000) + 0.5); 19 | $vsolar = int(($vsolar * 1000) + 0.5); 20 | $temp = int((($temp + 273.2) * 10) + 0.5); 21 | 22 | exit system("telem-data91.pl $seq $vbat $vsolar $temp $sat"); 23 | 24 | 25 | sub usage () 26 | { 27 | print STDERR "\n"; 28 | print STDERR "balloon.pl - Format data into Compressed telemetry format.\n"; 29 | print STDERR "\n"; 30 | print STDERR "In a real situation this would obtain data from sensors.\n"; 31 | print STDERR "For demonstration purposes we use historical data supplied on the command line.\n"; 32 | print STDERR "\n"; 33 | print STDERR "Usage: balloon.pl seq vbat vsolar temp sat\n"; 34 | print STDERR "\n"; 35 | print STDERR "Where,\n"; 36 | print STDERR " seq is a sequence number.\n"; 37 | print STDERR " vbat is battery voltage.\n"; 38 | print STDERR " vsolar is solar cell voltage.\n"; 39 | print STDERR " temp is temperature, degrees C.\n"; 40 | print STDERR " sat is number of GPS satellites visible.\n"; 41 | 42 | exit 1; 43 | } -------------------------------------------------------------------------------- /scripts/telemetry-toolkit/telem-bits.pl: -------------------------------------------------------------------------------- 1 | #!/usr/bin/perl 2 | 3 | # Part of Dire Wolf APRS Telemetry Toolkit, WB2OSZ, 2015 4 | 5 | if ($#ARGV+1 < 2 || $#ARGV+1 > 3) { 6 | print STDERR "A callsign, bit sense string, and optional project title must be provided.\n"; 7 | usage(); 8 | } 9 | 10 | # Separate out call and pad to 9 characters. 11 | $call = shift @ARGV; 12 | $call = substr($call . " ", 0, 9); 13 | 14 | if ( ! ($ARGV[0] =~ m/^[01]{8}$/)) { 15 | print STDERR "The bit-sense value must be 8 binary digits.\n"; 16 | usage(); 17 | } 18 | 19 | print ":$call:BITS." . join (',', @ARGV) . "\n"; 20 | exit 0; 21 | 22 | sub usage () 23 | { 24 | print STDERR "\n"; 25 | print STDERR "telem-bits.pl - Generate BITS message with bit polarity and optional project title.\n"; 26 | print STDERR "\n"; 27 | print STDERR "Usage: telem-bits.pl call bit-sense [ project-title ]\n"; 28 | print STDERR "\n"; 29 | print STDERR "Bit-sense is string of 8 binary digits.\n"; 30 | print STDERR "If project title contains any spaces, enclose it in quotes.\n"; 31 | 32 | exit 1; 33 | } -------------------------------------------------------------------------------- /scripts/telemetry-toolkit/telem-data.pl: -------------------------------------------------------------------------------- 1 | #!/usr/bin/perl 2 | 3 | # Part of Dire Wolf APRS Telemetry Toolkit, WB2OSZ, 2015 4 | 5 | if ($#ARGV+1 < 2 || $#ARGV+1 > 7) { 6 | print STDERR "2 to 7 command line arguments must be provided.\n"; 7 | usage(); 8 | } 9 | 10 | if ($#ARGV+1 == 7) { 11 | if ( ! ($ARGV[6] =~ m/^[01]{8}$/)) { 12 | print STDERR "The sixth value must be 8 binary digits.\n"; 13 | usage(); 14 | } 15 | } 16 | 17 | print "T#" . join (',', @ARGV) . "\n"; 18 | exit 0; 19 | 20 | sub usage () 21 | { 22 | print STDERR "\n"; 23 | print STDERR "telem-data.pl - Format data into Telemetry Report format.\n"; 24 | print STDERR "\n"; 25 | print STDERR "Usage: telem-data.pl sequence value1 [ value2 ... ]\n"; 26 | print STDERR "\n"; 27 | print STDERR "A sequence number and up to 5 analog values can be specified.\n"; 28 | print STDERR "Any sixth value must be 8 binary digits.\n"; 29 | 30 | exit 1; 31 | } -------------------------------------------------------------------------------- /scripts/telemetry-toolkit/telem-data91.pl: -------------------------------------------------------------------------------- 1 | #!/usr/bin/perl 2 | 3 | # Part of Dire Wolf APRS Telemetry Toolkit, WB2OSZ, 2015 4 | 5 | # For explanation of encoding see: 6 | # http://he.fi/doc/aprs-base91-comment-telemetry.txt 7 | 8 | 9 | if ($#ARGV+1 < 2 || $#ARGV+1 > 7) { 10 | print STDERR "2 to 7 command line arguments must be provided.\n"; 11 | usage(); 12 | } 13 | 14 | 15 | if ($#ARGV+1 == 7) { 16 | if ( ! ($ARGV[6] =~ m/^[01]{8}$/)) { 17 | print STDERR "The sixth value must be 8 binary digits.\n"; 18 | usage(); 19 | } 20 | # Convert binary digits to value. 21 | $ARGV[6] = oct("0b" . reverse($ARGV[6])); 22 | } 23 | 24 | $result = "|"; 25 | 26 | for ($n = 0 ; $n <= $#ARGV; $n++) { 27 | #print $n . " = " . $ARGV[$n] . "\n"; 28 | $v = $ARGV[$n]; 29 | if ($v != int($v) || $v < 0 || $v > 8280) { 30 | print STDERR "$v is not an integer in range of 0 to 8280.\n"; 31 | usage(); 32 | } 33 | 34 | $result .= base91($v); 35 | } 36 | 37 | $result .= "|"; 38 | print "$result\n"; 39 | exit 0; 40 | 41 | 42 | sub base91 () 43 | { 44 | my $x = @_[0]; 45 | 46 | my $d1 = int ($x / 91); 47 | my $d2 = $x % 91; 48 | 49 | return chr($d1+33) . chr($d2+33); 50 | } 51 | 52 | 53 | sub usage () 54 | { 55 | print STDERR "\n"; 56 | print STDERR "telem-data91.pl - Format data into compressed base 91 telemetry.\n"; 57 | print STDERR "\n"; 58 | print STDERR "Usage: telem-data91.pl sequence value1 [ value2 ... ]\n"; 59 | print STDERR "\n"; 60 | print STDERR "A sequence number and up to 5 analog values can be specified.\n"; 61 | print STDERR "Any sixth value must be 8 binary digits.\n"; 62 | print STDERR "Values must be integers in range of 0 to 8280.\n"; 63 | 64 | exit 1; 65 | } -------------------------------------------------------------------------------- /scripts/telemetry-toolkit/telem-eqns.pl: -------------------------------------------------------------------------------- 1 | #!/usr/bin/perl 2 | 3 | # Part of Dire Wolf APRS Telemetry Toolkit, WB2OSZ, 2015 4 | 5 | if ($#ARGV+1 != 4 && $#ARGV+1 != 7 && $#ARGV+1 != 10 && $#ARGV+1 != 13 && $#ARGV+1 != 16) { 6 | print STDERR "A callsign and 1 to 5 sets of 3 coefficients must be provided.\n"; 7 | usage(); 8 | } 9 | 10 | # Separate out call and pad to 9 characters. 11 | $call = shift @ARGV; 12 | $call = substr($call . " ", 0, 9); 13 | 14 | print ":$call:EQNS." . join (',', @ARGV) . "\n"; 15 | exit 0; 16 | 17 | sub usage () 18 | { 19 | print STDERR "\n"; 20 | print STDERR "telem-eqns.pl - Generate EQNS message with scaling coefficients\n"; 21 | print STDERR "\n"; 22 | print STDERR "Usage: telem-eqns.pl call a1 b1 c1 [ a2 b2 c2 ... ]\n"; 23 | print STDERR "\n"; 24 | print STDERR "Specify a callsign and 1 to 5 sets of 3 coefficients.\n"; 25 | print STDERR "See APRS protocol reference for their meaning.\n"; 26 | 27 | exit 1; 28 | } -------------------------------------------------------------------------------- /scripts/telemetry-toolkit/telem-m0xer-3.txt: -------------------------------------------------------------------------------- 1 | 2E0TOY>APRS::M0XER-3 :BITS.11111111,10mW research balloon 2 | 2E0TOY>APRS::M0XER-3 :PARM.Vbat,Vsolar,Temp,Sat 3 | 2E0TOY>APRS::M0XER-3 :EQNS.0,0.001,0,0,0.001,0,0,0.1,-273.2,0,1,0,0,1,0 4 | 2E0TOY>APRS::M0XER-3 :UNIT.V,V,C,,m 5 | M0XER-3>APRS63,WIDE2-1:!//Bap'.ZGO JHAE/A=042496|E@Q0%i;5!-| 6 | M0XER-3>APRS63,WIDE2-1:!/4\;u/)K$O J]YD/A=041216|h`RY(1>q!(| 7 | M0XER-3>APRS63,WIDE2-1:!/23*f/R$UO Jf'x/A=041600|rxR_'J>+!(| -------------------------------------------------------------------------------- /scripts/telemetry-toolkit/telem-parm.pl: -------------------------------------------------------------------------------- 1 | #!/usr/bin/perl 2 | 3 | # Part of Dire Wolf APRS Telemetry Toolkit, WB2OSZ, 2015 4 | 5 | if ($#ARGV+1 < 2 || $#ARGV+1 > 14) { 6 | print STDERR "A callsign and 1 to 13 channel names must be provided.\n"; 7 | usage(); 8 | } 9 | 10 | # Separate out call and pad to 9 characters. 11 | $call = shift @ARGV; 12 | $call = substr($call . " ", 0, 9); 13 | 14 | print ":$call:PARM." . join (',', @ARGV) . "\n"; 15 | exit 0; 16 | 17 | sub usage () 18 | { 19 | print STDERR "\n"; 20 | print STDERR "telem-parm.pl - Generate PARM message with channel names.\n"; 21 | print STDERR "\n"; 22 | print STDERR "Usage: telem-parm.pl call aname1 ... aname5 dname1 .,, dname8\n"; 23 | print STDERR "\n"; 24 | print STDERR "Specify a callsign and up to 13 names for the analog & digital channels.\n"; 25 | 26 | exit 1; 27 | } -------------------------------------------------------------------------------- /scripts/telemetry-toolkit/telem-seq.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | # Generate sequence number as described here: 3 | # https://github.com/wb2osz/direwolf/issues/9 4 | # 5 | SEQ=`cat /tmp/seq 2>/dev/null` 6 | SEQ=$(expr \( $SEQ + 1 \) % 1000) 7 | echo $SEQ | tee /tmp/seq -------------------------------------------------------------------------------- /scripts/telemetry-toolkit/telem-unit.pl: -------------------------------------------------------------------------------- 1 | #!/usr/bin/perl 2 | 3 | # Part of Dire Wolf APRS Telemetry Toolkit, WB2OSZ, 2015 4 | 5 | if ($#ARGV+1 < 2 || $#ARGV+1 > 14) { 6 | print STDERR "A callsign and 1 to 13 units/labels must be provided.\n"; 7 | usage(); 8 | } 9 | 10 | # Separate out call and pad to 9 characters. 11 | $call = shift @ARGV; 12 | $call = substr($call . " ", 0, 9); 13 | 14 | print ":$call:UNIT." . join (',', @ARGV) . "\n"; 15 | exit 0; 16 | 17 | sub usage () 18 | { 19 | print STDERR "\n"; 20 | print STDERR "telem-unit.pl - Generate UNIT message with channel units/labels.\n"; 21 | print STDERR "\n"; 22 | print STDERR "Usage: telem-unit.pl call unit1 ... unit5 label1 .,, label8\n"; 23 | print STDERR "\n"; 24 | print STDERR "Specify a callsign and up to 13 names for the units/labels.\n"; 25 | 26 | exit 1; 27 | } -------------------------------------------------------------------------------- /scripts/telemetry-toolkit/telem-volts.conf: -------------------------------------------------------------------------------- 1 | # Sample configuration for demonstration of sending telemetry. 2 | # Here we take a voltage from an analog to digital converter (ADC). 3 | 4 | ADEVICE plughw:1,0 5 | 6 | MYCALL MYCALL-9 7 | 8 | # For demonstration purposes, the metadata will be sent each minute and 9 | # voltage data every 10 seconds. In actual practice, it would be much less frequent. 10 | 11 | # First the metadata. 12 | 13 | # The "infocmd=..." option means use the result for the info part of the packet. 14 | 15 | CBEACON delay=0:10 every=1:00 via=WIDE2-1 infocmd="telem-parm.pl MYCALL-9 Supply" 16 | CBEACON delay=0:11 every=1:00 via=WIDE2-1 infocmd="telem-unit.pl MYCALL-9 Volts" 17 | 18 | # Now the telemetry data. 19 | 20 | # First we use telem-volts.py to read a volage from the A/D converter. 21 | # This is supplied to telem-data.pl as a command line argument. 22 | # The result is used as the info part of a custom beacon. 23 | 24 | # Sequence numbers are generated as suggested here: 25 | # https://github.com/wb2osz/direwolf/issues/9 26 | 27 | CBEACON delay=0:15 every=0:10 via=WIDE2-1 infocmd="telem-data.pl `telem-seq.sh` `PYTHONPATH=~/Adafruit-Raspberry-Pi-Python-Code/Adafruit_ADS1x15 telem-volts.py`" 28 | 29 | -------------------------------------------------------------------------------- /scripts/telemetry-toolkit/telem-volts.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/python3 2 | 3 | # Part of Dire Wolf APRS Telemetry Toolkit, WB2OSZ, 2015 4 | 5 | # Derived from 6 | # https://github.com/adafruit/Adafruit-Raspberry-Pi-Python-Code/blob/master/Adafruit_ADS1x15/ads1x15_ex_singleended.py 7 | 8 | import time, signal, sys 9 | from Adafruit_ADS1x15 import ADS1x15 10 | 11 | ADS1015 = 0x00 # 12-bit ADC 12 | ADS1115 = 0x01 # 16-bit ADC 13 | 14 | # Set ADC full scale to 2048 mV. 15 | # Can't use original 4096 with 3.3V supply. 16 | gain = 2048 17 | 18 | # Select the sample time, 1/sps second. 19 | # Longer is better to average out noise. 20 | sps = 64 21 | 22 | # Set this to ADS1015 or ADS1115 depending on the ADC you are using! 23 | adc = ADS1x15(ic=ADS1115) 24 | 25 | # Values for voltage divider on ADC input. 26 | r1 = 1000000. 27 | r2 = 100000. 28 | 29 | # Read channel 0 in single-ended mode using the settings above 30 | volts = adc.readADCSingleEnded(0, gain, sps) * 0.001 * (r1+r2) / r2 31 | 32 | # Calibration correction specific to my hardware. 33 | # (multiply by expected value, divide by uncalibrated result.) 34 | #volts = volts * 4.98 / 4.889 35 | 36 | print("%.3f" % (volts)) 37 | -------------------------------------------------------------------------------- /src/agwlib.h: -------------------------------------------------------------------------------- 1 | 2 | #ifndef AGWLIB_H 3 | #define AGWLIB_H 1 4 | 5 | 6 | // Call at beginning to start it up. 7 | 8 | int agwlib_init (char *host, char *port, int (*init_func)(void)); 9 | 10 | 11 | 12 | // Send commands to TNC. 13 | 14 | 15 | int agwlib_X_register_callsign (int chan, char *call_from); 16 | 17 | int agwlib_x_unregister_callsign (int chan, char *call_from); 18 | 19 | int agwlib_G_ask_port_information (void); 20 | 21 | int agwlib_C_connect (int chan, char *call_from, char *call_to); 22 | 23 | int agwlib_d_disconnect (int chan, char *call_from, char *call_to); 24 | 25 | int agwlib_D_send_connected_data (int chan, int pid, char *call_from, char *call_to, int data_len, char *data); 26 | 27 | int agwlib_Y_outstanding_frames_for_station (int chan, char *call_from, char *call_to); 28 | 29 | 30 | 31 | // The application must define these. 32 | 33 | void agw_cb_C_connection_received (int chan, char *call_from, char *call_to, int data_len, char *data); 34 | void on_C_connection_received (int chan, char *call_from, char *call_to, int incoming, char *data); 35 | 36 | void agw_cb_d_disconnected (int chan, char *call_from, char *call_to, int data_len, char *data); 37 | 38 | void agw_cb_D_connected_data (int chan, char *call_from, char *call_to, int data_len, char *data); 39 | 40 | void agw_cb_G_port_information (int num_chan, char *chan_descriptions[]); 41 | 42 | void agw_cb_Y_outstanding_frames_for_station (int chan, char *call_from, char *call_to, int frame_count); 43 | 44 | 45 | #endif -------------------------------------------------------------------------------- /src/ais.h: -------------------------------------------------------------------------------- 1 | 2 | 3 | void ais_to_nmea (unsigned char *ais, int ais_len, char *nema, int nema_size); 4 | 5 | int ais_parse (char *sentence, int quiet, char *descr, int descr_size, char *mssi, int mssi_size, double *odlat, double *odlon, 6 | float *ofknots, float *ofcourse, float *ofalt_m, char *symtab, char *symbol, char *comment, int comment_size); 7 | 8 | int ais_check_length (int type, int length); 9 | -------------------------------------------------------------------------------- /src/audio_stats.h: -------------------------------------------------------------------------------- 1 | 2 | 3 | /* audio_stats.h */ 4 | 5 | 6 | extern void audio_stats (int adev, int nchan, int nsamp, int interval); 7 | 8 | -------------------------------------------------------------------------------- /src/ax25_link.h: -------------------------------------------------------------------------------- 1 | 2 | /* ax25_link.h */ 3 | 4 | 5 | #ifndef AX25_LINK_H 6 | #define AX25_LINK_H 1 7 | 8 | #include "ax25_pad.h" // for AX25_MAX_INFO_LEN 9 | 10 | #include "dlq.h" // for dlq_item_t 11 | 12 | #include "config.h" // for struct misc_config_s 13 | 14 | 15 | 16 | // Limits and defaults for parameters. 17 | 18 | 19 | #define AX25_N1_PACLEN_MIN 1 // Max bytes in Information part of frame. 20 | #define AX25_N1_PACLEN_DEFAULT 256 // some v2.0 implementations have 128 21 | #define AX25_N1_PACLEN_MAX AX25_MAX_INFO_LEN // from ax25_pad.h 22 | 23 | 24 | #define AX25_N2_RETRY_MIN 1 // Number of times to retry before giving up. 25 | #define AX25_N2_RETRY_DEFAULT 10 26 | #define AX25_N2_RETRY_MAX 15 27 | 28 | 29 | #define AX25_T1V_FRACK_MIN 1 // Number of seconds to wait before retrying. 30 | #define AX25_T1V_FRACK_DEFAULT 3 // KPC-3+ has 4. TM-D710A has 3. 31 | #define AX25_T1V_FRACK_MAX 15 32 | 33 | 34 | #define AX25_K_MAXFRAME_BASIC_MIN 1 // Window size - number of I frames to send before waiting for ack. 35 | #define AX25_K_MAXFRAME_BASIC_DEFAULT 4 36 | #define AX25_K_MAXFRAME_BASIC_MAX 7 37 | 38 | #define AX25_K_MAXFRAME_EXTENDED_MIN 1 39 | #define AX25_K_MAXFRAME_EXTENDED_DEFAULT 32 40 | #define AX25_K_MAXFRAME_EXTENDED_MAX 63 // In theory 127 but I'm restricting as explained in SREJ handling. 41 | 42 | 43 | 44 | // Call once at startup time. 45 | 46 | void ax25_link_init (struct misc_config_s *pconfig); 47 | 48 | 49 | 50 | // IMPORTANT: 51 | 52 | // These functions must be called on a single thread, one at a time. 53 | // The Data Link Queue (DLQ) is used to serialize events from multiple sources. 54 | 55 | // Maybe the dispatch switch should be moved to ax25_link.c so they can all 56 | // be made static and they can't be called from the wrong place accidentally. 57 | 58 | void dl_connect_request (dlq_item_t *E); 59 | 60 | void dl_disconnect_request (dlq_item_t *E); 61 | 62 | void dl_data_request (dlq_item_t *E); 63 | 64 | void dl_register_callsign (dlq_item_t *E); 65 | 66 | void dl_unregister_callsign (dlq_item_t *E); 67 | 68 | void dl_outstanding_frames_request (dlq_item_t *E); 69 | 70 | void dl_client_cleanup (dlq_item_t *E); 71 | 72 | 73 | void lm_data_indication (dlq_item_t *E); 74 | 75 | void lm_seize_confirm (dlq_item_t *E); 76 | 77 | void lm_channel_busy (dlq_item_t *E); 78 | 79 | 80 | void dl_timer_expiry (void); 81 | 82 | 83 | double ax25_link_get_next_timer_expiry (void); 84 | 85 | 86 | #endif 87 | 88 | /* end ax25_link.h */ -------------------------------------------------------------------------------- /src/ax25_pad2.h: -------------------------------------------------------------------------------- 1 | /*------------------------------------------------------------------- 2 | * 3 | * Name: ax25_pad2.h 4 | * 5 | * Purpose: Header file for using ax25_pad2.c 6 | * ax25_pad dealt only with UI frames. 7 | * This adds a facility for the other types: U, s, I. 8 | * 9 | *------------------------------------------------------------------*/ 10 | 11 | #ifndef AX25_PAD2_H 12 | #define AX25_PAD2_H 1 13 | 14 | #include "ax25_pad.h" 15 | 16 | 17 | 18 | 19 | #if AX25MEMDEBUG // to investigate a memory leak problem 20 | 21 | 22 | 23 | packet_t ax25_u_frame_debug (char addrs[AX25_MAX_ADDRS][AX25_MAX_ADDR_LEN], int num_addr, cmdres_t cr, ax25_frame_type_t ftype, int pf, int pid, unsigned char *pinfo, int info_len, char *src_file, int src_line); 24 | 25 | packet_t ax25_s_frame_debug (char addrs[AX25_MAX_ADDRS][AX25_MAX_ADDR_LEN], int num_addr, cmdres_t cr, ax25_frame_type_t ftype, int modulo, int nr, int pf, unsigned char *pinfo, int info_len, char *src_file, int src_line); 26 | 27 | packet_t ax25_i_frame_debug (char addrs[AX25_MAX_ADDRS][AX25_MAX_ADDR_LEN], int num_addr, cmdres_t cr, int modulo, int nr, int ns, int pf, int pid, unsigned char *pinfo, int info_len, char *src_file, int src_line); 28 | 29 | 30 | #define ax25_u_frame(a,n,c,f,p,q,i,l) ax25_u_frame_debug(a,n,c,f,p,q,i,l,__FILE__,__LINE__) 31 | 32 | #define ax25_s_frame(a,n,c,f,m,r,p,i,l) ax25_s_frame_debug(a,n,c,f,m,r,p,i,l,__FILE__,__LINE__) 33 | 34 | #define ax25_i_frame(a,n,c,m,r,s,p,q,i,l) ax25_i_frame_debug(a,n,c,m,r,s,p,q,i,l,__FILE__,__LINE__) 35 | 36 | 37 | #else 38 | 39 | packet_t ax25_u_frame (char addrs[AX25_MAX_ADDRS][AX25_MAX_ADDR_LEN], int num_addr, cmdres_t cr, ax25_frame_type_t ftype, int pf, int pid, unsigned char *pinfo, int info_len); 40 | 41 | packet_t ax25_s_frame (char addrs[AX25_MAX_ADDRS][AX25_MAX_ADDR_LEN], int num_addr, cmdres_t cr, ax25_frame_type_t ftype, int modulo, int nr, int pf, unsigned char *pinfo, int info_len); 42 | 43 | packet_t ax25_i_frame (char addrs[AX25_MAX_ADDRS][AX25_MAX_ADDR_LEN], int num_addr, cmdres_t cr, int modulo, int nr, int ns, int pf, int pid, unsigned char *pinfo, int info_len); 44 | 45 | 46 | #endif 47 | 48 | 49 | 50 | 51 | #endif /* AX25_PAD2_H */ 52 | 53 | /* end ax25_pad2.h */ 54 | 55 | 56 | -------------------------------------------------------------------------------- /src/beacon.h: -------------------------------------------------------------------------------- 1 | 2 | /* beacon.h */ 3 | 4 | void beacon_init (struct audio_s *pmodem, struct misc_config_s *pconfig, struct igate_config_s *pigate); 5 | 6 | void beacon_tracker_set_debug (int level); 7 | -------------------------------------------------------------------------------- /src/cdigipeater.h: -------------------------------------------------------------------------------- 1 | 2 | 3 | #ifndef CDIGIPEATER_H 4 | #define CDIGIPEATER_H 1 5 | 6 | #include "regex.h" 7 | 8 | #include "direwolf.h" /* for MAX_CHANS */ 9 | #include "ax25_pad.h" /* for packet_t */ 10 | #include "audio.h" /* for radio channel properties */ 11 | 12 | 13 | /* 14 | * Information required for Connected mode digipeating. 15 | * 16 | * The configuration file reader fills in this information 17 | * and it is passed to cdigipeater_init at application start up time. 18 | */ 19 | 20 | 21 | struct cdigi_config_s { 22 | 23 | /* 24 | * Rules for each of the [from_chan][to_chan] combinations. 25 | */ 26 | int enabled[MAX_CHANS][MAX_CHANS]; // Is it enabled for from/to pair? 27 | 28 | int has_alias[MAX_CHANS][MAX_CHANS]; // If there was no alias in the config file, 29 | // the structure below will not be set up 30 | // properly and an attempt to use it could 31 | // result in a crash. (fixed v1.5) 32 | // Not needed for [APRS] DIGIPEAT because 33 | // the alias is mandatory there. 34 | regex_t alias[MAX_CHANS][MAX_CHANS]; 35 | 36 | char *cfilter_str[MAX_CHANS][MAX_CHANS]; 37 | // NULL or optional Packet Filter strings such as "t/m". 38 | }; 39 | 40 | /* 41 | * Call once at application start up time. 42 | */ 43 | 44 | extern void cdigipeater_init (struct audio_s *p_audio_config, struct cdigi_config_s *p_cdigi_config); 45 | 46 | /* 47 | * Call this for each packet received. 48 | * Suitable packets will be queued for transmission. 49 | */ 50 | 51 | extern void cdigipeater (int from_chan, packet_t pp); 52 | 53 | 54 | /* Make statistics available. */ 55 | 56 | int cdigipeater_get_count (int from_chan, int to_chan); 57 | 58 | 59 | #endif 60 | 61 | /* end cdigipeater.h */ 62 | 63 | -------------------------------------------------------------------------------- /src/cm108.h: -------------------------------------------------------------------------------- 1 | /* Dire Wolf cm108.h */ 2 | 3 | extern void cm108_find_ptt (char *output_audio_device, char *ptt_device, int ptt_device_size); 4 | 5 | extern int cm108_set_gpio_pin (char *name, int num, int state); -------------------------------------------------------------------------------- /src/dedupe.h: -------------------------------------------------------------------------------- 1 | 2 | 3 | void dedupe_init (int ttl); 4 | 5 | void dedupe_remember (packet_t pp, int chan); 6 | 7 | int dedupe_check (packet_t pp, int chan); 8 | 9 | 10 | /* end dedupe.h */ 11 | -------------------------------------------------------------------------------- /src/demod.h: -------------------------------------------------------------------------------- 1 | 2 | 3 | /* demod.h */ 4 | 5 | #include "audio.h" /* for struct audio_s */ 6 | #include "ax25_pad.h" /* for alevel_t */ 7 | 8 | 9 | int demod_init (struct audio_s *pa); 10 | 11 | void demod_mute_input (int chan, int mute); 12 | 13 | int demod_get_sample (int a); 14 | 15 | void demod_process_sample (int chan, int subchan, int sam); 16 | 17 | void demod_print_agc (int chan, int subchan); 18 | 19 | alevel_t demod_get_audio_level (int chan, int subchan); 20 | 21 | -------------------------------------------------------------------------------- /src/demod_9600.h: -------------------------------------------------------------------------------- 1 | 2 | 3 | /* demod_9600.h */ 4 | 5 | 6 | #include "fsk_demod_state.h" 7 | 8 | 9 | void demod_9600_init (enum modem_t modem_type, int original_sample_rate, int upsample, int baud, struct demodulator_state_s *D); 10 | 11 | void demod_9600_process_sample (int chan, int sam, int upsample, struct demodulator_state_s *D); 12 | 13 | 14 | 15 | 16 | /* Undo data scrambling for 9600 baud. */ 17 | 18 | static inline int descramble (int in, int *state) 19 | { 20 | int out; 21 | 22 | out = (in ^ (*state >> 16) ^ (*state >> 11)) & 1; 23 | *state = (*state << 1) | (in & 1); 24 | return (out); 25 | } 26 | -------------------------------------------------------------------------------- /src/demod_afsk.h: -------------------------------------------------------------------------------- 1 | 2 | /* demod_afsk.h */ 3 | 4 | 5 | void demod_afsk_init (int samples_per_sec, int baud, int mark_freq, 6 | int space_freq, char profile, struct demodulator_state_s *D); 7 | 8 | void demod_afsk_process_sample (int chan, int subchan, int sam, struct demodulator_state_s *D); 9 | -------------------------------------------------------------------------------- /src/demod_psk.h: -------------------------------------------------------------------------------- 1 | 2 | /* demod_psk.h */ 3 | 4 | 5 | void demod_psk_init (enum modem_t modem_type, enum v26_e v26_alt, int samples_per_sec, int bps, char profile, struct demodulator_state_s *D); 6 | 7 | void demod_psk_process_sample (int chan, int subchan, int sam, struct demodulator_state_s *D); 8 | -------------------------------------------------------------------------------- /src/digipeater.h: -------------------------------------------------------------------------------- 1 | 2 | #ifndef DIGIPEATER_H 3 | #define DIGIPEATER_H 1 4 | 5 | #include "regex.h" 6 | 7 | #include "direwolf.h" /* for MAX_CHANS */ 8 | #include "ax25_pad.h" /* for packet_t */ 9 | #include "audio.h" /* for radio channel properties */ 10 | 11 | 12 | /* 13 | * Information required for digipeating. 14 | * 15 | * The configuration file reader fills in this information 16 | * and it is passed to digipeater_init at application start up time. 17 | */ 18 | 19 | 20 | struct digi_config_s { 21 | 22 | 23 | int dedupe_time; /* Don't digipeat duplicate packets */ 24 | /* within this number of seconds. */ 25 | 26 | #define DEFAULT_DEDUPE 30 27 | 28 | /* 29 | * Rules for each of the [from_chan][to_chan] combinations. 30 | */ 31 | 32 | regex_t alias[MAX_CHANS][MAX_CHANS]; 33 | 34 | regex_t wide[MAX_CHANS][MAX_CHANS]; 35 | 36 | int enabled[MAX_CHANS][MAX_CHANS]; 37 | 38 | enum preempt_e { PREEMPT_OFF, PREEMPT_DROP, PREEMPT_MARK, PREEMPT_TRACE } preempt[MAX_CHANS][MAX_CHANS]; 39 | 40 | // ATGP is an ugly hack for the specific need of ATGP which needs more that 8 digipeaters. 41 | // DO NOT put this in the User Guide. On a need to know basis. 42 | 43 | char atgp[MAX_CHANS][MAX_CHANS][AX25_MAX_ADDR_LEN]; 44 | 45 | char *filter_str[MAX_CHANS+1][MAX_CHANS+1]; 46 | // NULL or optional Packet Filter strings such as "t/m". 47 | // Notice the size of arrays is one larger than normal. 48 | // That extra position is for the IGate. 49 | 50 | int regen[MAX_CHANS][MAX_CHANS]; // Regenerate packet. 51 | // Sort of like digipeating but passed along unchanged. 52 | }; 53 | 54 | /* 55 | * Call once at application start up time. 56 | */ 57 | 58 | extern void digipeater_init (struct audio_s *p_audio_config, struct digi_config_s *p_digi_config); 59 | 60 | /* 61 | * Call this for each packet received. 62 | * Suitable packets will be queued for transmission. 63 | */ 64 | 65 | extern void digipeater (int from_chan, packet_t pp); 66 | 67 | void digi_regen (int from_chan, packet_t pp); 68 | 69 | 70 | /* Make statistics available. */ 71 | 72 | int digipeater_get_count (int from_chan, int to_chan); 73 | 74 | 75 | #endif 76 | 77 | /* end digipeater.h */ 78 | 79 | -------------------------------------------------------------------------------- /src/dlq.h: -------------------------------------------------------------------------------- 1 | 2 | /*------------------------------------------------------------------ 3 | * 4 | * Module: dlq.h 5 | * 6 | *---------------------------------------------------------------*/ 7 | 8 | #ifndef DLQ_H 9 | #define DLQ_H 1 10 | 11 | #include "ax25_pad.h" 12 | #include "audio.h" 13 | 14 | 15 | /* A transmit or receive data block for connected mode. */ 16 | 17 | typedef struct cdata_s { 18 | int magic; /* For integrity checking. */ 19 | 20 | #define TXDATA_MAGIC 0x09110911 21 | 22 | struct cdata_s *next; /* Pointer to next when part of a list. */ 23 | 24 | int pid; /* Protocol id. */ 25 | 26 | int size; /* Number of bytes allocated. */ 27 | 28 | int len; /* Number of bytes actually used. */ 29 | 30 | char data[]; /* Variable length data. */ 31 | 32 | } cdata_t; 33 | 34 | 35 | 36 | 37 | /* Types of things that can be in queue. */ 38 | 39 | typedef enum dlq_type_e {DLQ_REC_FRAME, DLQ_CONNECT_REQUEST, DLQ_DISCONNECT_REQUEST, DLQ_XMIT_DATA_REQUEST, DLQ_REGISTER_CALLSIGN, DLQ_UNREGISTER_CALLSIGN, DLQ_OUTSTANDING_FRAMES_REQUEST, DLQ_CHANNEL_BUSY, DLQ_SEIZE_CONFIRM, DLQ_CLIENT_CLEANUP} dlq_type_t; 40 | 41 | typedef enum fec_type_e {fec_type_none=0, fec_type_fx25=1, fec_type_il2p=2} fec_type_t; 42 | 43 | 44 | /* A queue item. */ 45 | 46 | // TODO: call this event rather than item. 47 | // TODO: should add fences. 48 | 49 | typedef struct dlq_item_s { 50 | 51 | struct dlq_item_s *nextp; /* Next item in queue. */ 52 | 53 | dlq_type_t type; /* Type of item. */ 54 | /* See enum definition above. */ 55 | 56 | int chan; /* Radio channel of origin. */ 57 | 58 | // I'm not worried about amount of memory used but this might be a 59 | // little clearer if a union was used for the different event types. 60 | 61 | // Used for received frame. 62 | 63 | int subchan; /* Winning "subchannel" when using multiple */ 64 | /* decoders on one channel. */ 65 | /* Special case, -1 means DTMF decoder. */ 66 | /* Maybe we should have a different type in this case? */ 67 | 68 | int slice; /* Winning slicer. */ 69 | 70 | packet_t pp; /* Pointer to frame structure. */ 71 | 72 | alevel_t alevel; /* Audio level. */ 73 | 74 | fec_type_t fec_type; // Type of FEC for received signal: none, FX.25, or IL2P. 75 | 76 | retry_t retries; /* Effort expended to get a valid CRC. */ 77 | /* Bits changed for regular AX.25. */ 78 | /* Number of bytes fixed for FX.25. */ 79 | 80 | char spectrum[MAX_SUBCHANS*MAX_SLICERS+1]; /* "Spectrum" display for multi-decoders. */ 81 | 82 | // Used by requests from a client application, connect, etc. 83 | 84 | char addrs[AX25_MAX_ADDRS][AX25_MAX_ADDR_LEN]; 85 | 86 | int num_addr; /* Range 2 .. 10. */ 87 | 88 | int client; 89 | 90 | 91 | // Used only by client request to transmit connected data. 92 | 93 | cdata_t *txdata; 94 | 95 | // Used for channel activity change. 96 | // It is useful to know when the channel is busy either for carrier detect 97 | // or when we are transmitting. 98 | 99 | int activity; /* OCTYPE_PTT for my transmission start/end. */ 100 | /* OCTYPE_DCD if we hear someone else. */ 101 | 102 | int status; /* 1 for active or 0 for quiet. */ 103 | 104 | } dlq_item_t; 105 | 106 | 107 | 108 | void dlq_init (void); 109 | 110 | 111 | 112 | void dlq_rec_frame (int chan, int subchan, int slice, packet_t pp, alevel_t alevel, fec_type_t fec_type, retry_t retries, char *spectrum); 113 | 114 | void dlq_connect_request (char addrs[AX25_MAX_ADDRS][AX25_MAX_ADDR_LEN], int num_addr, int chan, int client, int pid); 115 | 116 | void dlq_disconnect_request (char addrs[AX25_MAX_ADDRS][AX25_MAX_ADDR_LEN], int num_addr, int chan, int client); 117 | 118 | void dlq_outstanding_frames_request (char addrs[AX25_MAX_ADDRS][AX25_MAX_ADDR_LEN], int num_addr, int chan, int client); 119 | 120 | void dlq_xmit_data_request (char addrs[AX25_MAX_ADDRS][AX25_MAX_ADDR_LEN], int num_addr, int chan, int client, int pid, char *xdata_ptr, int xdata_len); 121 | 122 | void dlq_register_callsign (char *addr, int chan, int client); 123 | 124 | void dlq_unregister_callsign (char *addr, int chan, int client); 125 | 126 | void dlq_channel_busy (int chan, int activity, int status); 127 | 128 | void dlq_seize_confirm (int chan); 129 | 130 | void dlq_client_cleanup (int client); 131 | 132 | 133 | 134 | int dlq_wait_while_empty (double timeout_val); 135 | 136 | struct dlq_item_s *dlq_remove (void); 137 | 138 | void dlq_delete (struct dlq_item_s *pitem); 139 | 140 | 141 | 142 | cdata_t *cdata_new (int pid, char *data, int len); 143 | 144 | void cdata_delete (cdata_t *txdata); 145 | 146 | void cdata_check_leak (void); 147 | 148 | 149 | #endif 150 | 151 | /* end dlq.h */ 152 | -------------------------------------------------------------------------------- /src/dns_sd_common.c: -------------------------------------------------------------------------------- 1 | // 2 | // This file is part of Dire Wolf, an amateur radio packet TNC. 3 | // 4 | // Copyright (C) 2020 Heikki Hannikainen, OH7LZB 5 | // 6 | // 7 | // This program is free software: you can redistribute it and/or modify 8 | // it under the terms of the GNU General Public License as published by 9 | // the Free Software Foundation, either version 2 of the License, or 10 | // (at your option) any later version. 11 | // 12 | // This program is distributed in the hope that it will be useful, 13 | // but WITHOUT ANY WARRANTY; without even the implied warranty of 14 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 15 | // GNU General Public License for more details. 16 | // 17 | // You should have received a copy of the GNU General Public License 18 | // along with this program. If not, see . 19 | 20 | /*------------------------------------------------------------------ 21 | * 22 | * Module: dns_sd_common.c 23 | * 24 | * Purpose: Announce the KISS over TCP service using DNS-SD, common functions 25 | * 26 | * Description: 27 | * 28 | * Most people have typed in enough IP addresses and ports by now, and 29 | * would rather just select an available TNC that is automatically 30 | * discovered on the local network. Even more so on a mobile device 31 | * such an Android or iOS phone or tablet. 32 | * 33 | * This module contains common functions needed on Linux and MacOS. 34 | */ 35 | 36 | 37 | #include 38 | #include 39 | #include 40 | 41 | /* Get a default service name to publish. By default, 42 | * "Dire Wolf on ", or just "Dire Wolf" if hostname cannot 43 | * be obtained. 44 | */ 45 | char *dns_sd_default_service_name(void) 46 | { 47 | char hostname[51]; 48 | char sname[64]; 49 | 50 | int i = gethostname(hostname, sizeof(hostname)); 51 | if (i == 0) { 52 | hostname[sizeof(hostname)-1] = 0; 53 | 54 | // on some systems, an FQDN is returned; remove domain part 55 | char *dot = strchr(hostname, '.'); 56 | if (dot) 57 | *dot = 0; 58 | 59 | snprintf(sname, sizeof(sname), "Dire Wolf on %s", hostname); 60 | return strdup(sname); 61 | } 62 | 63 | return strdup("Dire Wolf"); 64 | } 65 | 66 | -------------------------------------------------------------------------------- /src/dns_sd_common.h: -------------------------------------------------------------------------------- 1 | 2 | #if (USE_AVAHI_CLIENT|USE_MACOS_DNSSD) 3 | 4 | char *dns_sd_default_service_name(void); 5 | 6 | #endif 7 | 8 | -------------------------------------------------------------------------------- /src/dns_sd_dw.h: -------------------------------------------------------------------------------- 1 | 2 | #if (USE_AVAHI_CLIENT|USE_MACOS_DNSSD) 3 | 4 | #include "config.h" 5 | 6 | #define DNS_SD_SERVICE "_kiss-tnc._tcp" 7 | 8 | void dns_sd_announce (struct misc_config_s *mc); 9 | 10 | #endif // USE_AVAHI_CLIENT 11 | -------------------------------------------------------------------------------- /src/dns_sd_macos.c: -------------------------------------------------------------------------------- 1 | // 2 | // This file is part of Dire Wolf, an amateur radio packet TNC. 3 | // 4 | // Copyright (C) 2020 Heikki Hannikainen, OH7LZB 5 | // 6 | // 7 | // This program is free software: you can redistribute it and/or modify 8 | // it under the terms of the GNU General Public License as published by 9 | // the Free Software Foundation, either version 2 of the License, or 10 | // (at your option) any later version. 11 | // 12 | // This program is distributed in the hope that it will be useful, 13 | // but WITHOUT ANY WARRANTY; without even the implied warranty of 14 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 15 | // GNU General Public License for more details. 16 | // 17 | // You should have received a copy of the GNU General Public License 18 | // along with this program. If not, see . 19 | 20 | /*------------------------------------------------------------------ 21 | * 22 | * Module: dns_sd_macos.c 23 | * 24 | * Purpose: Announce the KISS over TCP service using MacOS dns-sd 25 | * 26 | * Description: 27 | * 28 | * Most people have typed in enough IP addresses and ports by now, and 29 | * would rather just select an available TNC that is automatically 30 | * discovered on the local network. Even more so on a mobile device 31 | * such an Android or iOS phone or tablet. 32 | * 33 | * On MacOs, the announcement can be made through dns-sd. 34 | */ 35 | 36 | #ifdef USE_MACOS_DNSSD 37 | 38 | #include 39 | #include 40 | #include 41 | 42 | #include "dns_sd_dw.h" 43 | #include "dns_sd_common.h" 44 | #include "textcolor.h" 45 | 46 | static char *name = NULL; 47 | 48 | static void registerServiceCallBack(DNSServiceRef sdRef, DNSServiceFlags flags, DNSServiceErrorType errorCode, 49 | const char* name, const char* regType, const char* domain, void* context) 50 | { 51 | if (errorCode == kDNSServiceErr_NoError) { 52 | text_color_set(DW_COLOR_INFO); 53 | dw_printf("DNS-SD: Successfully registered '%s'\n", name); 54 | } else { 55 | text_color_set(DW_COLOR_ERROR); 56 | dw_printf("DNS-SD: Failed to register '%s': %d\n", name, errorCode); 57 | } 58 | } 59 | 60 | void dns_sd_announce (struct misc_config_s *mc) 61 | { 62 | //int kiss_port = mc->kiss_port; // now an array. 63 | int kiss_port = mc->kiss_port[0]; // FIXME: Quick hack until I can handle multiple TCP ports properly. 64 | 65 | if (mc->dns_sd_name[0]) { 66 | name = strdup(mc->dns_sd_name); 67 | } else { 68 | name = dns_sd_default_service_name(); 69 | } 70 | 71 | uint16_t port_nw = htons(kiss_port); 72 | 73 | DNSServiceRef registerRef; 74 | DNSServiceErrorType err = DNSServiceRegister( 75 | ®isterRef, 0, 0, name, DNS_SD_SERVICE, NULL, NULL, 76 | port_nw, 0, NULL, registerServiceCallBack, NULL); 77 | 78 | if (err == kDNSServiceErr_NoError) { 79 | text_color_set(DW_COLOR_INFO); 80 | dw_printf("DNS-SD: Announcing KISS TCP on port %d as '%s'\n", kiss_port, name); 81 | } else { 82 | text_color_set(DW_COLOR_ERROR); 83 | dw_printf("DNS-SD: Failed to announce '%s': %d\n", name, err); 84 | } 85 | } 86 | 87 | #endif // USE_MACOS_DNSSD 88 | 89 | 90 | -------------------------------------------------------------------------------- /src/dsp.h: -------------------------------------------------------------------------------- 1 | 2 | /* dsp.h */ 3 | 4 | // TODO: put prefixes on these names. 5 | 6 | float window (bp_window_t type, int size, int j); 7 | 8 | void gen_lowpass (float fc, float *lp_filter, int filter_size, bp_window_t wtype); 9 | 10 | void gen_bandpass (float f1, float f2, float *bp_filter, int filter_size, bp_window_t wtype); 11 | 12 | void gen_ms (int fc, int samples_per_sec, float *sin_table, float *cos_table, int filter_size, int wtype); 13 | 14 | 15 | __attribute__((const)) float rrc (float t, float a); 16 | 17 | void gen_rrc_lowpass (float *pfilter, int filter_taps, float rolloff, float samples_per_symbol); 18 | -------------------------------------------------------------------------------- /src/dtime_now.h: -------------------------------------------------------------------------------- 1 | 2 | 3 | extern double dtime_realtime (void); 4 | 5 | extern double dtime_monotonic (void); 6 | 7 | 8 | void timestamp_now (char *result, int result_size, int show_ms); 9 | 10 | void timestamp_user_format (char *result, int result_size, char *user_format); 11 | 12 | void timestamp_filename (char *result, int result_size); 13 | 14 | 15 | // FIXME: remove temp workaround. 16 | // Needs many scattered updates. 17 | 18 | #define dtime_now dtime_realtime 19 | -------------------------------------------------------------------------------- /src/dtmf.h: -------------------------------------------------------------------------------- 1 | /* dtmf.h */ 2 | 3 | 4 | #include "audio.h" 5 | 6 | void dtmf_init (struct audio_s *p_audio_config, int amp); 7 | 8 | char dtmf_sample (int c, float input); 9 | 10 | int dtmf_send (int chan, char *str, int speed, int txdelay, int txtail); 11 | 12 | 13 | /* end dtmf.h */ 14 | 15 | -------------------------------------------------------------------------------- /src/dwgps.h: -------------------------------------------------------------------------------- 1 | 2 | /* dwgps.h */ 3 | 4 | #ifndef DWGPS_H 5 | #define DWGPS_H 1 6 | 7 | 8 | #include 9 | #include "config.h" /* for struct misc_config_s */ 10 | 11 | 12 | /* 13 | * Values for fix, equivalent to values from libgps. 14 | * -2 = not initialized. 15 | * -1 = error communicating with GPS receiver. 16 | * 0 = nothing heard yet. 17 | * 1 = had signal but lost it. 18 | * 2 = 2D. 19 | * 3 = 3D. 20 | * 21 | * Undefined float & double values are set to G_UNKNOWN. 22 | * 23 | */ 24 | 25 | enum dwfix_e { DWFIX_NOT_INIT= -2, DWFIX_ERROR= -1, DWFIX_NOT_SEEN=0, DWFIX_NO_FIX=1, DWFIX_2D=2, DWFIX_3D=3 }; 26 | 27 | typedef enum dwfix_e dwfix_t; 28 | 29 | typedef struct dwgps_info_s { 30 | time_t timestamp; /* When last updated. System time. */ 31 | dwfix_t fix; /* Quality of position fix. */ 32 | double dlat; /* Latitude. Valid if fix >= 2. */ 33 | double dlon; /* Longitude. Valid if fix >= 2. */ 34 | float speed_knots; /* libgps uses meters/sec but we use GPS usual knots. */ 35 | float track; /* What is difference between track and course? */ 36 | float altitude; /* meters above mean sea level. Valid if fix == 3. */ 37 | } dwgps_info_t; 38 | 39 | 40 | 41 | 42 | 43 | void dwgps_init (struct misc_config_s *pconfig, int debug); 44 | 45 | void dwgps_clear (dwgps_info_t *gpsinfo); 46 | 47 | dwfix_t dwgps_read (dwgps_info_t *gpsinfo); 48 | 49 | void dwgps_print (char *msg, dwgps_info_t *gpsinfo); 50 | 51 | void dwgps_term (void); 52 | 53 | void dwgps_set_data (dwgps_info_t *gpsinfo); 54 | 55 | 56 | #endif /* DWGPS_H 1 */ 57 | 58 | /* end dwgps.h */ 59 | 60 | 61 | 62 | -------------------------------------------------------------------------------- /src/dwgpsd.h: -------------------------------------------------------------------------------- 1 | 2 | /* dwgpsd.h - For communicating with daemon */ 3 | 4 | 5 | 6 | #ifndef DWGPSD_H 7 | #define DWGPSD_H 1 8 | 9 | #include "config.h" 10 | 11 | 12 | int dwgpsd_init (struct misc_config_s *pconfig, int debug); 13 | 14 | void dwgpsd_term (void); 15 | 16 | #endif 17 | 18 | 19 | /* end dwgpsd.h */ 20 | 21 | 22 | 23 | -------------------------------------------------------------------------------- /src/dwgpsnmea.h: -------------------------------------------------------------------------------- 1 | 2 | /* dwgpsnmea.h - For reading NMEA sentences over serial port */ 3 | 4 | 5 | 6 | #ifndef DWGPSNMEA_H 7 | #define DWGPSNMEA_H 1 8 | 9 | #include "dwgps.h" /* for dwfix_t */ 10 | #include "config.h" 11 | #include "serial_port.h" /* for MYFDTYPE */ 12 | 13 | 14 | int dwgpsnmea_init (struct misc_config_s *pconfig, int debug); 15 | 16 | MYFDTYPE dwgpsnmea_get_fd(char *wp_port_name, int speed); 17 | 18 | void dwgpsnmea_term (void); 19 | 20 | 21 | dwfix_t dwgpsnmea_gprmc (char *sentence, int quiet, double *odlat, double *odlon, float *oknots, float *ocourse); 22 | 23 | dwfix_t dwgpsnmea_gpgga (char *sentence, int quiet, double *odlat, double *odlon, float *oalt, int *onsat); 24 | 25 | 26 | #endif 27 | 28 | 29 | /* end dwgpsnmea.h */ 30 | 31 | 32 | 33 | -------------------------------------------------------------------------------- /src/dwsock.h: -------------------------------------------------------------------------------- 1 | 2 | /* dwsock.h - Socket helper functions. */ 3 | 4 | #ifndef DWSOCK_H 5 | #define DWSOCK_H 1 6 | 7 | #define DWSOCK_IPADDR_LEN 48 // Size of string to hold IPv4 or IPv6 address. 8 | // I think 40 would be adequate but we'll make 9 | // it a little larger just to be safe. 10 | // Use INET6_ADDRSTRLEN (from netinet/in.h) instead? 11 | 12 | int dwsock_init (void); 13 | 14 | int dwsock_connect (char *hostname, char *port, char *description, int allow_ipv6, int debug, char ipaddr_str[DWSOCK_IPADDR_LEN]); 15 | /* ipaddr_str needs to be at least SOCK_IPADDR_LEN bytes */ 16 | 17 | char *dwsock_ia_to_text (int Family, void * pAddr, char * pStringBuf, size_t StringBufSize); 18 | 19 | void dwsock_close (int fd); 20 | 21 | #endif -------------------------------------------------------------------------------- /src/encode_aprs.h: -------------------------------------------------------------------------------- 1 | 2 | int encode_position (int messaging, int compressed, double lat, double lon, int ambiguity, int alt_ft, 3 | char symtab, char symbol, 4 | int power, int height, int gain, char *dir, 5 | int course, int speed_knots, 6 | float freq, float tone, float offset, 7 | char *comment, 8 | char *presult, size_t result_size); 9 | 10 | int encode_object (char *name, int compressed, time_t thyme, double lat, double lon, int ambiguity, 11 | char symtab, char symbol, 12 | int power, int height, int gain, char *dir, 13 | int course, int speed_knots, 14 | float freq, float tone, float offset, char *comment, 15 | char *presult, size_t result_size); 16 | 17 | int encode_message (char *addressee, char *text, char *id, char *presult, size_t result_size); 18 | -------------------------------------------------------------------------------- /src/fcs_calc.h: -------------------------------------------------------------------------------- 1 | 2 | /* fcs_calc.h */ 3 | 4 | 5 | unsigned short fcs_calc (unsigned char *data, int len); 6 | 7 | unsigned short crc16 (unsigned char *data, int len, unsigned short seed); 8 | 9 | /* end fcs_calc.h */ 10 | 11 | 12 | -------------------------------------------------------------------------------- /src/fsk_filters.h: -------------------------------------------------------------------------------- 1 | /* 1200 bits/sec with Audio sample rate = 11025 */ 2 | /* Mark freq = 1200, Space freq = 2200 */ 3 | 4 | static const signed short m_sin_table[9] = { 0 , 7347 , 11257 , 9899 , 3909 , -3909 , -9899 , -11257 , -7347 }; 5 | static const signed short m_cos_table[9] = { 11431 , 8756 , 1984 , -5715 , -10741 , -10741 , -5715 , 1984 , 8756 }; 6 | static const signed short s_sin_table[9] = { 0 , 10950 , 6281 , -7347 , -10496 , 1327 , 11257 , 5130 , -8314 }; 7 | static const signed short s_cos_table[9] = { 11431 , 3278 , -9550 , -8756 , 4527 , 11353 , 1984 , -10215 , -7844 }; 8 | -------------------------------------------------------------------------------- /src/fsk_gen_filter.h: -------------------------------------------------------------------------------- 1 | 2 | 3 | #ifndef FSK_GEN_FILTER_H 4 | #define FSK_GEN_FILTER_H 1 5 | 6 | #include "audio.h" 7 | #include "fsk_demod_state.h" 8 | 9 | void fsk_gen_filter (int samples_per_sec, 10 | int baud, 11 | int mark_freq, int space_freq, 12 | char profile, 13 | struct demodulator_state_s *D); 14 | 15 | #endif -------------------------------------------------------------------------------- /src/fx25.h: -------------------------------------------------------------------------------- 1 | #ifndef FX25_H 2 | #define FX25_H 3 | 4 | #include // for uint64_t 5 | 6 | 7 | /* Reed-Solomon codec control block */ 8 | struct rs { 9 | unsigned int mm; /* Bits per symbol */ 10 | unsigned int nn; /* Symbols per block (= (1<mm) 21 | #define NN (rs->nn) 22 | #define ALPHA_TO (rs->alpha_to) 23 | #define INDEX_OF (rs->index_of) 24 | #define GENPOLY (rs->genpoly) 25 | #define NROOTS (rs->nroots) 26 | #define FCR (rs->fcr) 27 | #define PRIM (rs->prim) 28 | #define IPRIM (rs->iprim) 29 | #define A0 (NN) 30 | 31 | 32 | 33 | __attribute__((always_inline)) 34 | static inline int modnn(struct rs *rs, int x){ 35 | while (x >= rs->nn) { 36 | x -= rs->nn; 37 | x = (x >> rs->mm) + (x & rs->nn); 38 | } 39 | return x; 40 | } 41 | 42 | #define MODNN(x) modnn(rs,x) 43 | 44 | 45 | #define ENCODE_RS encode_rs_char 46 | #define DECODE_RS decode_rs_char 47 | #define INIT_RS init_rs_char 48 | #define FREE_RS free_rs_char 49 | 50 | #define DTYPE unsigned char 51 | 52 | void ENCODE_RS(struct rs *rs, DTYPE *data, DTYPE *bb); 53 | 54 | int DECODE_RS(struct rs *rs, DTYPE *data, int *eras_pos, int no_eras); 55 | 56 | struct rs *INIT_RS(unsigned int symsize, unsigned int gfpoly, 57 | unsigned int fcr, unsigned int prim, unsigned int nroots); 58 | 59 | void FREE_RS(struct rs *rs); 60 | 61 | 62 | 63 | // These 3 are the external interface. 64 | // Maybe these should be in a different file, separated from the internal stuff. 65 | 66 | void fx25_init ( int debug_level ); 67 | int fx25_send_frame (int chan, unsigned char *fbuf, int flen, int fx_mode); 68 | void fx25_rec_bit (int chan, int subchan, int slice, int dbit); 69 | int fx25_rec_busy (int chan); 70 | 71 | 72 | // Other functions in fx25_init.c. 73 | 74 | struct rs *fx25_get_rs (int ctag_num); 75 | uint64_t fx25_get_ctag_value (int ctag_num); 76 | int fx25_get_k_data_radio (int ctag_num); 77 | int fx25_get_k_data_rs (int ctag_num); 78 | int fx25_get_nroots (int ctag_num); 79 | int fx25_get_debug (void); 80 | int fx25_tag_find_match (uint64_t t); 81 | int fx25_pick_mode (int fx_mode, int dlen); 82 | 83 | void fx_hex_dump(unsigned char *x, int len); 84 | 85 | 86 | 87 | #define CTAG_MIN 0x01 88 | #define CTAG_MAX 0x0B 89 | 90 | // Maximum sizes of "data" and "check" parts. 91 | 92 | #define FX25_MAX_DATA 239 // i.e. RS(255,239) 93 | #define FX25_MAX_CHECK 64 // e.g. RS(255, 191) 94 | #define FX25_BLOCK_SIZE 255 // Block size always 255 for 8 bit symbols. 95 | 96 | #endif // FX25_H -------------------------------------------------------------------------------- /src/fx25_auto.c: -------------------------------------------------------------------------------- 1 | /* */ -------------------------------------------------------------------------------- /src/fx25_encode.c: -------------------------------------------------------------------------------- 1 | // 2 | // This file is part of Dire Wolf, an amateur radio packet TNC. 3 | // 4 | // Copyright (C) 2019 John Langner, WB2OSZ 5 | // 6 | // This program is free software: you can redistribute it and/or modify 7 | // it under the terms of the GNU General Public License as published by 8 | // the Free Software Foundation, either version 2 of the License, or 9 | // (at your option) any later version. 10 | // 11 | // This program is distributed in the hope that it will be useful, 12 | // but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | // GNU General Public License for more details. 15 | // 16 | // You should have received a copy of the GNU General Public License 17 | // along with this program. If not, see . 18 | // 19 | // ----------------------------------------------------------------------- 20 | // 21 | // 22 | // Most of this is based on: 23 | // 24 | // FX.25 Encoder 25 | // Author: Jim McGuire KB3MPL 26 | // Date: 23 October 2007 27 | // 28 | // This program is a single-file implementation of the FX.25 encapsulation 29 | // structure for use with AX.25 data packets. Details of the FX.25 30 | // specification are available at: 31 | // http://www.stensat.org/Docs/Docs.htm 32 | // 33 | // This program implements a single RS(255,239) FEC structure. Future 34 | // releases will incorporate more capabilities as accommodated in the FX.25 35 | // spec. 36 | // 37 | // The Reed Solomon encoding routines are based on work performed by 38 | // Phil Karn. Phil was kind enough to release his code under the GPL, as 39 | // noted below. Consequently, this FX.25 implementation is also released 40 | // under the terms of the GPL. 41 | // 42 | // Phil Karn's original copyright notice: 43 | /* Test the Reed-Solomon codecs 44 | * for various block sizes and with random data and random error patterns 45 | * 46 | * Copyright 2002 Phil Karn, KA9Q 47 | * May be used under the terms of the GNU General Public License (GPL) 48 | * 49 | */ 50 | 51 | 52 | #include 53 | #include 54 | #include 55 | #include 56 | 57 | #include "fx25.h" 58 | 59 | 60 | 61 | void ENCODE_RS(struct rs * restrict rs, DTYPE * restrict data, DTYPE * restrict bb) 62 | { 63 | 64 | int i, j; 65 | DTYPE feedback; 66 | 67 | memset(bb,0,NROOTS*sizeof(DTYPE)); // clear out the FEC data area 68 | 69 | for(i=0;i RF direction. */ 42 | /* This is the "server side" filter. */ 43 | /* A better name would be subscription or something */ 44 | /* like that because we can only ask for more. */ 45 | 46 | /* 47 | * For transmitting. 48 | */ 49 | int tx_chan; /* Radio channel for transmitting. */ 50 | /* 0=first, etc. -1 for none. */ 51 | /* Presently IGate can transmit on only a single channel. */ 52 | /* A future version might generalize this. */ 53 | /* Each transmit channel would have its own client side filtering. */ 54 | 55 | char tx_via[80]; /* VIA path for transmitting third party packets. */ 56 | /* Usual text representation. */ 57 | /* Must start with "," if not empty so it can */ 58 | /* simply be inserted after the destination address. */ 59 | 60 | int max_digi_hops; /* Maximum number of digipeater hops possible for via path. */ 61 | /* Derived from the SSID when last character of address is a digit. */ 62 | /* e.g. "WIDE1-1,WIDE5-2" would be 3. */ 63 | /* This is useful to know so we can determine how many */ 64 | /* stations we might be able to reach. */ 65 | 66 | int tx_limit_1; /* Max. packets to transmit in 1 minute. */ 67 | 68 | int tx_limit_5; /* Max. packets to transmit in 5 minutes. */ 69 | 70 | int igmsp; /* Number of message sender position reports to allow. */ 71 | /* Common practice is to default to 1. */ 72 | /* We allow additional flexibility of 0 to disable feature */ 73 | /* or a small number to allow more. */ 74 | 75 | /* 76 | * Receiver to IS data options. 77 | */ 78 | int rx2ig_dedupe_time; /* seconds. 0 to disable. */ 79 | 80 | /* 81 | * Special SATgate mode to delay packets heard directly. 82 | */ 83 | int satgate_delay; /* seconds. 0 to disable. */ 84 | }; 85 | 86 | 87 | #define IGATE_TX_LIMIT_1_DEFAULT 6 88 | #define IGATE_TX_LIMIT_1_MAX 20 89 | 90 | #define IGATE_TX_LIMIT_5_DEFAULT 20 91 | #define IGATE_TX_LIMIT_5_MAX 80 92 | 93 | #define IGATE_RX2IG_DEDUPE_TIME 0 /* Issue 85. 0 means disable dupe checking in RF>IS direction. */ 94 | /* See comments in rx_to_ig_remember & rx_to_ig_allow. */ 95 | /* Currently there is no configuration setting to change this. */ 96 | 97 | #define DEFAULT_SATGATE_DELAY 10 98 | #define MIN_SATGATE_DELAY 5 99 | #define MAX_SATGATE_DELAY 30 100 | 101 | 102 | /* Call this once at startup */ 103 | 104 | void igate_init (struct audio_s *p_audio_config, struct igate_config_s *p_igate_config, struct digi_config_s *p_digi_config, int debug_level); 105 | 106 | /* Call this with each packet received from the radio. */ 107 | 108 | void igate_send_rec_packet (int chan, packet_t recv_pp); 109 | 110 | /* This when digipeater transmits. Set bydigi to 1 . */ 111 | 112 | void ig_to_tx_remember (packet_t pp, int chan, int bydigi); 113 | 114 | 115 | 116 | /* Get statistics for IGATE status beacon. */ 117 | 118 | int igate_get_msg_cnt (void); 119 | 120 | int igate_get_pkt_cnt (void); 121 | 122 | int igate_get_upl_cnt (void); 123 | 124 | int igate_get_dnl_cnt (void); 125 | 126 | 127 | 128 | #endif 129 | -------------------------------------------------------------------------------- /src/il2p.h: -------------------------------------------------------------------------------- 1 | 2 | 3 | #ifndef IL2P_H 4 | #define IL2P_H 1 5 | 6 | 7 | #define IL2P_PREAMBLE 0x55 8 | 9 | #define IL2P_SYNC_WORD 0xF15E48 10 | 11 | #define IL2P_SYNC_WORD_SIZE 3 12 | #define IL2P_HEADER_SIZE 13 // Does not include 2 parity. 13 | #define IL2P_HEADER_PARITY 2 14 | 15 | #define IL2P_MAX_PAYLOAD_SIZE 1023 16 | #define IL2P_MAX_PAYLOAD_BLOCKS 5 17 | #define IL2P_MAX_PARITY_SYMBOLS 16 // For payload only. 18 | #define IL2P_MAX_ENCODED_PAYLOAD_SIZE (IL2P_MAX_PAYLOAD_SIZE + IL2P_MAX_PAYLOAD_BLOCKS * IL2P_MAX_PARITY_SYMBOLS) 19 | 20 | #define IL2P_MAX_PACKET_SIZE (IL2P_SYNC_WORD_SIZE + IL2P_HEADER_SIZE + IL2P_HEADER_PARITY + IL2P_MAX_ENCODED_PAYLOAD_SIZE) 21 | 22 | 23 | /////////////////////////////////////////////////////////////////////////////// 24 | // 25 | // il2p_init.c 26 | // 27 | /////////////////////////////////////////////////////////////////////////////// 28 | 29 | 30 | // Init must be called at start of application. 31 | 32 | extern void il2p_init (int debug); 33 | 34 | #include "fx25.h" // For Reed Solomon stuff. e.g. struct rs 35 | // Maybe rearrange someday because RS now used another place. 36 | 37 | extern struct rs *il2p_find_rs(int nparity); // Internal later? 38 | 39 | extern void il2p_encode_rs (unsigned char *tx_data, int data_size, int num_parity, unsigned char *parity_out); 40 | 41 | extern int il2p_decode_rs (unsigned char *rec_block, int data_size, int num_parity, unsigned char *out); 42 | 43 | extern int il2p_get_debug(void); 44 | extern void il2p_set_debug(int debug); 45 | 46 | 47 | /////////////////////////////////////////////////////////////////////////////// 48 | // 49 | // il2p_rec.c 50 | // 51 | /////////////////////////////////////////////////////////////////////////////// 52 | 53 | // Receives a bit stream from demodulator. 54 | 55 | extern void il2p_rec_bit (int chan, int subchan, int slice, int dbit); 56 | 57 | 58 | 59 | 60 | /////////////////////////////////////////////////////////////////////////////// 61 | // 62 | // il2p_send.c 63 | // 64 | /////////////////////////////////////////////////////////////////////////////// 65 | 66 | #include "ax25_pad.h" // For packet object. 67 | 68 | // Send bit stream to modulator. 69 | 70 | int il2p_send_frame (int chan, packet_t pp, int max_fec, int polarity); 71 | 72 | 73 | 74 | /////////////////////////////////////////////////////////////////////////////// 75 | // 76 | // il2p_codec.c 77 | // 78 | /////////////////////////////////////////////////////////////////////////////// 79 | 80 | #include "ax25_pad.h" 81 | 82 | extern int il2p_encode_frame (packet_t pp, int max_fec, unsigned char *iout); 83 | 84 | packet_t il2p_decode_frame (unsigned char *irec); 85 | 86 | packet_t il2p_decode_header_payload (unsigned char* uhdr, unsigned char *epayload, int *symbols_corrected); 87 | 88 | 89 | 90 | 91 | /////////////////////////////////////////////////////////////////////////////// 92 | // 93 | // il2p_header.c 94 | // 95 | /////////////////////////////////////////////////////////////////////////////// 96 | 97 | 98 | extern int il2p_type_1_header (packet_t pp, int max_fec, unsigned char *hdr); 99 | 100 | extern packet_t il2p_decode_header_type_1 (unsigned char *hdr, int num_sym_changed); 101 | 102 | 103 | extern int il2p_type_0_header (packet_t pp, int max_fec, unsigned char *hdr); 104 | 105 | extern int il2p_clarify_header(unsigned char *rec_hdr, unsigned char *corrected_descrambled_hdr); 106 | 107 | 108 | 109 | /////////////////////////////////////////////////////////////////////////////// 110 | // 111 | // il2p_scramble.c 112 | // 113 | /////////////////////////////////////////////////////////////////////////////// 114 | 115 | extern void il2p_scramble_block (unsigned char *in, unsigned char *out, int len); 116 | 117 | extern void il2p_descramble_block (unsigned char *in, unsigned char *out, int len); 118 | 119 | 120 | /////////////////////////////////////////////////////////////////////////////// 121 | // 122 | // il2p_payload.c 123 | // 124 | /////////////////////////////////////////////////////////////////////////////// 125 | 126 | 127 | typedef struct { 128 | int payload_byte_count; // Total size, 0 thru 1023 129 | int payload_block_count; 130 | int small_block_size; 131 | int large_block_size; 132 | int large_block_count; 133 | int small_block_count; 134 | int parity_symbols_per_block; // 2, 4, 6, 8, 16 135 | } il2p_payload_properties_t; 136 | 137 | extern int il2p_payload_compute (il2p_payload_properties_t *p, int payload_size, int max_fec); 138 | 139 | extern int il2p_encode_payload (unsigned char *payload, int payload_size, int max_fec, unsigned char *enc); 140 | 141 | extern int il2p_decode_payload (unsigned char *received, int payload_size, int max_fec, unsigned char *payload_out, int *symbols_corrected); 142 | 143 | extern int il2p_get_header_attributes (unsigned char *hdr, int *hdr_type, int *max_fec); 144 | 145 | #endif 146 | -------------------------------------------------------------------------------- /src/kiss.h: -------------------------------------------------------------------------------- 1 | 2 | /* 3 | * Name: kiss.h 4 | * 5 | * This is for the pseudo terminal KISS interface. 6 | */ 7 | 8 | 9 | #include "ax25_pad.h" /* for packet_t */ 10 | 11 | #include "config.h" 12 | 13 | #include "kiss_frame.h" // for struct kissport_status_s 14 | 15 | 16 | void kisspt_init (struct misc_config_s *misc_config); 17 | 18 | void kisspt_send_rec_packet (int chan, int kiss_cmd, unsigned char *fbuf, int flen, 19 | struct kissport_status_s *notused1, int notused2); 20 | 21 | void kisspt_set_debug (int n); 22 | 23 | 24 | /* end kiss.h */ 25 | -------------------------------------------------------------------------------- /src/kiss_frame.h: -------------------------------------------------------------------------------- 1 | 2 | /* kiss_frame.h */ 3 | 4 | #ifndef KISS_FRAME_H 5 | #define KISS_FRAME_H 6 | 7 | 8 | #include "audio.h" /* for struct audio_s */ 9 | 10 | 11 | /* 12 | * The first byte of a KISS frame has: 13 | * channel in upper nybble. 14 | * command in lower nybble. 15 | */ 16 | 17 | #define KISS_CMD_DATA_FRAME 0 18 | #define KISS_CMD_TXDELAY 1 19 | #define KISS_CMD_PERSISTENCE 2 20 | #define KISS_CMD_SLOTTIME 3 21 | #define KISS_CMD_TXTAIL 4 22 | #define KISS_CMD_FULLDUPLEX 5 23 | #define KISS_CMD_SET_HARDWARE 6 24 | #define XKISS_CMD_DATA 12 // Not supported. http://he.fi/pub/oh7lzb/bpq/multi-kiss.pdf 25 | #define XKISS_CMD_POLL 14 // Not supported. 26 | #define KISS_CMD_END_KISS 15 27 | 28 | 29 | 30 | /* 31 | * Special characters used by SLIP protocol. 32 | */ 33 | 34 | #define FEND 0xC0 35 | #define FESC 0xDB 36 | #define TFEND 0xDC 37 | #define TFESC 0xDD 38 | 39 | 40 | 41 | enum kiss_state_e { 42 | KS_SEARCHING = 0, /* Looking for FEND to start KISS frame. */ 43 | /* Must be 0 so we can simply zero whole structure to initialize. */ 44 | KS_COLLECTING}; /* In process of collecting KISS frame. */ 45 | 46 | 47 | #define MAX_KISS_LEN 2048 /* Spec calls for at least 1024. */ 48 | /* Might want to make it longer to accommodate */ 49 | /* maximum packet length. */ 50 | 51 | #define MAX_NOISE_LEN 100 52 | 53 | typedef struct kiss_frame_s { 54 | 55 | enum kiss_state_e state; 56 | 57 | unsigned char kiss_msg[MAX_KISS_LEN]; 58 | /* Leading FEND is optional. */ 59 | /* Contains escapes and ending FEND. */ 60 | int kiss_len; 61 | 62 | unsigned char noise[MAX_NOISE_LEN]; 63 | int noise_len; 64 | 65 | } kiss_frame_t; 66 | 67 | 68 | // This is used only for TCPKISS but it put in kissnet.h, 69 | // there would be a circular dependency between the two header files. 70 | // Each KISS TCP port has its own status block. 71 | 72 | struct kissport_status_s { 73 | 74 | struct kissport_status_s *pnext; // To next in list. 75 | 76 | volatile int arg2; // temp for passing second arg into 77 | // kissnet_listen_thread 78 | 79 | int tcp_port; // default 8001 80 | 81 | int chan; // Radio channel for this tcp port. 82 | // -1 for all. 83 | 84 | // The default is a limit of 3 client applications at the same time. 85 | // You can increase the limit by changing the line below. 86 | // A larger number consumes more resources so don't go crazy by making it larger than needed. 87 | // TODO: Should this be moved to direwolf.h so max number of audio devices 88 | // client apps are in the same place? 89 | 90 | #define MAX_NET_CLIENTS 3 91 | 92 | int client_sock[MAX_NET_CLIENTS]; 93 | /* File descriptor for socket for */ 94 | /* communication with client application. */ 95 | /* Set to -1 if not connected. */ 96 | /* (Don't use SOCKET type because it is unsigned.) */ 97 | 98 | kiss_frame_t kf[MAX_NET_CLIENTS]; 99 | /* Accumulated KISS frame and state of decoder. */ 100 | }; 101 | 102 | 103 | 104 | #ifndef KISSUTIL 105 | void kiss_frame_init (struct audio_s *pa); 106 | #endif 107 | 108 | int kiss_encapsulate (unsigned char *in, int ilen, unsigned char *out); 109 | 110 | int kiss_unwrap (unsigned char *in, int ilen, unsigned char *out); 111 | 112 | void kiss_rec_byte (kiss_frame_t *kf, unsigned char ch, int debug, struct kissport_status_s *kps, int client, 113 | void (*sendfun)(int chan, int kiss_cmd, unsigned char *fbuf, int flen, struct kissport_status_s *onlykps, int onlyclient)); 114 | 115 | typedef enum fromto_e { FROM_CLIENT=0, TO_CLIENT=1 } fromto_t; 116 | 117 | void kiss_process_msg (unsigned char *kiss_msg, int kiss_len, int debug, struct kissport_status_s *kps, int client, 118 | void (*sendfun)(int chan, int kiss_cmd, unsigned char *fbuf, int flen, struct kissport_status_s *onlykps, int onlyclient)); 119 | 120 | void kiss_debug_print (fromto_t fromto, char *special, unsigned char *pmsg, int msg_len); 121 | 122 | 123 | #endif // KISS_FRAME_H 124 | 125 | 126 | /* end kiss_frame.h */ 127 | -------------------------------------------------------------------------------- /src/kissnet.h: -------------------------------------------------------------------------------- 1 | 2 | /* 3 | * Name: kissnet.h 4 | */ 5 | 6 | #ifndef KISSNET_H 7 | #define KISSNET_H 8 | 9 | #include "ax25_pad.h" /* for packet_t */ 10 | 11 | #include "config.h" 12 | 13 | #include "kiss_frame.h" 14 | 15 | 16 | 17 | void kissnet_init (struct misc_config_s *misc_config); 18 | 19 | void kissnet_send_rec_packet (int chan, int kiss_cmd, unsigned char *fbuf, int flen, 20 | struct kissport_status_s *onlykps, int onlyclient); 21 | 22 | void kiss_net_set_debug (int n); 23 | 24 | void kissnet_copy (unsigned char *kiss_msg, int kiss_len, int chan, int cmd, struct kissport_status_s *from_kps, int from_client); 25 | 26 | 27 | #endif // KISSNET_H 28 | 29 | /* end kissnet.h */ 30 | -------------------------------------------------------------------------------- /src/kissserial.h: -------------------------------------------------------------------------------- 1 | 2 | /* 3 | * Name: kissserial.h 4 | */ 5 | 6 | 7 | #include "ax25_pad.h" /* for packet_t */ 8 | 9 | #include "config.h" 10 | 11 | #include "kiss_frame.h" 12 | 13 | 14 | void kissserial_init (struct misc_config_s *misc_config); 15 | 16 | void kissserial_send_rec_packet (int chan, int kiss_cmd, unsigned char *fbuf, int flen, 17 | struct kissport_status_s *notused1, int notused2); 18 | 19 | 20 | void kissserial_set_debug (int n); 21 | 22 | 23 | /* end kissserial.h */ 24 | -------------------------------------------------------------------------------- /src/latlong.h: -------------------------------------------------------------------------------- 1 | 2 | /* latlong.h */ 3 | 4 | 5 | /* Use this value for unknown latitude/longitude or other values. */ 6 | 7 | #define G_UNKNOWN (-999999) 8 | 9 | 10 | void latitude_to_str (double dlat, int ambiguity, char *slat); 11 | void longitude_to_str (double dlong, int ambiguity, char *slong); 12 | 13 | void latitude_to_comp_str (double dlat, char *clat); 14 | void longitude_to_comp_str (double dlon, char *clon); 15 | 16 | void latitude_to_nmea (double dlat, char *slat, char *hemi); 17 | void longitude_to_nmea (double dlong, char *slong, char *hemi); 18 | 19 | double latitude_from_nmea (char *pstr, char *phemi); 20 | double longitude_from_nmea (char *pstr, char *phemi); 21 | 22 | double ll_distance_km (double lat1, double lon1, double lat2, double lon2); 23 | 24 | int ll_from_grid_square (char *maidenhead, double *dlat, double *dlon); -------------------------------------------------------------------------------- /src/ll2utm.c: -------------------------------------------------------------------------------- 1 | /* Latitude / Longitude to UTM conversion */ 2 | 3 | #include "direwolf.h" 4 | 5 | #include 6 | #include 7 | #include 8 | 9 | 10 | #include "utm.h" 11 | #include "mgrs.h" 12 | #include "usng.h" 13 | #include "error_string.h" 14 | 15 | 16 | #define D2R(d) ((d) * M_PI / 180.) 17 | #define R2D(r) ((r) * 180. / M_PI) 18 | 19 | 20 | static void usage(); 21 | 22 | 23 | int main (int argc, char *argv[]) 24 | { 25 | double easting; 26 | double northing; 27 | double lat, lon; 28 | char mgrs[32]; 29 | char usng[32]; 30 | char hemisphere; 31 | long lzone; 32 | long err; 33 | char message[300]; 34 | 35 | 36 | if (argc != 3) usage(); 37 | 38 | lat = atof(argv[1]); 39 | 40 | lon = atof(argv[2]); 41 | 42 | 43 | // UTM 44 | 45 | err = Convert_Geodetic_To_UTM (D2R(lat), D2R(lon), &lzone, &hemisphere, &easting, &northing); 46 | if (err == 0) { 47 | printf ("UTM zone = %ld, hemisphere = %c, easting = %.0f, northing = %.0f\n", lzone, hemisphere, easting, northing); 48 | } 49 | else { 50 | utm_error_string (err, message); 51 | fprintf (stderr, "Conversion to UTM failed:\n%s\n\n", message); 52 | 53 | // Others could still succeed, keep going. 54 | } 55 | 56 | 57 | // Practice run with MGRS to see if it will succeed 58 | 59 | err = Convert_Geodetic_To_MGRS (D2R(lat), D2R(lon), 5L, mgrs); 60 | if (err == 0) { 61 | 62 | // OK, hope changing precision doesn't make a difference. 63 | 64 | long precision; 65 | 66 | printf ("MGRS ="); 67 | for (precision = 1; precision <= 5; precision++) { 68 | Convert_Geodetic_To_MGRS (D2R(lat), D2R(lon), precision, mgrs); 69 | printf (" %s", mgrs); 70 | } 71 | printf ("\n"); 72 | } 73 | else { 74 | mgrs_error_string (err, message); 75 | fprintf (stderr, "Conversion to MGRS failed:\n%s\n", message); 76 | } 77 | 78 | // Same for USNG. 79 | 80 | err = Convert_Geodetic_To_USNG (D2R(lat), D2R(lon), 5L, usng); 81 | if (err == 0) { 82 | 83 | long precision; 84 | 85 | printf ("USNG ="); 86 | for (precision = 1; precision <= 5; precision++) { 87 | Convert_Geodetic_To_USNG (D2R(lat), D2R(lon), precision, usng); 88 | printf (" %s", usng); 89 | } 90 | printf ("\n"); 91 | } 92 | else { 93 | usng_error_string (err, message); 94 | fprintf (stderr, "Conversion to USNG failed:\n%s\n", message); 95 | } 96 | 97 | exit (0); 98 | } 99 | 100 | 101 | static void usage (void) 102 | { 103 | fprintf (stderr, "Latitude / Longitude to UTM conversion\n"); 104 | fprintf (stderr, "\n"); 105 | fprintf (stderr, "Usage:\n"); 106 | fprintf (stderr, "\tll2utm latitude longitude\n"); 107 | fprintf (stderr, "\n"); 108 | fprintf (stderr, "where,\n"); 109 | fprintf (stderr, "\tLatitude and longitude are in decimal degrees.\n"); 110 | fprintf (stderr, "\t Use negative for south or west.\n"); 111 | fprintf (stderr, "\n"); 112 | fprintf (stderr, "Example:\n"); 113 | fprintf (stderr, "\tll2utm 42.662139 -71.365553\n"); 114 | 115 | exit (1); 116 | } -------------------------------------------------------------------------------- /src/log.h: -------------------------------------------------------------------------------- 1 | 2 | /* log.h */ 3 | 4 | 5 | #include "hdlc_rec2.h" // for retry_t 6 | 7 | #include "decode_aprs.h" // for decode_aprs_t 8 | 9 | #include "ax25_pad.h" 10 | 11 | 12 | 13 | void log_init (int daily_names, char *path); 14 | 15 | void log_write (int chan, decode_aprs_t *A, packet_t pp, alevel_t alevel, retry_t retries); 16 | 17 | void log_rr_bits (decode_aprs_t *A, packet_t pp); 18 | 19 | void log_term (void); -------------------------------------------------------------------------------- /src/mheard.h: -------------------------------------------------------------------------------- 1 | 2 | 3 | /* mheard.h */ 4 | 5 | #include "decode_aprs.h" // for decode_aprs_t 6 | 7 | 8 | void mheard_init (int debug); 9 | 10 | void mheard_save_rf (int chan, decode_aprs_t *A, packet_t pp, alevel_t alevel, retry_t retries); 11 | 12 | void mheard_save_is (char *ptext); 13 | 14 | int mheard_count (int max_hops, int time_limit); 15 | 16 | int mheard_was_recently_nearby (char *role, char *callsign, int time_limit, int max_hops, double dlat, double dlon, double km); 17 | 18 | void mheard_set_msp (char *callsign, int num); 19 | 20 | int mheard_get_msp (char *callsign); -------------------------------------------------------------------------------- /src/morse.h: -------------------------------------------------------------------------------- 1 | /* morse.h */ 2 | 3 | int morse_init (struct audio_s *audio_config_p, int amp) ; 4 | 5 | int morse_send (int chan, char *str, int wpm, int txdelay, int txtail); 6 | 7 | #define MORSE_DEFAULT_WPM 10 8 | 9 | -------------------------------------------------------------------------------- /src/multi_modem.h: -------------------------------------------------------------------------------- 1 | /* multi_modem.h */ 2 | 3 | #ifndef MULTI_MODEM_H 4 | #define MULTI_MODEM 1 5 | 6 | /* Needed for typedef retry_t. */ 7 | #include "hdlc_rec2.h" 8 | 9 | /* Needed for struct audio_s */ 10 | #include "audio.h" 11 | 12 | 13 | void multi_modem_init (struct audio_s *pmodem); 14 | 15 | void multi_modem_process_sample (int c, int audio_sample); 16 | 17 | int multi_modem_get_dc_average (int chan); 18 | 19 | // Deprecated. Replace with ...packet 20 | void multi_modem_process_rec_frame (int chan, int subchan, int slice, unsigned char *fbuf, int flen, alevel_t alevel, retry_t retries, fec_type_t fec_type); 21 | 22 | void multi_modem_process_rec_packet (int chan, int subchan, int slice, packet_t pp, alevel_t alevel, retry_t retries, fec_type_t fec_type); 23 | 24 | #endif 25 | -------------------------------------------------------------------------------- /src/pfilter.h: -------------------------------------------------------------------------------- 1 | 2 | /* pfilter.h */ 3 | 4 | 5 | #include "igate.h" // for igate_config_s 6 | 7 | 8 | 9 | void pfilter_init (struct igate_config_s *p_igate_config, int debug_level); 10 | 11 | int pfilter (int from_chan, int to_chan, char *filter, packet_t pp, int is_aprs); 12 | 13 | int is_telem_metadata (char *infop); -------------------------------------------------------------------------------- /src/ptt.h: -------------------------------------------------------------------------------- 1 | 2 | 3 | #ifndef PTT_H 4 | #define PTT_H 1 5 | 6 | 7 | #include "audio.h" /* for struct audio_s and definitions for octype values */ 8 | 9 | 10 | void ptt_set_debug(int debug); 11 | 12 | void ptt_init (struct audio_s *p_modem); 13 | 14 | void ptt_set (int octype, int chan, int ptt); 15 | 16 | void ptt_term (void); 17 | 18 | int get_input (int it, int chan); 19 | 20 | #endif 21 | 22 | 23 | /* end ptt.h */ 24 | 25 | 26 | 27 | -------------------------------------------------------------------------------- /src/recv.h: -------------------------------------------------------------------------------- 1 | 2 | /* recv.h */ 3 | 4 | void recv_init (struct audio_s *pa); 5 | 6 | void recv_process (void); -------------------------------------------------------------------------------- /src/redecode.h: -------------------------------------------------------------------------------- 1 | 2 | 3 | #ifndef REDECODE_H 4 | #define REDECODE_H 1 5 | 6 | #include "rrbb.h" 7 | 8 | 9 | extern void redecode_init (struct audio_s *p_audio_config); 10 | 11 | 12 | #endif 13 | 14 | /* end redecode.h */ 15 | 16 | -------------------------------------------------------------------------------- /src/rpack.h: -------------------------------------------------------------------------------- 1 | 2 | /*------------------------------------------------------------------ 3 | * 4 | * File: rpack.h 5 | * 6 | * Purpose: Definition of Garmin Rino message format. 7 | * 8 | * References: http://www.radio-active.net.au/web3/APRS/Resources/RINO 9 | * 10 | * http://www.radio-active.net.au/web3/APRS/Resources/RINO/OnAir 11 | * 12 | *---------------------------------------------------------------*/ 13 | 14 | 15 | #ifndef RPACK_H 16 | #define RPACK_H 1 17 | 18 | 19 | #define RPACK_FRAME_LEN 168 20 | 21 | 22 | #ifdef RPACK_C /* Expose private details */ 23 | 24 | 25 | 26 | // Transmission order is LSB first. 27 | 28 | struct __attribute__((__packed__)) rpack_s { 29 | 30 | int lat; // Latitude. 31 | // Signed integer. Scaled by 2**30/90. 32 | 33 | int lon; // Longitude. Same encoding. 34 | 35 | char unknown1; // Unproven theory: altitude. 36 | char unknown2; 37 | 38 | unsigned name0:6; // 10 character name. 39 | unsigned name1:6; // Bit packing is implementation dependent. 40 | unsigned name2:6; // Should rewrite to be more portable. 41 | unsigned name3:6; 42 | unsigned name4:6; 43 | unsigned name5:6; 44 | unsigned name6:6; 45 | unsigned name7:6; 46 | unsigned name8:6; 47 | unsigned name9:6; 48 | 49 | unsigned symbol:5; 50 | 51 | unsigned unknown3:7; 52 | 53 | 54 | // unsigned crc:16; // Safe bet this is CRC for error checking. 55 | 56 | unsigned char crc1; 57 | unsigned char crc2; 58 | 59 | char dummy[3]; // Total size should be 24 bytes if no gaps. 60 | 61 | }; 62 | 63 | #else /* Show only public interface. */ 64 | 65 | 66 | struct rpack_s { 67 | char stuff[24]; 68 | }; 69 | 70 | 71 | #endif 72 | 73 | 74 | 75 | void rpack_set_bit (struct rpack_s *rp, int position, int value); 76 | 77 | int rpack_is_valid (struct rpack_s *rp); 78 | 79 | int rpack_get_bit (struct rpack_s *rp, int position); 80 | 81 | double rpack_get_lat (struct rpack_s *rp); 82 | 83 | double rpack_get_lon (struct rpack_s *rp); 84 | 85 | int rpack_get_symbol (struct rpack_s *rp); 86 | 87 | void rpack_get_name (struct rpack_s *rp, char *str); 88 | 89 | 90 | 91 | #endif 92 | 93 | /* end rpack.h */ 94 | 95 | -------------------------------------------------------------------------------- /src/rrbb.h: -------------------------------------------------------------------------------- 1 | 2 | #ifndef RRBB_H 3 | 4 | #define RRBB_H 5 | 6 | 7 | #define FASTER13 1 // Don't pack 8 samples per byte. 8 | 9 | 10 | //typedef short slice_t; 11 | 12 | 13 | /* 14 | * Maximum size (in bytes) of an AX.25 frame including the 2 octet FCS. 15 | */ 16 | 17 | #define MAX_FRAME_LEN ((AX25_MAX_PACKET_LEN) + 2) 18 | 19 | /* 20 | * Maximum number of bits in AX.25 frame excluding the flags. 21 | * Adequate for extreme case of bit stuffing after every 5 bits 22 | * which could never happen. 23 | */ 24 | 25 | #define MAX_NUM_BITS (MAX_FRAME_LEN * 8 * 6 / 5) 26 | 27 | typedef struct rrbb_s { 28 | int magic1; 29 | struct rrbb_s* nextp; /* Next pointer to maintain a queue. */ 30 | 31 | int chan; /* Radio channel from which it was received. */ 32 | int subchan; /* Which modem when more than one per channel. */ 33 | int slice; /* Which slicer. */ 34 | 35 | alevel_t alevel; /* Received audio level at time of frame capture. */ 36 | float speed_error; /* Received data speed error as percentage. */ 37 | unsigned int len; /* Current number of samples in array. */ 38 | 39 | int is_scrambled; /* Is data scrambled G3RUH / K9NG style? */ 40 | int descram_state; /* Descrambler state before first data bit of frame. */ 41 | int prev_descram; /* Previous descrambled bit. */ 42 | 43 | unsigned char fdata[MAX_NUM_BITS]; 44 | 45 | int magic2; 46 | } *rrbb_t; 47 | 48 | 49 | 50 | rrbb_t rrbb_new (int chan, int subchan, int slice, int is_scrambled, int descram_state, int prev_descram); 51 | 52 | void rrbb_clear (rrbb_t b, int is_scrambled, int descram_state, int prev_descram); 53 | 54 | 55 | static inline /*__attribute__((always_inline))*/ void rrbb_append_bit (rrbb_t b, const unsigned char val) 56 | { 57 | if (b->len >= MAX_NUM_BITS) { 58 | return; /* Silently discard if full. */ 59 | } 60 | b->fdata[b->len] = val; 61 | b->len++; 62 | } 63 | 64 | static inline /*__attribute__((always_inline))*/ unsigned char rrbb_get_bit (const rrbb_t b, const int ind) 65 | { 66 | return (b->fdata[ind]); 67 | } 68 | 69 | 70 | void rrbb_chop8 (rrbb_t b); 71 | 72 | int rrbb_get_len (rrbb_t b); 73 | 74 | //void rrbb_flip_bit (rrbb_t b, unsigned int ind); 75 | 76 | void rrbb_delete (rrbb_t b); 77 | 78 | void rrbb_set_nextp (rrbb_t b, rrbb_t np); 79 | rrbb_t rrbb_get_nextp (rrbb_t b); 80 | 81 | int rrbb_get_chan (rrbb_t b); 82 | int rrbb_get_subchan (rrbb_t b); 83 | int rrbb_get_slice (rrbb_t b); 84 | 85 | void rrbb_set_audio_level (rrbb_t b, alevel_t alevel); 86 | alevel_t rrbb_get_audio_level (rrbb_t b); 87 | 88 | void rrbb_set_speed_error (rrbb_t b, float speed_error); 89 | float rrbb_get_speed_error (rrbb_t b); 90 | 91 | int rrbb_get_is_scrambled (rrbb_t b); 92 | int rrbb_get_descram_state (rrbb_t b); 93 | int rrbb_get_prev_descram (rrbb_t b); 94 | 95 | 96 | #endif 97 | -------------------------------------------------------------------------------- /src/serial_port.h: -------------------------------------------------------------------------------- 1 | /* serial_port.h */ 2 | 3 | 4 | #ifndef SERIAL_PORT_H 5 | #define SERIAL_PORT_H 1 6 | 7 | 8 | #if __WIN32__ 9 | 10 | #include 11 | 12 | typedef HANDLE MYFDTYPE; 13 | #define MYFDERROR INVALID_HANDLE_VALUE 14 | 15 | #else 16 | 17 | typedef int MYFDTYPE; 18 | #define MYFDERROR (-1) 19 | 20 | #endif 21 | 22 | 23 | extern MYFDTYPE serial_port_open (char *devicename, int baud); 24 | 25 | extern int serial_port_write (MYFDTYPE fd, char *str, int len); 26 | 27 | extern int serial_port_get1 (MYFDTYPE fd); 28 | 29 | extern void serial_port_close (MYFDTYPE fd); 30 | 31 | 32 | #endif -------------------------------------------------------------------------------- /src/server.h: -------------------------------------------------------------------------------- 1 | 2 | /* 3 | * Name: server.h 4 | */ 5 | 6 | 7 | #include "ax25_pad.h" /* for packet_t */ 8 | 9 | #include "config.h" 10 | 11 | 12 | void server_set_debug (int n); 13 | 14 | void server_init (struct audio_s *audio_config_p, struct misc_config_s *misc_config); 15 | 16 | void server_send_rec_packet (int chan, packet_t pp, unsigned char *fbuf, int flen); 17 | 18 | void server_send_monitored (int chan, packet_t pp, int own_xmit); 19 | 20 | int server_callsign_registered_by_client (char *callsign); 21 | 22 | 23 | void server_link_established (int chan, int client, char *remote_call, char *own_call, int incoming); 24 | 25 | void server_link_terminated (int chan, int client, char *remote_call, char *own_call, int timeout); 26 | 27 | void server_rec_conn_data (int chan, int client, char *remote_call, char *own_call, int pid, char *data_ptr, int data_len); 28 | 29 | void server_outstanding_frames_reply (int chan, int client, char *own_call, char *remote_call, int count); 30 | 31 | 32 | /* end server.h */ 33 | -------------------------------------------------------------------------------- /src/symbols.h: -------------------------------------------------------------------------------- 1 | 2 | /* symbols.h */ 3 | 4 | void symbols_init (void); 5 | 6 | void symbols_list (void); 7 | 8 | void symbols_from_dest_or_src (char dti, char *src, char *dest, char *symtab, char *symbol); 9 | 10 | int symbols_into_dest (char symtab, char symbol, char *dest); 11 | 12 | void symbols_get_description (char symtab, char symbol, char *description, size_t desc_size); 13 | 14 | int symbols_code_from_description (char overlay, char *description, char *symtab, char *symbol); 15 | 16 | void symbols_to_tones (char symtab, char symbol, char *tones, size_t tonessize); 17 | 18 | 19 | /* end symbols.h */ 20 | -------------------------------------------------------------------------------- /src/telemetry.h: -------------------------------------------------------------------------------- 1 | 2 | 3 | /* telemetry.h */ 4 | 5 | void telemetry_data_original (char *station, char *info, int quiet, char *output, size_t outputsize, char *comment, size_t commentsize); 6 | 7 | void telemetry_data_base91 (char *station, char *cdata, char *output, size_t outputsize); 8 | 9 | void telemetry_name_message (char *station, char *msg); 10 | 11 | void telemetry_unit_label_message (char *station, char *msg); 12 | 13 | void telemetry_coefficents_message (char *station, char *msg, int quiet); 14 | 15 | void telemetry_bit_sense_message (char *station, char *msg, int quiet); 16 | -------------------------------------------------------------------------------- /src/textcolor.h: -------------------------------------------------------------------------------- 1 | 2 | /*------------------------------------------------------------------- 3 | * 4 | * Name: textcolor.h 5 | * 6 | * Purpose: Set color of text. 7 | * 8 | *--------------------------------------------------------------------*/ 9 | 10 | 11 | #ifndef TEXTCOLOR_H 12 | #define TEXTCOLOR_H 1 13 | 14 | enum dw_color_e { DW_COLOR_INFO, /* black */ 15 | DW_COLOR_ERROR, /* red */ 16 | DW_COLOR_REC, /* green */ 17 | DW_COLOR_DECODED, /* blue */ 18 | DW_COLOR_XMIT, /* magenta */ 19 | DW_COLOR_DEBUG /* dark_green */ 20 | }; 21 | 22 | typedef enum dw_color_e dw_color_t; 23 | 24 | 25 | void text_color_init (int enable_color); 26 | void text_color_set (dw_color_t c); 27 | void text_color_term (void); 28 | 29 | 30 | /* Degree symbol. */ 31 | 32 | #if __WIN32__ 33 | 34 | //#define CH_DEGREE "\xc2\xb0" /* UTF-8. */ 35 | 36 | #define CH_DEGREE " " 37 | 38 | 39 | #else 40 | 41 | /* Maybe we could change this based on LANG environment variable. */ 42 | 43 | //#define CH_DEGREE "\xc2\xb0" /* UTF-8. */ 44 | 45 | #define CH_DEGREE " " 46 | 47 | #endif 48 | 49 | 50 | 51 | int dw_printf (const char *fmt, ...) 52 | #if __WIN32__ 53 | __attribute__((format(ms_printf,1,2))); /* Win C lib. */ 54 | #else 55 | __attribute__((format(printf,1,2))); /* gnu C lib. */ 56 | #endif 57 | 58 | #endif 59 | -------------------------------------------------------------------------------- /src/tq.h: -------------------------------------------------------------------------------- 1 | 2 | /*------------------------------------------------------------------ 3 | * 4 | * Module: tq.h 5 | * 6 | * Purpose: Transmit queue - hold packets for transmission until the channel is clear. 7 | * 8 | *---------------------------------------------------------------*/ 9 | 10 | #ifndef TQ_H 11 | #define TQ_H 1 12 | 13 | #include "ax25_pad.h" 14 | #include "audio.h" 15 | 16 | #define TQ_NUM_PRIO 2 /* Number of priorities. */ 17 | 18 | #define TQ_PRIO_0_HI 0 19 | #define TQ_PRIO_1_LO 1 20 | 21 | 22 | 23 | void tq_init (struct audio_s *audio_config_p); 24 | 25 | void tq_append (int chan, int prio, packet_t pp); 26 | 27 | void lm_data_request (int chan, int prio, packet_t pp); 28 | 29 | void lm_seize_request (int chan); 30 | 31 | void tq_wait_while_empty (int chan); 32 | 33 | packet_t tq_remove (int chan, int prio); 34 | 35 | packet_t tq_peek (int chan, int prio); 36 | 37 | int tq_count (int chan, int prio, char *source, char *dest, int bytes); 38 | 39 | #endif 40 | 41 | /* end tq.h */ 42 | -------------------------------------------------------------------------------- /src/tt_text.h: -------------------------------------------------------------------------------- 1 | 2 | /* tt_text.h */ 3 | 4 | 5 | /* Encode normal human readable to DTMF representation. */ 6 | 7 | int tt_text_to_multipress (const char *text, int quiet, char *buttons); 8 | 9 | int tt_text_to_two_key (const char *text, int quiet, char *buttons); 10 | 11 | int tt_text_to_call10 (const char *text, int quiet, char *buttons); 12 | 13 | int tt_text_to_mhead (const char *text, int quiet, char *buttons, size_t buttonsiz); 14 | 15 | int tt_text_to_satsq (const char *text, int quiet, char *buttons, size_t buttonsiz); 16 | 17 | int tt_text_to_ascii2d (const char *text, int quiet, char *buttons); 18 | 19 | 20 | /* Decode DTMF to normal human readable form. */ 21 | 22 | int tt_multipress_to_text (const char *buttons, int quiet, char *text); 23 | 24 | int tt_two_key_to_text (const char *buttons, int quiet, char *text); 25 | 26 | int tt_call10_to_text (const char *buttons, int quiet, char *text); 27 | 28 | int tt_call5_suffix_to_text (const char *buttons, int quiet, char *text); 29 | 30 | int tt_mhead_to_text (const char *buttons, int quiet, char *text, size_t textsiz); 31 | 32 | int tt_satsq_to_text (const char *buttons, int quiet, char *text); 33 | 34 | int tt_ascii2d_to_text (const char *buttons, int quiet, char *text); 35 | 36 | 37 | 38 | /* end tt_text.h */ -------------------------------------------------------------------------------- /src/tt_user.h: -------------------------------------------------------------------------------- 1 | 2 | /* tt_user.h */ 3 | 4 | 5 | #include "audio.h" 6 | 7 | void tt_user_init (struct audio_s *p_audio_config, struct tt_config_s *p); 8 | 9 | int tt_user_heard (char *callsign, int ssid, char overlay, char symbol, char *loc_text, double latitude, 10 | double longitude, int ambiguity, char *freq, char *ctcss, char *comment, char mic_e, char *dao); 11 | 12 | int tt_3char_suffix_search (char *suffix, char *callsign); 13 | 14 | void tt_user_background (void); 15 | void tt_user_dump (void); -------------------------------------------------------------------------------- /src/tune.h: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /src/utm2ll.c: -------------------------------------------------------------------------------- 1 | /* UTM to Latitude / Longitude conversion */ 2 | 3 | #include "direwolf.h" 4 | 5 | #include 6 | #include 7 | #include 8 | #include 9 | #include 10 | 11 | #include "utm.h" 12 | #include "mgrs.h" 13 | #include "usng.h" 14 | #include "error_string.h" 15 | 16 | 17 | #define D2R(d) ((d) * M_PI / 180.) 18 | #define R2D(r) ((r) * 180. / M_PI) 19 | 20 | 21 | 22 | 23 | static void usage(); 24 | 25 | 26 | int main (int argc, char *argv[]) 27 | { 28 | double easting; 29 | double northing; 30 | double lat, lon; 31 | char szone[100]; 32 | long lzone; 33 | char *zlet; 34 | char hemi; 35 | long err; 36 | char message[300]; 37 | 38 | 39 | if (argc == 4) { 40 | 41 | // 3 command line arguments for UTM 42 | 43 | strlcpy (szone, argv[1], sizeof(szone)); 44 | lzone = strtoul(szone, &zlet, 10); 45 | 46 | if (*zlet == '\0') { 47 | hemi = 'N'; 48 | } 49 | else { 50 | 51 | if (islower(*zlet)) { 52 | *zlet = toupper(*zlet); 53 | } 54 | if (strchr ("CDEFGHJKLMNPQRSTUVWX", *zlet) == NULL) { 55 | fprintf (stderr, "Latitudinal band must be one of CDEFGHJKLMNPQRSTUVWX.\n\n"); 56 | usage(); 57 | } 58 | if (*zlet >= 'N') { 59 | hemi = 'N'; 60 | } 61 | else { 62 | hemi = 'S'; 63 | } 64 | } 65 | 66 | easting = atof(argv[2]); 67 | 68 | northing = atof(argv[3]); 69 | 70 | err = Convert_UTM_To_Geodetic(lzone, hemi, easting, northing, &lat, &lon); 71 | if (err == 0) { 72 | lat = R2D(lat); 73 | lon = R2D(lon); 74 | 75 | printf ("from UTM, latitude = %.6f, longitude = %.6f\n", lat, lon); 76 | } 77 | else { 78 | 79 | utm_error_string (err, message); 80 | fprintf (stderr, "Conversion from UTM failed:\n%s\n\n", message); 81 | 82 | } 83 | } 84 | else if (argc == 2) { 85 | 86 | // One command line argument, USNG or MGRS. 87 | 88 | // TODO: continue here. 89 | 90 | 91 | err = Convert_USNG_To_Geodetic (argv[1], &lat, &lon); 92 | if (err == 0) { 93 | lat = R2D(lat); 94 | lon = R2D(lon); 95 | printf ("from USNG, latitude = %.6f, longitude = %.6f\n", lat, lon); 96 | } 97 | else { 98 | usng_error_string (err, message); 99 | fprintf (stderr, "Conversion from USNG failed:\n%s\n\n", message); 100 | } 101 | 102 | err = Convert_MGRS_To_Geodetic (argv[1], &lat, &lon); 103 | if (err == 0) { 104 | lat = R2D(lat); 105 | lon = R2D(lon); 106 | printf ("from MGRS, latitude = %.6f, longitude = %.6f\n", lat, lon); 107 | } 108 | else { 109 | mgrs_error_string (err, message); 110 | fprintf (stderr, "Conversion from MGRS failed:\n%s\n\n", message); 111 | } 112 | 113 | } 114 | else { 115 | usage(); 116 | } 117 | 118 | exit (0); 119 | } 120 | 121 | 122 | static void usage (void) 123 | { 124 | fprintf (stderr, "UTM to Latitude / Longitude conversion\n"); 125 | fprintf (stderr, "\n"); 126 | fprintf (stderr, "Usage:\n"); 127 | fprintf (stderr, "\tutm2ll zone easting northing\n"); 128 | fprintf (stderr, "\n"); 129 | fprintf (stderr, "where,\n"); 130 | fprintf (stderr, "\tzone is UTM zone 1 thru 60 with optional latitudinal band.\n"); 131 | fprintf (stderr, "\teasting is x coordinate in meters\n"); 132 | fprintf (stderr, "\tnorthing is y coordinate in meters\n"); 133 | fprintf (stderr, "\n"); 134 | fprintf (stderr, "or:\n"); 135 | fprintf (stderr, "\tutm2ll x\n"); 136 | fprintf (stderr, "\n"); 137 | fprintf (stderr, "where,\n"); 138 | fprintf (stderr, "\tx is USNG or MGRS location.\n"); 139 | fprintf (stderr, "\n"); 140 | fprintf (stderr, "Examples:\n"); 141 | fprintf (stderr, "\tutm2ll 19T 306130 4726010\n"); 142 | fprintf (stderr, "\tutm2ll 19TCH06132600\n"); 143 | 144 | exit (1); 145 | } -------------------------------------------------------------------------------- /src/version.h: -------------------------------------------------------------------------------- 1 | 2 | /* Dire Wolf version 1.6 */ 3 | 4 | // Put in destination field to identify the equipment used. 5 | 6 | #define APP_TOCALL "APDW" // Assigned by WB4APR in tocalls.txt 7 | 8 | // This now comes from compile command line options. 9 | 10 | //#define MAJOR_VERSION 1 11 | //#define MINOR_VERSION 6 12 | //#define EXTRA_VERSION "Beta Test" 13 | 14 | 15 | // For user-defined data format. 16 | // APRS protocol spec Chapter 18 and http://www.aprs.org/aprs11/expfmts.txt 17 | 18 | #define USER_DEF_USER_ID 'D' // user id D for direwolf 19 | 20 | #define USER_DEF_TYPE_AIS 'A' // data type A for AIS NMEA sentence 21 | #define USER_DEF_TYPE_EAS 'E' // data type E for EAS broadcasts 22 | -------------------------------------------------------------------------------- /src/waypoint.h: -------------------------------------------------------------------------------- 1 | 2 | /* 3 | * Name: waypoint.h 4 | */ 5 | 6 | 7 | #include "ax25_pad.h" /* for packet_t */ 8 | 9 | #include "config.h" /* for struct misc_config_s */ 10 | 11 | 12 | void waypoint_init (struct misc_config_s *misc_config); 13 | 14 | void waypoint_set_debug (int n); 15 | 16 | void waypoint_send_sentence (char *wname_in, double dlat, double dlong, char symtab, char symbol, 17 | float alt, float course, float speed, char *comment_in); 18 | 19 | void waypoint_send_ais (char *sentence); 20 | 21 | void waypoint_term (); 22 | 23 | 24 | /* end waypoint.h */ 25 | -------------------------------------------------------------------------------- /src/xid.h: -------------------------------------------------------------------------------- 1 | 2 | 3 | /* xid.h */ 4 | 5 | 6 | #include "ax25_pad.h" // for enum ax25_modulo_e 7 | 8 | 9 | struct xid_param_s { 10 | 11 | int full_duplex; 12 | 13 | // Order is important because negotiation keeps the lower value of 14 | // REJ (srej_none), SREJ (default without negotiation), Multi-SREJ (if both agree). 15 | 16 | enum srej_e { srej_none=0, srej_single=1, srej_multi=2, srej_not_specified=3 } srej; 17 | 18 | enum ax25_modulo_e modulo; 19 | 20 | int i_field_length_rx; /* In bytes. XID has it in bits. */ 21 | 22 | int window_size_rx; 23 | 24 | int ack_timer; /* "T1" in mSec. */ 25 | 26 | int retries; /* "N1" */ 27 | }; 28 | 29 | 30 | int xid_parse (unsigned char *info, int info_len, struct xid_param_s *result, char *desc, int desc_size); 31 | 32 | int xid_encode (struct xid_param_s *param, unsigned char *info, cmdres_t cr); -------------------------------------------------------------------------------- /src/xmit.h: -------------------------------------------------------------------------------- 1 | 2 | 3 | #ifndef XMIT_H 4 | #define XMIT_H 1 5 | 6 | #include "audio.h" /* for struct audio_s */ 7 | 8 | 9 | extern void xmit_init (struct audio_s *p_modem, int debug_xmit_packet); 10 | 11 | extern void xmit_set_txdelay (int channel, int value); 12 | 13 | extern void xmit_set_persist (int channel, int value); 14 | 15 | extern void xmit_set_slottime (int channel, int value); 16 | 17 | extern void xmit_set_txtail (int channel, int value); 18 | 19 | extern void xmit_set_fulldup (int channel, int value); 20 | 21 | 22 | extern int xmit_speak_it (char *script, int c, char *msg); 23 | 24 | #endif 25 | 26 | /* end xmit.h */ 27 | 28 | -------------------------------------------------------------------------------- /systemd/direwolf.logrotate: -------------------------------------------------------------------------------- 1 | /var/log/direwolf/stdout /var/log/direwolf/stderr { 2 | missingok 3 | rotate 30 4 | daily 5 | copytruncate 6 | notifempty 7 | compress 8 | delaycompress 9 | dateext 10 | dateyesterday 11 | } 12 | 13 | /var/log/direwolf/*.log { 14 | missingok 15 | daily 16 | rotate 30 17 | minage 7 18 | maxage 30 19 | compress 20 | } 21 | -------------------------------------------------------------------------------- /systemd/direwolf.service: -------------------------------------------------------------------------------- 1 | [Unit] 2 | Description=Direwolf Sound Card-based AX.25 TNC 3 | After=sound.target 4 | After=network.target 5 | 6 | [Service] 7 | EnvironmentFile=/etc/sysconfig/direwolf 8 | User=direwolf 9 | # You may want to set the audio levels of your radio-connected soundcard 10 | # prior to starting direwolf. To do so, copy this file to /etc/systemd/system/ 11 | # and edit the ExecStartPre line to point to your preferred method of 12 | # doing so. Then run systemctl daemon-reload so systemd uses your updated 13 | # copy of this service file. 14 | #ExecStartPre=/some/script.sh 15 | ExecStart=/bin/bash -ce "exec /usr/bin/direwolf $DIREWOLF_ARGS >>/var/log/direwolf/stdout 2>>/var/log/direwolf/stderr" 16 | Restart=always 17 | StandardOutput=null 18 | StandardError=null 19 | ProtectSystem=strict 20 | ProtectHome=true 21 | ReadWritePaths=/var/log/direwolf 22 | 23 | [Install] 24 | WantedBy=multi-user.target 25 | DefaultInstance=1 26 | 27 | # alternate version: https://www.f4fxl.org/start-direwolf-at-boot-the-systemd-way/ 28 | -------------------------------------------------------------------------------- /systemd/direwolf.sysconfig: -------------------------------------------------------------------------------- 1 | # Set direwolf command line arguments here 2 | DIREWOLF_ARGS="-l /var/log/direwolf -c /etc/direwolf.conf" 3 | -------------------------------------------------------------------------------- /test/scripts/check-fx25: -------------------------------------------------------------------------------- 1 | @CUSTOM_SHELL_SHABANG@ 2 | 3 | @FXSEND_BIN@ 4 | @FXREC_BIN@ 5 | 6 | @GEN_PACKETS_BIN@ -B9600 -n 100 -X 0 -o test96f0.wav 7 | @ATEST_BIN@ -B9600 -F0 -L60 -G64 test96f0.wav 8 | 9 | @GEN_PACKETS_BIN@ -B9600 -n 100 -X 16 -o test96f16.wav 10 | @ATEST_BIN@ -B9600 -F0 -L63 -G67 test96f16.wav 11 | 12 | @GEN_PACKETS_BIN@ -B9600 -n 100 -X 32 -o test96f32.wav 13 | @ATEST_BIN@ -B9600 -F0 -L64 -G68 test96f32.wav 14 | 15 | @GEN_PACKETS_BIN@ -B9600 -n 100 -X 64 -o test96f64.wav 16 | @ATEST_BIN@ -B9600 -F0 -L71 -G75 test96f64.wav 17 | -------------------------------------------------------------------------------- /test/scripts/check-il2p: -------------------------------------------------------------------------------- 1 | @CUSTOM_SHELL_SHABANG@ 2 | 3 | @IL2P_TEST_BIN@ 4 | 5 | -------------------------------------------------------------------------------- /test/scripts/check-modem1200: -------------------------------------------------------------------------------- 1 | @CUSTOM_SHELL_SHABANG@ 2 | 3 | @GEN_PACKETS_BIN@ -n 100 -o test12.wav 4 | @ATEST_BIN@ -F0 -PA -D1 -L66 -G72 test12.wav 5 | @ATEST_BIN@ -F1 -PA -D1 -L72 -G78 test12.wav 6 | @ATEST_BIN@ -F0 -PB -D1 -L66 -G74 test12.wav 7 | @ATEST_BIN@ -F1 -PB -D1 -L70 -G82 test12.wav 8 | -------------------------------------------------------------------------------- /test/scripts/check-modem1200-i: -------------------------------------------------------------------------------- 1 | @CUSTOM_SHELL_SHABANG@ 2 | 3 | @GEN_PACKETS_BIN@ -I1 -n 100 -o test12-il2p.wav 4 | @ATEST_BIN@ -P+ -D1 -L92 -G94 test12-il2p.wav 5 | -------------------------------------------------------------------------------- /test/scripts/check-modem19200: -------------------------------------------------------------------------------- 1 | @CUSTOM_SHELL_SHABANG@ 2 | 3 | @GEN_PACKETS_BIN@ -r 96000 -B19200 -a 170 -o test19.wav 4 | @ATEST_BIN@ -B19200 -F0 -L4 test19.wav 5 | @GEN_PACKETS_BIN@ -r 96000 -B19200 -n 100 -o test19.wav 6 | @ATEST_BIN@ -B19200 -F0 -L60 -G66 test19.wav 7 | @ATEST_BIN@ -B19200 -F1 -L64 -G69 test19.wav 8 | -------------------------------------------------------------------------------- /test/scripts/check-modem2400-a: -------------------------------------------------------------------------------- 1 | @CUSTOM_SHELL_SHABANG@ 2 | 3 | @GEN_PACKETS_BIN@ -B2400 -j -n 100 -o test24-a.wav 4 | @ATEST_BIN@ -B2400 -j -F0 -L76 -G83 test24-a.wav 5 | @ATEST_BIN@ -B2400 -j -F1 -L84 -G89 test24-a.wav 6 | -------------------------------------------------------------------------------- /test/scripts/check-modem2400-b: -------------------------------------------------------------------------------- 1 | @CUSTOM_SHELL_SHABANG@ 2 | 3 | @GEN_PACKETS_BIN@ -B2400 -J -n 100 -o test24-b.wav 4 | @ATEST_BIN@ -B2400 -J -F0 -L81 -G88 test24-b.wav 5 | @ATEST_BIN@ -B2400 -J -F1 -L86 -G90 test24-b.wav 6 | -------------------------------------------------------------------------------- /test/scripts/check-modem2400-g: -------------------------------------------------------------------------------- 1 | @CUSTOM_SHELL_SHABANG@ 2 | 3 | @GEN_PACKETS_BIN@ -B2400 -g -n 100 -o test24-g.wav 4 | @ATEST_BIN@ -B2400 -g -F0 -L99 -G101 test24-g.wav 5 | -------------------------------------------------------------------------------- /test/scripts/check-modem300: -------------------------------------------------------------------------------- 1 | @CUSTOM_SHELL_SHABANG@ 2 | 3 | @GEN_PACKETS_BIN@ -B300 -n 100 -o test3.wav 4 | @ATEST_BIN@ -B300 -PA -F0 -L65 -G71 test3.wav 5 | @ATEST_BIN@ -B300 -PA -F1 -L69 -G75 test3.wav 6 | @ATEST_BIN@ -B300 -PB -F0 -L69 -G75 test3.wav 7 | @ATEST_BIN@ -B300 -PB -F1 -L73 -G79 test3.wav 8 | -------------------------------------------------------------------------------- /test/scripts/check-modem4800: -------------------------------------------------------------------------------- 1 | @CUSTOM_SHELL_SHABANG@ 2 | 3 | @GEN_PACKETS_BIN@ -B4800 -n 100 -o test48.wav 4 | @ATEST_BIN@ -B4800 -F0 -L68 -G74 test48.wav 5 | @ATEST_BIN@ -B4800 -F1 -L72 -G84 test48.wav 6 | -------------------------------------------------------------------------------- /test/scripts/check-modem9600: -------------------------------------------------------------------------------- 1 | @CUSTOM_SHELL_SHABANG@ 2 | 3 | @GEN_PACKETS_BIN@ -B9600 -a 170 -o test96.wav 4 | @ATEST_BIN@ -B9600 -F0 -L4 -G4 test96.wav 5 | @GEN_PACKETS_BIN@ -B9600 -n 100 -o test96.wav 6 | @ATEST_BIN@ -B9600 -F0 -L61 -G65 test96.wav 7 | @ATEST_BIN@ -B9600 -F1 -L62 -G66 test96.wav 8 | -------------------------------------------------------------------------------- /test/scripts/check-modem9600-i: -------------------------------------------------------------------------------- 1 | @CUSTOM_SHELL_SHABANG@ 2 | 3 | @GEN_PACKETS_BIN@ -B9600 -I1 -n 100 -o test96-il2p-I1.wav 4 | @ATEST_BIN@ -B9600 -L72 -G76 test96-il2p-I1.wav 5 | @ATEST_BIN@ -B9600 -P+ -L76 -G80 test96-il2p-I1.wav 6 | 7 | @GEN_PACKETS_BIN@ -B9600 -I0 -n 100 -o test96-il2p-I0.wav 8 | @ATEST_BIN@ -B9600 -L64 -G68 test96-il2p-I0.wav 9 | 10 | 11 | @GEN_PACKETS_BIN@ -B9600 -i1 -n 100 -o test96-il2p-i1.wav 12 | @ATEST_BIN@ -B9600 -L70 -G74 test96-il2p-i1.wav 13 | @ATEST_BIN@ -B9600 -P+ -L73 -G77 test96-il2p-i1.wav 14 | 15 | @GEN_PACKETS_BIN@ -B9600 -i0 -n 100 -o test96-il2p-i0.wav 16 | @ATEST_BIN@ -B9600 -L67 -G71 test96-il2p-i0.wav 17 | 18 | 19 | -------------------------------------------------------------------------------- /test/scripts/check-modemeas: -------------------------------------------------------------------------------- 1 | @CUSTOM_SHELL_SHABANG@ 2 | 3 | @GEN_PACKETS_BIN@ -B EAS -o testeas.wav 4 | @ATEST_BIN@ -B EAS -L 6 -G 6 testeas.wav 5 | -------------------------------------------------------------------------------- /tnc-test-cd-results.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wb2osz/direwolf/390d4a8c2733565748cb85c96d0bcdf2562807cb/tnc-test-cd-results.png --------------------------------------------------------------------------------