mirror of https://github.com/wb2osz/direwolf.git
Compare commits
519 Commits
Author | SHA1 | Date |
---|---|---|
|
390d4a8c27 | |
|
69407ccf84 | |
|
41e7851376 | |
|
c5c7d4a44d | |
|
e7b4650935 | |
|
21048d5d1a | |
|
3aa8097461 | |
|
3f3fed216b | |
|
9ae4edcabf | |
|
7935054ee3 | |
|
c499496bbc | |
|
0a1670f7c2 | |
|
7552105282 | |
|
de293a1f25 | |
|
2260df15a5 | |
|
6ed85d12b1 | |
|
62e4566cc9 | |
|
9807304d63 | |
|
091670a917 | |
|
7b9325ecb6 | |
|
fae30a6035 | |
|
786e43322f | |
|
34ba203532 | |
|
88e2222db6 | |
|
6b76e1d98d | |
|
6bd296bd7e | |
|
ab834f338b | |
|
3c73a6b2b2 | |
|
877d1c7707 | |
|
ba0313ca78 | |
|
a08d0939b5 | |
|
7a8e4320ac | |
|
a87b72e040 | |
|
2434e5f13b | |
|
dfc063f905 | |
|
80bbf5a553 | |
|
790c8ab723 | |
|
9d2ded2eec | |
|
c5ad945c3c | |
|
fed79a7978 | |
|
e84a622515 | |
|
f9cf42b291 | |
|
4008153334 | |
|
d6ae84daad | |
|
415a08da1e | |
|
a3d3143d21 | |
|
e53fa0c110 | |
|
0058145eff | |
|
b1b3e854be | |
|
577b2b3cf2 | |
|
f8b9cae461 | |
|
92a2097d30 | |
|
24a06aef9e | |
|
b1727345e0 | |
|
8e32286604 | |
|
8000e46c02 | |
|
5fb4081c86 | |
|
110b85a781 | |
|
4ac666df6a | |
|
4cd63df5be | |
|
75ccf181f9 | |
|
019ff3bda6 | |
|
11468f26f8 | |
|
eb813e5804 | |
|
7573f996c4 | |
|
dbb4777ba7 | |
|
cac83f2506 | |
|
b4b7b1388d | |
|
8a978876bd | |
|
8cb73d2507 | |
|
c25629a286 | |
|
8e289025d7 | |
|
04ecdbc6fc | |
|
0f92f463f4 | |
|
fedfef92cd | |
|
031c937cdb | |
|
ef573f2acf | |
|
399ffcccb3 | |
|
9553abc28e | |
|
1d452fe1ab | |
|
17d3d0a621 | |
|
07ea828c28 | |
|
397362787f | |
|
8913a852fd | |
|
d0fc24aa5d | |
|
acace8cd9a | |
|
429d095665 | |
|
30869c7afc | |
|
d11bd6f3f2 | |
|
59288b7c56 | |
|
c9ffbd71c3 | |
|
f97c024a90 | |
|
722fefbda6 | |
|
18c65f48a8 | |
|
368bc42337 | |
|
06d6cabb58 | |
|
3dd125e1e3 | |
|
a558348635 | |
|
7d3c1d100e | |
|
bb16c725b9 | |
|
0bd31ae16e | |
|
e108147655 | |
|
4f6ca0d389 | |
|
27019b4793 | |
|
26727bbace | |
|
89021dd50c | |
|
dcabb8f7a5 | |
|
0f2b241763 | |
|
366e0ab6e0 | |
|
42314b7219 | |
|
5dbe2ce136 | |
|
65869bc643 | |
|
eef35cf891 | |
|
45cd680b90 | |
|
9b9744ba15 | |
|
049614d16c | |
|
6442466a5d | |
|
9016fa5fe6 | |
|
53e9ff7908 | |
|
17b9336ce0 | |
|
8619b74c7b | |
|
023f675caa | |
|
3220931439 | |
|
1712fbcfb9 | |
|
b77762780f | |
|
257d2e3544 | |
|
1b3ed76584 | |
|
edc5707cfe | |
|
d10ccb6cc0 | |
|
6bfd22811c | |
|
b66c21d39b | |
|
6370b26d85 | |
|
0e68a7712a | |
|
73d5d139b4 | |
|
12de518fa9 | |
|
44df4a7612 | |
|
7fa91dd551 | |
|
09de2f6681 | |
|
e449e39d4d | |
|
0c285a0c6d | |
|
c18b562409 | |
|
677117bff0 | |
|
04b32c41c2 | |
|
a1afcbbafe | |
|
667e9caaf2 | |
|
7ac1262fdf | |
|
8683ddcbd6 | |
|
fe6cba2b0d | |
|
a30f90956b | |
|
81447ed49f | |
|
6513efd052 | |
|
5d02e0ba0e | |
|
14d6eed205 | |
|
6f95752cab | |
|
085e837a26 | |
|
1cad6edb42 | |
|
8bca4862b0 | |
|
52e3a5b3af | |
|
1d67b44669 | |
|
feb1034cca | |
|
042a0c44ed | |
|
07fdc7544f | |
|
c1e19601f5 | |
|
9922f176b2 | |
|
fdf660a7f1 | |
|
791982a5e4 | |
|
adebd06a05 | |
|
48b9bac872 | |
|
e272ff87c8 | |
|
714d03f1d8 | |
|
8ac14f86f5 | |
|
a20728762b | |
|
4a1aa2b148 | |
|
413855e791 | |
|
bfc708d014 | |
|
37f148ef25 | |
|
7cd027fcda | |
|
512e8f88a9 | |
|
fb888577fb | |
|
91bc2d9627 | |
|
e8f1133226 | |
|
79d80ccb8e | |
|
3960942488 | |
|
3a5f72acab | |
|
ff34d92776 | |
|
3a6a35785f | |
|
a10c2175fe | |
|
fda6f52437 | |
|
b12e56fef4 | |
|
3e4c28231a | |
|
c0fc5f052d | |
|
adae04b05f | |
|
7d4a49aecb | |
|
f0bd085a13 | |
|
0775e4b6a2 | |
|
0ed3cd2863 | |
|
96fdf71069 | |
|
909b703b7e | |
|
4b0395aeaf | |
|
d747620257 | |
|
74cf91cc98 | |
|
e2b32d1d2a | |
|
5fd8120de7 | |
|
e9482ca0b2 | |
|
45136a91eb | |
|
0edb44efc3 | |
|
6be428bea1 | |
|
dc40b461d0 | |
|
0661e23f21 | |
|
74a5c34a94 | |
|
b99f9f33c2 | |
|
3135bb570b | |
|
f293186403 | |
|
b41b4445fb | |
|
0dc7cba1c5 | |
|
65d8d265cd | |
|
c15903edb9 | |
|
e654ca46a6 | |
|
45cad0ff78 | |
|
cab47cfc48 | |
|
1484350465 | |
|
fde5bf6816 | |
|
e54b851633 | |
|
c2b231494a | |
|
7e44139eb3 | |
|
4e816f8f8d | |
|
033d509920 | |
|
63b78c9fae | |
|
1f2a5cfdb8 | |
|
f08ed518b3 | |
|
2d4a8f4907 | |
|
d5cec4dc84 | |
|
ff9eca682e | |
|
b382e5fb0f | |
|
249f5bd471 | |
|
747224ce57 | |
|
03939d25ba | |
|
6e92a4fa48 | |
|
362d19e073 | |
|
f73faec0b5 | |
|
690ed3e1d6 | |
|
c94628f547 | |
|
4444d3be5f | |
|
4de597a89e | |
|
1cf5a22333 | |
|
1ab26c66e2 | |
|
8fd4bebf45 | |
|
8cd1f87ef6 | |
|
184b2af329 | |
|
0e5049c08a | |
|
de98f26229 | |
|
6f8ac80afd | |
|
d06b644630 | |
|
df22522126 | |
|
a1c16a67ef | |
|
bc582cf24f | |
|
8c9741b3e4 | |
|
e35964ec98 | |
|
05828dc65f | |
|
edafba9fe6 | |
|
d9d6bb4257 | |
|
a7a84269fc | |
|
29c48ddcc8 | |
|
69fc783a17 | |
|
357f2e633c | |
|
316c8d8194 | |
|
3765f26554 | |
|
10ad90b3db | |
|
e6c721a58d | |
|
37cb5440a6 | |
|
c72d06c285 | |
|
e219426a37 | |
|
c59053536e | |
|
edaf661bb1 | |
|
e0c2c31181 | |
|
ca7db91da2 | |
|
e962246fd2 | |
|
342989b100 | |
|
ce6c617203 | |
|
742d046c40 | |
|
698ca1ea87 | |
|
4c5004b6a1 | |
|
90921b9376 | |
|
a32064571d | |
|
b37fda96fb | |
|
ad12fa86d6 | |
|
d6ea439f98 | |
|
a5f3de2222 | |
|
a4d87e4013 | |
|
7fc9f31fbc | |
|
d828a8abe3 | |
|
aea1eb7b41 | |
|
c559f0d443 | |
|
792569b991 | |
|
8a2138e16b | |
|
bfa7f4af93 | |
|
a1e2d1c3a8 | |
|
d0cad72955 | |
|
7b5fc163dc | |
|
f1b54df647 | |
|
71b3ca0047 | |
|
2d3a04d0f1 | |
|
ab3796905e | |
|
e3dc8bbf1b | |
|
c7dcfd141e | |
|
a46471bf36 | |
|
1a2de05e71 | |
|
07f2174be4 | |
|
08a691a02d | |
|
a5211f48fb | |
|
41a85d87a7 | |
|
e1a4716857 | |
|
ab40b1169e | |
|
ecf5fd1d59 | |
|
c13375a9ab | |
|
84efe8c59b | |
|
91d5b90e2a | |
|
a200f3da7e | |
|
b915842c9f | |
|
9eaf9e361c | |
|
20f9e15b8b | |
|
79df808d5d | |
|
c5526524b6 | |
|
4590e21934 | |
|
c0abb4b216 | |
|
da0a33ef2a | |
|
e0fcdb8835 | |
|
9a98aed96e | |
|
9665fa845b | |
|
331b5774f9 | |
|
11071bb06a | |
|
be705987e2 | |
|
f864874771 | |
|
220e7dd1c4 | |
|
4ecaf478cf | |
|
38ab57afa4 | |
|
22f645756d | |
|
e51002ac0c | |
|
6874a5d897 | |
|
8280971f55 | |
|
4814011498 | |
|
b40d3fa134 | |
|
49ea703af1 | |
|
09a984a790 | |
|
995fc89866 | |
|
182713f423 | |
|
4c6babebd0 | |
|
99d4d904b2 | |
|
2328ecdf55 | |
|
5e9d67834b | |
|
95c302566a | |
|
db4c07a2b1 | |
|
fa7d3bce47 | |
|
26599ec771 | |
|
c41841e859 | |
|
d8e9273403 | |
|
34aa3f84ea | |
|
2ac99a33dd | |
|
9febac9696 | |
|
78283e1991 | |
|
6ffef6ed52 | |
|
9cd305950f | |
|
3611971fe7 | |
|
37179479ca | |
|
50c5542f78 | |
|
5b00875549 | |
|
22c810e442 | |
|
f7742cf044 | |
|
2c11ac2476 | |
|
1740a04754 | |
|
656b1413db | |
|
590c82b040 | |
|
b81de60aec | |
|
5cb6e04c54 | |
|
9c2b8f9b1a | |
|
c9734c2bf7 | |
|
f6c0049e40 | |
|
59d6708698 | |
|
8047bebce3 | |
|
7efe0ab40b | |
|
33a34f3466 | |
|
c23ab04338 | |
|
cc84a610dd | |
|
753e619efa | |
|
c904b57d1d | |
|
6e34b5f472 | |
|
c0e135aa07 | |
|
30c52862a9 | |
|
00cdf7b18d | |
|
9d2c993f49 | |
|
678b09df3f | |
|
0dbb376129 | |
|
eb0da22067 | |
|
72470992aa | |
|
3a496aa566 | |
|
9e940b0b5a | |
|
ee2805a307 | |
|
a6f0ad5af7 | |
|
9cab65c8d7 | |
|
d8913f0dbe | |
|
b7ee6dc9c1 | |
|
facdfb9e19 | |
|
8c4c186730 | |
|
c7c60c4a35 | |
|
7fcee202ba | |
|
52927ce54a | |
|
647d698656 | |
|
ed67bdfd84 | |
|
4f4583dc37 | |
|
ebdc124a07 | |
|
c9f846becb | |
|
0da1a9176a | |
|
979fdf1767 | |
|
f358c621d0 | |
|
77f4eb4543 | |
|
4973ae8490 | |
|
1a0217ec19 | |
|
be7ee8211e | |
|
3ce981c196 | |
|
e2324f2e78 | |
|
e8f06d22a7 | |
|
7ef0b17687 | |
|
fa5627801b | |
|
cd564ae398 | |
|
cf55b774e6 | |
|
0da8a46add | |
|
a3e6f73cbb | |
|
bef8a97323 | |
|
23ea24641d | |
|
612c2dc928 | |
|
15b0f59e3a | |
|
607ae3be4d | |
|
c58b689433 | |
|
60fe31c6fc | |
|
9d2fbdd3f7 | |
|
433b283b0f | |
|
6b3c8a6a0d | |
|
aa28c9cadc | |
|
7f77b29e89 | |
|
2fec597581 | |
|
b6254da203 | |
|
785c8deffa | |
|
6be16ab3c8 | |
|
67b11d4922 | |
|
58c2707f7d | |
|
dc292ffcc9 | |
|
ded9a7842c | |
|
91839bcb1a | |
|
6207e2eb3e | |
|
02dbfcad2d | |
|
74ac4812d5 | |
|
3516de7f6a | |
|
40047e91d9 | |
|
01857c196e | |
|
200f669bbc | |
|
7a88785fad | |
|
d85abe214f | |
|
11e9e18e97 | |
|
2a08f33966 | |
|
b2548ec58f | |
|
6a3b1faf99 | |
|
3e9118ba17 | |
|
8509fe58ff | |
|
48aeb43829 | |
|
209a858a6a | |
|
4f1918c3af | |
|
ccae7529bf | |
|
8b9c6fcf4a | |
|
77a3b50eb8 | |
|
b35a674204 | |
|
8162648e57 | |
|
958f210843 | |
|
17e1166a7f | |
|
1f8b330185 | |
|
ce9eebf273 | |
|
5920ecda51 | |
|
35c3c29cc4 | |
|
283b768125 | |
|
28eda74485 | |
|
7125b5b22f | |
|
c6bff39a30 | |
|
7da6f7956b | |
|
f1f41b7ed1 | |
|
d491f51ce9 | |
|
12cb9108d7 | |
|
87d9fe00b8 | |
|
107a8125c7 | |
|
4406c1a5e3 | |
|
0c496541e5 | |
|
2424812883 | |
|
dc9bc8d90b | |
|
6d836c1faf | |
|
169bad18d1 | |
|
78b75e88fd | |
|
d6bf8102bf | |
|
d653a534c4 | |
|
b104f097e0 | |
|
b68039d2c6 | |
|
178375f3ba | |
|
95c22986ec | |
|
1053bc483f | |
|
d9ca8cdc52 | |
|
979385a78e | |
|
ebacfea517 | |
|
64f9313f77 | |
|
1376c0c2fb | |
|
80a1c182a2 | |
|
4c60979844 | |
|
565fa4c082 | |
|
b14f1d0ff2 | |
|
dd27f9960b | |
|
558315fe19 | |
|
569136e19c | |
|
a8114691b3 | |
|
a7391b4999 | |
|
01371079e2 | |
|
1646be7def | |
|
8b81a3226f | |
|
b5d1d1c3dd |
|
@ -15,3 +15,27 @@
|
|||
*.PDF diff=astextplain
|
||||
*.rtf diff=astextplain
|
||||
*.RTF diff=astextplain
|
||||
|
||||
# My rules to remove any doubt
|
||||
|
||||
*.c text
|
||||
*.cpp text
|
||||
*.h text
|
||||
*.pl text
|
||||
*.py text
|
||||
*.sh text
|
||||
*.txt text
|
||||
*.desktop text
|
||||
*.conf text
|
||||
*.rc text
|
||||
*.spec text
|
||||
*.bat text
|
||||
*.1 text
|
||||
*.md text
|
||||
COPYING text
|
||||
Makefile* text
|
||||
README* text
|
||||
|
||||
*.ico binary
|
||||
*.png binary
|
||||
|
||||
|
|
|
@ -0,0 +1,162 @@
|
|||
name: 'build direwolf'
|
||||
|
||||
on:
|
||||
# permit to manually trigger the CI
|
||||
workflow_dispatch:
|
||||
inputs:
|
||||
cmake_flags:
|
||||
description: 'Custom CMAKE flags'
|
||||
required: false
|
||||
push:
|
||||
paths-ignore:
|
||||
- '.github/**'
|
||||
pull_request:
|
||||
paths-ignore:
|
||||
- '.github/**'
|
||||
|
||||
jobs:
|
||||
build:
|
||||
name: ${{ matrix.config.name }}
|
||||
runs-on: ${{ matrix.config.os }}
|
||||
strategy:
|
||||
fail-fast: false
|
||||
matrix:
|
||||
config:
|
||||
- {
|
||||
name: 'Windows Latest MinGW 64bit',
|
||||
os: windows-latest,
|
||||
cc: 'x86_64-w64-mingw32-gcc',
|
||||
cxx: 'x86_64-w64-mingw32-g++',
|
||||
ar: 'x86_64-w64-mingw32-ar',
|
||||
windres: 'x86_64-w64-mingw32-windres',
|
||||
arch: 'x86_64',
|
||||
build_type: 'Release',
|
||||
cmake_extra_flags: '-G "MinGW Makefiles"'
|
||||
}
|
||||
- {
|
||||
name: 'Windows 2019 MinGW 32bit',
|
||||
os: windows-2019,
|
||||
cc: 'i686-w64-mingw32-gcc',
|
||||
cxx: 'i686-w64-mingw32-g++',
|
||||
ar: 'i686-w64-mingw32-ar',
|
||||
windres: 'i686-w64-mingw32-windres',
|
||||
arch: 'i686',
|
||||
build_type: 'Release',
|
||||
cmake_extra_flags: '-G "MinGW Makefiles"'
|
||||
}
|
||||
- {
|
||||
name: 'macOS latest',
|
||||
os: macos-latest,
|
||||
cc: 'clang',
|
||||
cxx: 'clang++',
|
||||
arch: 'x86_64',
|
||||
build_type: 'Release',
|
||||
cmake_extra_flags: ''
|
||||
}
|
||||
- {
|
||||
name: 'Ubuntu latest Debug',
|
||||
os: ubuntu-latest,
|
||||
cc: 'gcc',
|
||||
cxx: 'g++',
|
||||
arch: 'x86_64',
|
||||
build_type: 'Debug',
|
||||
cmake_extra_flags: ''
|
||||
}
|
||||
- {
|
||||
name: 'Ubuntu 22.04',
|
||||
os: ubuntu-22.04,
|
||||
cc: 'gcc',
|
||||
cxx: 'g++',
|
||||
arch: 'x86_64',
|
||||
build_type: 'Release',
|
||||
cmake_extra_flags: ''
|
||||
}
|
||||
- {
|
||||
name: 'Ubuntu 20.04',
|
||||
os: ubuntu-20.04,
|
||||
cc: 'gcc',
|
||||
cxx: 'g++',
|
||||
arch: 'x86_64',
|
||||
build_type: 'Release',
|
||||
cmake_extra_flags: ''
|
||||
}
|
||||
|
||||
steps:
|
||||
- name: checkout
|
||||
uses: actions/checkout@v2
|
||||
with:
|
||||
fetch-depth: 8
|
||||
- name: dependency
|
||||
shell: bash
|
||||
run: |
|
||||
# this is not perfect but enought for now
|
||||
if [ "$RUNNER_OS" == "Linux" ]; then
|
||||
sudo apt-get update
|
||||
sudo apt-get install libasound2-dev libudev-dev libhamlib-dev gpsd
|
||||
elif [ "$RUNNER_OS" == "macOS" ]; then
|
||||
# just to simplify I use homebrew but
|
||||
# we can use macports (latest direwolf is already available as port)
|
||||
brew install portaudio hamlib gpsd
|
||||
elif [ "$RUNNER_OS" == "Windows" ]; then
|
||||
# add the folder to PATH
|
||||
echo "C:\msys64\mingw32\bin" >> $GITHUB_PATH
|
||||
fi
|
||||
- name: create build environment
|
||||
run: |
|
||||
cmake -E make_directory ${{github.workspace}}/build
|
||||
- name: configure
|
||||
shell: bash
|
||||
working-directory: ${{github.workspace}}/build
|
||||
run: |
|
||||
if [ "$RUNNER_OS" == "Windows" ]; then
|
||||
export CC=${{ matrix.config.cc }}
|
||||
export CXX=${{ matrix.config.cxx }}
|
||||
export AR=${{ matrix.config.ar }}
|
||||
export WINDRES=${{ matrix.config.windres }}
|
||||
fi
|
||||
cmake $GITHUB_WORKSPACE \
|
||||
-DCMAKE_BUILD_TYPE=${{ matrix.config.build_type }} \
|
||||
-DCMAKE_C_COMPILER=${{ matrix.config.cc }} \
|
||||
-DCMAKE_CXX_COMPILER=${{ matrix.config.cxx }} \
|
||||
-DCMAKE_CXX_FLAGS="-Werror" -DUNITTEST=1 \
|
||||
${{ matrix.config.cmake_extra_flags }} \
|
||||
${{ github.event.inputs.cmake_flags }}
|
||||
- name: build
|
||||
shell: bash
|
||||
working-directory: ${{github.workspace}}/build
|
||||
run: |
|
||||
if [ "$RUNNER_OS" == "Windows" ]; then
|
||||
export CC=${{ matrix.config.cc }}
|
||||
export CXX=${{ matrix.config.cxx }}
|
||||
export AR=${{ matrix.config.ar }}
|
||||
export WINDRES=${{ matrix.config.windres }}
|
||||
fi
|
||||
cmake --build . --config ${{ matrix.config.build_type }} \
|
||||
${{ github.event.inputs.cmake_flags }}
|
||||
- name: test
|
||||
continue-on-error: true
|
||||
shell: bash
|
||||
working-directory: ${{github.workspace}}/build
|
||||
run: |
|
||||
ctest -C ${{ matrix.config.build_type }} \
|
||||
--parallel 2 --output-on-failure \
|
||||
${{ github.event.inputs.cmake_flags }}
|
||||
- name: package
|
||||
shell: bash
|
||||
working-directory: ${{github.workspace}}/build
|
||||
run: |
|
||||
if [ "$RUNNER_OS" == "Windows" ] || [ "$RUNNER_OS" == "macOS" ]; then
|
||||
make package
|
||||
fi
|
||||
- name: archive binary
|
||||
uses: actions/upload-artifact@v4
|
||||
with:
|
||||
name: direwolf_${{ matrix.config.os }}_${{ matrix.config.arch }}_${{ github.sha }}
|
||||
path: |
|
||||
${{github.workspace}}/build/direwolf-*.zip
|
||||
${{github.workspace}}/build/direwolf.conf
|
||||
${{github.workspace}}/build/src/*
|
||||
${{github.workspace}}/build/CMakeCache.txt
|
||||
!${{github.workspace}}/build/src/cmake_install.cmake
|
||||
!${{github.workspace}}/build/src/CMakeFiles
|
||||
!${{github.workspace}}/build/src/Makefile
|
|
@ -0,0 +1,64 @@
|
|||
# For most projects, this workflow file will not need changing; you simply need
|
||||
# to commit it to your repository.
|
||||
#
|
||||
# You may wish to alter this file to override the set of languages analyzed,
|
||||
# or to provide custom queries or build logic.
|
||||
#
|
||||
# ******** NOTE ********
|
||||
# We have attempted to detect the languages in your repository. Please check
|
||||
# the `language` matrix defined below to confirm you have the correct set of
|
||||
# supported CodeQL languages.
|
||||
#
|
||||
name: "CodeQL - Python"
|
||||
|
||||
on:
|
||||
push:
|
||||
branches: [ dev ]
|
||||
pull_request:
|
||||
# The branches below must be a subset of the branches above
|
||||
branches: [ dev ]
|
||||
schedule:
|
||||
- cron: '25 8 * * 4'
|
||||
|
||||
jobs:
|
||||
analyze:
|
||||
name: Analyze
|
||||
runs-on: ubuntu-latest
|
||||
permissions:
|
||||
actions: read
|
||||
contents: read
|
||||
security-events: write
|
||||
|
||||
strategy:
|
||||
fail-fast: false
|
||||
matrix:
|
||||
language: [ 'python' ]
|
||||
# CodeQL supports [ 'cpp', 'csharp', 'go', 'java', 'javascript', 'python', 'ruby' ]
|
||||
# Learn more about CodeQL language support at https://git.io/codeql-language-support
|
||||
|
||||
steps:
|
||||
- name: Checkout repository
|
||||
uses: actions/checkout@v3
|
||||
|
||||
# Initializes the CodeQL tools for scanning.
|
||||
- name: Initialize CodeQL
|
||||
uses: github/codeql-action/init@v3
|
||||
with:
|
||||
languages: ${{ matrix.language }}
|
||||
setup-python-dependencies: true
|
||||
# If you wish to specify custom queries, you can do so here or in a config file.
|
||||
# By default, queries listed here will override any specified in a config file.
|
||||
# Prefix the list here with "+" to use these queries and those in the config file.
|
||||
# queries: ./path/to/local/query, your-org/your-repo/queries@main
|
||||
|
||||
# Autobuild attempts to build any compiled languages (C/C++, C#, or Java).
|
||||
# If this step fails, then you should remove it and run the build manually (see below)
|
||||
- name: Autobuild
|
||||
uses: github/codeql-action/autobuild@v3
|
||||
|
||||
# ℹ️ Command-line programs to run using the OS shell.
|
||||
# 📚 https://git.io/JvXDl
|
||||
|
||||
|
||||
- name: Perform CodeQL Analysis
|
||||
uses: github/codeql-action/analyze@v3
|
|
@ -0,0 +1,74 @@
|
|||
# For most projects, this workflow file will not need changing; you simply need
|
||||
# to commit it to your repository.
|
||||
#
|
||||
# You may wish to alter this file to override the set of languages analyzed,
|
||||
# or to provide custom queries or build logic.
|
||||
#
|
||||
# ******** NOTE ********
|
||||
# We have attempted to detect the languages in your repository. Please check
|
||||
# the `language` matrix defined below to confirm you have the correct set of
|
||||
# supported CodeQL languages.
|
||||
#
|
||||
name: "CodeQL - CPP"
|
||||
|
||||
on:
|
||||
push:
|
||||
branches: [ dev ]
|
||||
pull_request:
|
||||
# The branches below must be a subset of the branches above
|
||||
branches: [ dev ]
|
||||
schedule:
|
||||
- cron: '25 8 * * 4'
|
||||
|
||||
jobs:
|
||||
analyze:
|
||||
name: Analyze
|
||||
runs-on: ubuntu-latest
|
||||
permissions:
|
||||
actions: read
|
||||
contents: read
|
||||
security-events: write
|
||||
|
||||
strategy:
|
||||
fail-fast: false
|
||||
matrix:
|
||||
language: [ 'cpp' ]
|
||||
# CodeQL supports [ 'cpp', 'csharp', 'go', 'java', 'javascript', 'python', 'ruby' ]
|
||||
# Learn more about CodeQL language support at https://git.io/codeql-language-support
|
||||
|
||||
steps:
|
||||
- name: Checkout repository
|
||||
uses: actions/checkout@v3
|
||||
|
||||
# Initializes the CodeQL tools for scanning.
|
||||
- name: Initialize CodeQL
|
||||
uses: github/codeql-action/init@v3
|
||||
with:
|
||||
languages: ${{ matrix.language }}
|
||||
setup-python-dependencies: true
|
||||
# If you wish to specify custom queries, you can do so here or in a config file.
|
||||
# By default, queries listed here will override any specified in a config file.
|
||||
# Prefix the list here with "+" to use these queries and those in the config file.
|
||||
# queries: ./path/to/local/query, your-org/your-repo/queries@main
|
||||
|
||||
# Autobuild attempts to build any compiled languages (C/C++, C#, or Java).
|
||||
# If this step fails, then you should remove it and run the build manually (see below)
|
||||
- name: Autobuild
|
||||
uses: github/codeql-action/autobuild@v3
|
||||
|
||||
# ℹ️ Command-line programs to run using the OS shell.
|
||||
# 📚 https://git.io/JvXDl
|
||||
|
||||
# ✏️ If the Autobuild fails above, remove it and uncomment the following three lines
|
||||
# and modify them (or add more) to build your code if your project
|
||||
# uses a compiled language
|
||||
|
||||
- run: |
|
||||
mkdir build
|
||||
cd build
|
||||
cmake -DUNITTEST=1 ..
|
||||
make
|
||||
make test
|
||||
|
||||
- name: Perform CodeQL Analysis
|
||||
uses: github/codeql-action/analyze@v3
|
|
@ -6,6 +6,8 @@ z*
|
|||
*~
|
||||
*.xlsx
|
||||
*.stackdump
|
||||
*.wav
|
||||
|
||||
|
||||
# Object files
|
||||
*.o
|
||||
|
@ -37,6 +39,26 @@ z*
|
|||
*.x86_64
|
||||
*.hex
|
||||
|
||||
# Binaries, other build results
|
||||
|
||||
aclients
|
||||
atest
|
||||
decode_aprs
|
||||
direwolf
|
||||
gen_fff
|
||||
gen_packets
|
||||
ll2utm
|
||||
log2gpx
|
||||
text2tt
|
||||
tt2text
|
||||
ttcalc
|
||||
utm2ll
|
||||
|
||||
direwolf.conf
|
||||
fsk_fast_filter.h
|
||||
direwolf.desktop
|
||||
|
||||
|
||||
# =========================
|
||||
# Operating System Files
|
||||
# =========================
|
||||
|
@ -83,3 +105,9 @@ $RECYCLE.BIN/
|
|||
|
||||
# Windows shortcuts
|
||||
*.lnk
|
||||
/use_this_sdk
|
||||
*.dSYM
|
||||
|
||||
# cmake
|
||||
build/
|
||||
tmp/
|
Binary file not shown.
|
@ -0,0 +1,578 @@
|
|||
|
||||
# Revision History #
|
||||
|
||||
|
||||
## Version 1.7 -- October 2023 ##
|
||||
|
||||
|
||||
### New Documentation: ###
|
||||
|
||||
Additional documentation location to slow down growth of main repository. [https://github.com/wb2osz/direwolf-doc](https://github.com/wb2osz/direwolf-doc) . These are more oriented toward achieving a goal and understanding, as opposed to the User Guide which describes the functionality.
|
||||
|
||||
- ***APRS Digipeaters***
|
||||
|
||||
- ***Internal Packet Routing***
|
||||
|
||||
- ***Radio Interface Guide***
|
||||
|
||||
- ***Successful IGate Operation***
|
||||
|
||||
- ***Understanding APRS Packets***
|
||||
|
||||
|
||||
### New Features: ###
|
||||
|
||||
|
||||
|
||||
- New ICHANNEL configuration option to map a KISS client application channel to APRS-IS. Packets from APRS-IS will be presented to client applications as the specified channel. Packets sent, by client applications, to that channel will go to APRS-IS rather than a radio channel. Details in ***Internal-Packet-Routing.pdf***.
|
||||
|
||||
- New variable speed option for gen_packets. For example, "-v 5,0.1" would generate packets from 5% too slow to 5% too fast with increments of 0.1. Some implementations might have imprecise timing. Use this to test how well TNCs tolerate sloppy timing.
|
||||
|
||||
- Improved Layer 2 Protocol [(IL2P)](https://en.wikipedia.org/wiki/FX.25_Forward_Error_Correction). Compatible with Nino TNC for 1200 and 9600 bps. Use "-I 1" on command line to enable transmit for first channel. For more general case, add to config file (simplified version, see User Guide for more details):
|
||||
|
||||
> After: "CHANNEL 1" (or other channel)
|
||||
>
|
||||
> Add: "IL2PTX 1"
|
||||
|
||||
- Limited support for CM108/CM119 GPIO PTT on Windows.
|
||||
|
||||
- Dire Wolf now advertises itself using DNS Service Discovery. This allows suitable APRS / Packet Radio applications to find a network KISS TNC without knowing the IP address or TCP port. Thanks to Hessu for providing this. Currently available only for Linux and Mac OSX. [Read all about it here.](https://github.com/hessu/aprs-specs/blob/master/TCP-KISS-DNS-SD.md)
|
||||
|
||||
- The transmit calibration tone (-x) command line option now accepts a radio channel number and/or a single letter mode: a = alternate tones, m = mark tone, s = space tone, p = PTT only no sound.
|
||||
|
||||
- The BEACON configuration now recognizes the SOURCE= option. This replaces the AX.25 source address rather than using the MYCALL value for the channel. This is useful for sending more than 5 analog telemetry channels. Use two, or more, source addresses with up to 5 analog channels each.
|
||||
|
||||
- For more flexibility, the FX.25 transmit property can now be set individually by channel, rather than having a global setting for all channels. The -X on the command line applies only to channel 0. For other channels you need to add a new line to the configuration file. You can specify a specific number of parity bytes (16, 32, 64) or 1 to choose automatically based on packet size.
|
||||
|
||||
> After: "CHANNEL 1" (or other channel)
|
||||
>
|
||||
> Add: "FX25TX 1" (or 16 or 32 or 64)
|
||||
|
||||
|
||||
|
||||
### Bugs Fixed: ###
|
||||
|
||||
- The t/m packet filter incorrectly included bulletins. It now allows only "messages" to specific stations. Use of t/m is discouraged. i/180 is the preferred filter for messages to users recently heard locally.
|
||||
|
||||
- Packet filtering now skips over any third party header before classifying packet types.
|
||||
|
||||
- Fixed build for Alpine Linux.
|
||||
|
||||
### Notes: ###
|
||||
|
||||
The Windows binary distribution now uses gcc (MinGW) version 11.3.0.
|
||||
The Windows version is built for both 32 and 64 bit operating systems.
|
||||
Use the 64 bit version if possible; it runs considerably faster.
|
||||
|
||||
## Version 1.6 -- October 2020 ##
|
||||
|
||||
### New Build Procedure: ###
|
||||
|
||||
|
||||
- Rather than trying to keep a bunch of different platform specific Makefiles in sync, "cmake" is now used for greater portability and easier maintenance. This was contributed by Davide Gerhard.
|
||||
|
||||
- README.md has a quick summary of the process. More details in the ***User Guide***.
|
||||
|
||||
|
||||
### New Features: ###
|
||||
|
||||
|
||||
- "-X" option enables FX.25 transmission. FX.25 reception is always enabled so you don't need to do anything special. "What is FX.25?" you might ask. It is forward error correction (FEC) added in a way that is completely compatible with an ordinary AX.25 frame. See new document ***AX25\_plus\_FEC\_equals\_FX25.pdf*** for details.
|
||||
|
||||
- Receive AIS location data from ships. Enable by using "-B AIS" command line option or "MODEM AIS" in the configuration file. AIS NMEA sentences are encapsulated in APRS user-defined data with a "{DA" prefix. This uses 9600 bps so you need to use wide band audio, not what comes out of the speaker. There is also a "-A" option to generate APRS Object Reports.
|
||||
|
||||
- Receive Emergency Alert System (EAS) Specific Area Message Encoding (SAME). Enable by using "-B EAS" command line option or "MODEM EAS" in the configuration file. EAS SAME messages are encapsulated in APRS user-defined data with a "{DE" prefix. This uses low speed AFSK so speaker output is fine.
|
||||
|
||||
- "-t" option now accepts more values to accommodate inconsistent handling of text color control codes by different terminal emulators. The default, 1, should work with most modern terminal types. If the colors are not right, try "-t 9" to see the result of the different choices and pick the best one. If none of them look right, file a bug report and specify: operating system version (e.g. Raspbian Buster), terminal emulator type and version (e.g. LXTerminal 0.3.2). Include a screen capture.
|
||||
|
||||
|
||||
- "-g" option to force G3RUH mode for lower speeds where a different modem type may be the default.
|
||||
|
||||
- 2400 bps compatibility with MFJ-2400. See ***2400-4800-PSK-for-APRS-Packet-Radio.pdf*** for details
|
||||
|
||||
- "atest -h" will display the frame in hexadecimal for closer inspection.
|
||||
|
||||
- Add support for Multi-GNSS NMEA sentences.
|
||||
|
||||
|
||||
|
||||
### Bugs Fixed: ###
|
||||
|
||||
- Proper counting of frames in transmit queue for AGW protocol 'Y' command.
|
||||
|
||||
|
||||
|
||||
### New Documentation: ###
|
||||
|
||||
- ***AX.25 + FEC = FX.25***
|
||||
|
||||
- ***AIS Reception***
|
||||
|
||||
- ***AX.25 Throughput: Why is 9600 bps Packet Radio only twice as fast as 1200?***
|
||||
|
||||
- [***Ham Radio of Things (HRoT) - IoT over Ham Radio***](https://github.com/wb2osz/hrot)
|
||||
|
||||
- [***EAS SAME to APRS Message Converter***](https://github.com/wb2osz/eas2aprs)
|
||||
|
||||
- [***Dire Wolf PowerPoint Slide Show***](https://github.com/wb2osz/direwolf-presentation)
|
||||
|
||||
### Notes: ###
|
||||
|
||||
The Windows binary distribution now uses gcc (MinGW) version 7.4.0.
|
||||
The Windows version is built for both 32 and 64 bit operating systems.
|
||||
Use the 64 bit version if possible; it runs considerably faster.
|
||||
|
||||
|
||||
|
||||
## Version 1.5 -- September 2018 ##
|
||||
|
||||
|
||||
### New Features: ###
|
||||
|
||||
- PTT using GPIO pin of CM108/CM119 (e.g. DMK URI, RB-USB RIM), Linux only.
|
||||
|
||||
- More efficient error recovery for AX.25 connected mode. Better generation and processing of REJ and SREJ to reduce unnecessary duplicate "**I**" frames.
|
||||
|
||||
- New configuration option, "**V20**", for listing stations known to not understand AX.25 v2.2. This will speed up connection by going right to SABM and not trying SABME first and failing.
|
||||
|
||||
- New "**NOXID**" configuration file option to avoid sending XID command to listed station(s). If other end is a partial v2.2 implementation, which recognizes SABME, but not XID, we would waste a lot of time resending XID many times before giving up. This is less drastic than the "**V20**" option which doesn't even attempt to use v2.2 with listed station(s).
|
||||
|
||||
- New application "**kissutil**" for troubleshooting a KISS TNC or interfacing to an application via files.
|
||||
|
||||
- KISS "Set Hardware" command to report transmit queue length.
|
||||
|
||||
- TCP KISS can now handle multiple concurrent applications.
|
||||
|
||||
- Linux can use serial port for KISS in addition to a pseudo terminal.
|
||||
|
||||
- decode_aprs utility can now accept KISS frames and AX.25 frames as series of two digit hexadecimal numbers.
|
||||
|
||||
- Full Duplex operation. (Put "FULLDUP ON" in channel section of configuration file.)
|
||||
|
||||
- Time slots for beaconing.
|
||||
|
||||
- Allow single log file with fixed name rather than starting a new one each day.
|
||||
|
||||
|
||||
|
||||
### Bugs Fixed: ###
|
||||
|
||||
- Possible crash when CDIGIPEAT did not include the optional alias.
|
||||
|
||||
- PACLEN configuration item no longer restricts length of received frames.
|
||||
|
||||
- Strange failures when trying to use multiple KISS client applications over TCP. Only Linux was affected.
|
||||
|
||||
- Under certain conditions, outgoing connected mode data would get stuck in a queue and not be transmitted. This could happen if client application sends a burst of data larger than the "window" size (MAXFRAME or EMAXFRAME option).
|
||||
|
||||
|
||||
- Little typographical / spelling errors in messages.
|
||||
|
||||
|
||||
### Documentation: ###
|
||||
|
||||
|
||||
- New document ***Bluetooth-KISS-TNC.pdf*** explaining how to use KISS over Bluetooth.
|
||||
|
||||
- Updates describing cheap SDR frequency inaccuracy and how to compensate for it.
|
||||
|
||||
### Notes: ###
|
||||
|
||||
Windows binary distribution now uses gcc (MinGW) version 6.3.0.
|
||||
|
||||
----------
|
||||
|
||||
## Version 1.4 -- April 2017 ##
|
||||
|
||||
|
||||
### New Features: ###
|
||||
|
||||
- AX.25 v2.2 connected mode. See chapter 10 of User Guide for details.
|
||||
|
||||
- New client side packet filter to select "messages" only to stations that have been heard nearby recently. This is now the default if no IS to RF filter is specified.
|
||||
|
||||
- New beacon type, IBEACON, for sending IGate statistics.
|
||||
|
||||
- Expanded debug options so you can understand what is going on with packet filtering.
|
||||
|
||||
- Added new document ***Successful-APRS-IGate-Operation.pdf*** with IGate background, configuration, and troubleshooting tips.
|
||||
- 2400 & 4800 bps PSK modems. See ***2400-4800-PSK-for-APRS-Packet-Radio.pdf*** in the doc directory for discussion.
|
||||
|
||||
- The top speed of 9600 bps has been increased to 38400. You will need a sound card capable of 96k or 192k samples per second for the higher rates. Radios must also have adequate bandwidth. See ***Going-beyond-9600-baud.pdf*** in the doc directory for more details.
|
||||
|
||||
- Better decoder performance for 9600 and higher especially for low audio sample rate to baud ratios.
|
||||
|
||||
- Generate waypoint sentences for use by AvMap G5 / G6 or other mapping devices or applications. Formats include
|
||||
- $GPWPL - NMEA generic with only location and name.
|
||||
- $PGRMW - Garmin, adds altitude, symbol, and comment to previously named waypoint.
|
||||
- $PMGNWPL - Magellan, more complete for stationary objects.
|
||||
- $PKWDWPL - Kenwood with APRS style symbol but missing comment.
|
||||
|
||||
|
||||
- DTMF tones can be sent by putting "DTMF" in the destination address, similar to the way that Morse Code is sent.
|
||||
|
||||
- Take advantage of new 'gpio' group and new /sys/class/gpio ownership in Raspbian Jessie.
|
||||
|
||||
- Handle more complicated gpio naming for CubieBoard, etc.
|
||||
|
||||
- More flexible dw-start.sh start up script for both GUI and CLI environments.
|
||||
|
||||
|
||||
|
||||
### Bugs Fixed: ###
|
||||
|
||||
- The transmitter (PTT control) was being turned off too soon when sending Morse Code.
|
||||
|
||||
- The -qd (quiet decode) command line option now suppresses errors about improperly formed Telemetry packets.
|
||||
|
||||
- Longer tocall.txt files can now be handled.
|
||||
|
||||
- Sometimes kissattach would have an issue with the Dire Wolf pseudo terminal. This showed up most often on Raspbian but sometimes occurred with other versions of Linux.
|
||||
|
||||
*kissattach: Error setting line discipline: TIOCSETD: Device or resource busy
|
||||
Are you sure you have enabled MKISS support in the kernel
|
||||
or, if you made it a module, that the module is loaded?*
|
||||
|
||||
|
||||
- Sometimes writes to a pseudo terminal would block causing the received
|
||||
frame processing thread to hang. The first thing you will notice is that
|
||||
received frames are not being printed. After a while this message will appear:
|
||||
|
||||
*Received frame queue is out of control. Length=... Reader thread is probably
|
||||
frozen. This can be caused by using a pseudo terminal (direwolf -p) where
|
||||
another application is not reading the frames from the other side.*
|
||||
|
||||
- -p command line option caused segmentation fault with glibc >= 2.24.
|
||||
|
||||
|
||||
- The Windows version 1.3 would crash when starting to transmit on Windows XP. There have also been some other reports of erratic behavior on Windows. The crashing problem was fixed in in the 1.3.1 patch release. Linux version was not affected.
|
||||
|
||||
- IGate did not retain nul characters in the information part of a packet. This should never happen with a valid APRS packet but there are a couple cases where it has. If we encounter these malformed packets, pass them along as-is, rather than truncating.
|
||||
|
||||
- Don't digipeat packets when the source is my call.
|
||||
|
||||
|
||||
|
||||
----------
|
||||
|
||||
## Version 1.3 -- May 2016 ##
|
||||
|
||||
### New Features: ###
|
||||
|
||||
- Support for Mac OS X.
|
||||
|
||||
- Many APRStt enhancements including: Morse code and speech responses to to APRStt tone sequences, new 5 digit callsign suffix abbreviation,
|
||||
position ambiguity for latitude and longitude in object reports
|
||||
|
||||
- APRS Telemetry Toolkit.
|
||||
|
||||
- GPS Tracker beacons are now available for the Windows version. Previously this was only in the Linux version.
|
||||
|
||||
- SATgate mode for IGate. Packets heard directly are delayed before being sent
|
||||
to the Internet Server. This favors digipeated packets because the original
|
||||
arrives later and gets dropped if there are duplicates.
|
||||
|
||||
- Added support for hamlib. This provides more flexible options for PTT control.
|
||||
|
||||
- Implemented AGW network protocol 'M' message for sending UNPROTO information without digipeater path.
|
||||
|
||||
|
||||
- A list of all symbols available can be obtained with the -S
|
||||
command line option.
|
||||
|
||||
- Command line option "-a n" to print audio device statistics each n seconds. Previously this was always each 100 seconds on Linux and not available on Windows.
|
||||
|
||||
### Bugs Fixed: ###
|
||||
|
||||
|
||||
|
||||
- Fixed several cases where crashes were caused by unexpected packet contents:
|
||||
|
||||
- When receiving packet with unexpected form of GPS NMEA sentence.
|
||||
|
||||
- When receiving packet with comment of a few hundred characters.
|
||||
|
||||
- Address in path, from Internet server, more than 9 characters.
|
||||
|
||||
- "INTERNAL ERROR: dlq_append NULL packet pointer." when using PASSALL.
|
||||
|
||||
- In Mac OSX version: Assertion failed: (adev[a].inbuf_size_in_bytes >= 100 && adev[a].inbuf_size_in_bytes <= 32768), function audio_get, file audio_portaudio.c, line 917.
|
||||
|
||||
- Tracker beacons were not always updating the location properly.
|
||||
|
||||
- AGW network protocol now works properly for big-endian processors
|
||||
such as PowerPC or MIPS.
|
||||
|
||||
- Packet filtering treated telemetry metadata as messages rather than telemetry.
|
||||
|
||||
----------
|
||||
|
||||
## Version 1.2 -- June 2015 ##
|
||||
|
||||
### New Features ###
|
||||
|
||||
- Improved decoder performance.
|
||||
Over 1000 error-free frames decoded from WA8LMF TNC Test CD.
|
||||
See ***A-Better-APRS-Packet-Demodulator-Part-1-1200-baud.pdf*** for details.
|
||||
|
||||
- Up to 3 soundcards and 6 radio channels can be handled at the same time.
|
||||
|
||||
- New framework for applications which listen for Touch Tone commands
|
||||
and respond with voice. A sample calculator application is included
|
||||
as a starting point for building more interesting applications.
|
||||
For example, if it hears the DTMF sequence "2*3*4#" it will respond
|
||||
with the spoken words "Twenty Four."
|
||||
|
||||
- Reduced latency for transfers to/from soundcards.
|
||||
|
||||
- More accurate transmit PTT timing.
|
||||
|
||||
- Packet filtering for digipeater and IGate.
|
||||
|
||||
- New command line -q (quiet) option to suppress some types of output.
|
||||
|
||||
- Attempted fixing of corrupted bits now works for 9600 baud.
|
||||
|
||||
- Implemented AGW network protocol 'y' message so applications can
|
||||
throttle generation of packets when sending a large file.
|
||||
|
||||
- When using serial port RTS/DTR to activate transmitter, the two
|
||||
control lines can now be driven with opposite polarity as required
|
||||
by some interfaces.
|
||||
|
||||
- Data Carrier Detect (DCD) can be sent to an output line (just
|
||||
like PTT) to activate a carrier detect light.
|
||||
|
||||
- Linux "man" pages for on-line documentation.
|
||||
|
||||
- AGWPORT and KISSPORT can be set to 0 to disable the interfaces.
|
||||
|
||||
- APRStt gateway enhancements: MGRS/USNG coordinates, new APRStt3
|
||||
format call, satellite grid squares.
|
||||
|
||||
|
||||
### Bugs fixed ###
|
||||
|
||||
- Fixed "gen_packets" so it now handles user-specified messages correctly.
|
||||
|
||||
- Under some circumstances PTT would be held on long after the transmit
|
||||
audio was finished.
|
||||
|
||||
|
||||
|
||||
### Known problems ###
|
||||
|
||||
- Sometimes writes to a pseudo terminal will block causing the received
|
||||
frame processing thread to hang. The first thing you will notice is that
|
||||
received frames are not being printed. After a while this message will appear:
|
||||
|
||||
Received frame queue is out of control. Length=... Reader thread is probably
|
||||
frozen. This can be caused by using a pseudo terminal (direwolf -p) where
|
||||
another application is not reading the frames from the other side.
|
||||
|
||||
-----------
|
||||
|
||||
## Version 1.1 -- December 2014 ##
|
||||
|
||||
### New Features ###
|
||||
|
||||
- Logging of received packets and utility to convert log file
|
||||
into GPX format.
|
||||
|
||||
- AGW network port formerly allowed only one connection at a
|
||||
time. It can now accept 3 client applications at the same time.
|
||||
(Same has not yet been done for network KISS port.)
|
||||
|
||||
- Frequency / offset / tone standard formats are now recognized.
|
||||
Non-standard attempts, in the comment, are often detected and
|
||||
a message suggests the correct format.
|
||||
|
||||
- Telemetry is now recognized. Messages are printed for
|
||||
usage that does not adhere to the published standard.
|
||||
|
||||
- Tracker function transmits location from GPS position.
|
||||
New configuration file options: TBEACON and SMARTBEACONING.
|
||||
(For Linux only. Warning - has not been well tested.)
|
||||
|
||||
- Experimental packet regeneration feature for HF use.
|
||||
Will be documented later if proves to be useful...
|
||||
|
||||
- Several enhancements for trying to fix incorrect CRC:
|
||||
Additional types of attempts to fix a bad CRC.
|
||||
Optimized code to reduce execution time.
|
||||
Improved detection of duplicate packets from different fixup attempts.
|
||||
Set limit on number of packets in fix up later queue.
|
||||
|
||||
- Beacon positions can be specified in either latitude / longitude
|
||||
or UTM coordinates.
|
||||
|
||||
- It is still highly recommended, but no longer mandatory, that
|
||||
beaconing be enabled for digipeating to work.
|
||||
|
||||
* Bugs fixed:
|
||||
|
||||
- For Windows version, maximum serial port was COM9.
|
||||
It is now possible to use COM10 and higher.
|
||||
|
||||
- Fixed issue with KISS protocol decoder state that showed up
|
||||
only with "binary" data in packets (e.g. RMS Express).
|
||||
|
||||
- An extra 00 byte was being appended to packets from AGW
|
||||
network protocol 'K' messages.
|
||||
|
||||
- Invalid data from an AGW client application could cause an
|
||||
application crash.
|
||||
|
||||
- OSS (audio interface for non-Linux versions of Unix) should
|
||||
be better now.
|
||||
|
||||
### Known problems ###
|
||||
|
||||
- Sometimes kissattach fails to connect with "direwolf -p".
|
||||
The User Guide and Raspberry Pi APRS document have a couple work-arounds.
|
||||
|
||||
-----------
|
||||
|
||||
## Version 1.0a -- May 2014 ##
|
||||
|
||||
### Bug fixed ###
|
||||
|
||||
- Beacons sent directly to IGate server had incorrect source address.
|
||||
|
||||
-----------
|
||||
|
||||
## Version 1.0 -- May 2014 ##
|
||||
|
||||
### New Features ###
|
||||
|
||||
- Received audio can be obtained with a UDP socket or stdin.
|
||||
This can be used to take audio from software defined radios
|
||||
such as rtl_fm or gqrx.
|
||||
|
||||
- 9600 baud data rate.
|
||||
|
||||
- New PBEACON and OBEACON configuration options. Previously
|
||||
it was necessary to handcraft beacons.
|
||||
|
||||
- Less CPU power required for 300 baud. This is important
|
||||
if you want to run a bunch of decoders at the same time
|
||||
to tolerate off-frequency HF SSB signals.
|
||||
|
||||
- Improved support for UTF-8 character set.
|
||||
|
||||
- Improved troubleshooting display for APRStt macros.
|
||||
|
||||
- In earlier versions, the DTMF decoder was always active because it
|
||||
took a negligible amount of CPU time. Unfortunately this sometimes
|
||||
resulted in too many false positives from some other types of digital
|
||||
transmissions heard on HF. Starting in version 1.0, the DTMF decoder
|
||||
is enabled only when the APRStt gateway is configured.
|
||||
|
||||
|
||||
-----------
|
||||
|
||||
## Version 0.9 --November 2013 ##
|
||||
|
||||
### New Features ###
|
||||
|
||||
- Selection of non-default audio device for Linux ALSA.
|
||||
|
||||
- Simplified audio device set up for Raspberry Pi.
|
||||
|
||||
- GPIO lines can be used for PTT on suitable Linux systems.
|
||||
|
||||
- Improved 1200 baud decoder.
|
||||
|
||||
- Multiple decoders per channel to tolerate HF SSB signals off frequency.
|
||||
|
||||
- Command line option "-t 0" to disable text colors.
|
||||
|
||||
- APRStt macros which allow short numeric only touch tone
|
||||
sequences to be processed as much longer predefined sequences.
|
||||
|
||||
|
||||
### Bugs Fixed ###
|
||||
|
||||
- Now works on 64 bit target.
|
||||
|
||||
### New Restriction for Windows version ###
|
||||
|
||||
- Minimum processor is now Pentium 3 or equivalent or later.
|
||||
It's possible to run on something older but you will need
|
||||
to rebuild it from source.
|
||||
|
||||
|
||||
-----------
|
||||
|
||||
## Version 0.8 -- August 2013 ##
|
||||
|
||||
### New Features ###
|
||||
|
||||
- Internet Gateway (IGate) including IPv6 support.
|
||||
|
||||
- Compatibility with YAAC.
|
||||
|
||||
- Preemptive digipeating option.
|
||||
|
||||
- KISS TNC should now work with connected AX.25 protocols
|
||||
(e.g. AX25 for Linux), not just APRS.
|
||||
|
||||
|
||||
----------
|
||||
|
||||
## Version 0.7 -- March 2013 ##
|
||||
|
||||
### New Features: ###
|
||||
|
||||
- Added APRStt gateway capability. For details, see ***APRStt-Implementation-Notes.pdf***
|
||||
|
||||
|
||||
-----------
|
||||
|
||||
## Version 0.6 -- February 2013 ##
|
||||
|
||||
### New Features ###
|
||||
|
||||
- Improved performance of AFSK demodulator.
|
||||
Now decodes 965 frames from Track 2 of WA8LMF's TNC Test CD.
|
||||
|
||||
- KISS protocol now available thru a TCP socket.
|
||||
Default port is 8001.
|
||||
Change it with KISSPORT option in configuration file.
|
||||
|
||||
- Ability to salvage frames with bad FCS.
|
||||
See section mentioning "bad apple" in the user guide.
|
||||
Default of fixing 1 bit works well.
|
||||
Fixing more bits not recommended because there is a high
|
||||
probability of occasional corrupted data getting thru.
|
||||
|
||||
- Added AGW "monitor" format messages.
|
||||
Now compatible with APRS-TW for telemetry.
|
||||
|
||||
|
||||
### Known Problem ###
|
||||
|
||||
- The Linux (but not Cygwin) version eventually hangs if nothing is
|
||||
reading from the KISS pseudo terminal. Some operating system
|
||||
queue fills up, the application write blocks, and decoding stops.
|
||||
|
||||
|
||||
### Workaround ###
|
||||
|
||||
- If another application is not using the serial KISS interface,
|
||||
run this in another window:
|
||||
|
||||
tail -f /tmp/kisstnc
|
||||
|
||||
-----------
|
||||
|
||||
## Version 0.5 -- March 2012 ##
|
||||
|
||||
- More error checking and messages for invalid APRS data.
|
||||
|
||||
-----------
|
||||
|
||||
## Version 0.4 -- September 2011 ##
|
||||
|
||||
- First general availability.
|
||||
|
167
CHANGES.txt
167
CHANGES.txt
|
@ -1,167 +0,0 @@
|
|||
----------------
|
||||
Revision history
|
||||
----------------
|
||||
|
||||
|
||||
-----------
|
||||
Version 1.0a May 2014
|
||||
-----------
|
||||
|
||||
* Bug fix:
|
||||
|
||||
Beacons sent directly to IGate server had incorrect source address.
|
||||
|
||||
|
||||
|
||||
-----------
|
||||
Version 1.0 May 2014
|
||||
-----------
|
||||
|
||||
* New Features:
|
||||
|
||||
Received audio can be obtained with a UDP socket or stdin.
|
||||
This can be used to take audio from software defined radios
|
||||
such as rtl_fm or gqrx.
|
||||
|
||||
9600 baud data rate.
|
||||
|
||||
New PBEACON and OBEACON configuration options. Previously
|
||||
it was necessary to handcraft beacons.
|
||||
|
||||
Less CPU power required for 300 baud. This is important
|
||||
if you want to run a bunch of decoders at the same time
|
||||
to tolerate off-frequency HF SSB signals.
|
||||
|
||||
Improved support for UTF-8 character set.
|
||||
|
||||
Improved troubleshooting display for APRStt macros.
|
||||
|
||||
|
||||
|
||||
-----------
|
||||
Version 0.9 November 2013
|
||||
-----------
|
||||
|
||||
* New Features:
|
||||
|
||||
Selection of non-default audio device for Linux ALSA.
|
||||
|
||||
Simplified audio device set up for Raspberry Pi.
|
||||
|
||||
GPIO lines can be used for PTT on suitable Linux systems.
|
||||
|
||||
Improved 1200 baud decoder.
|
||||
|
||||
Multiple decoders per channel to tolerate HF SSB signals off frequency.
|
||||
|
||||
Command line option "-t 0" to disable text colors.
|
||||
|
||||
APRStt macros which allow short numeric only touch tone
|
||||
sequences to be processed as much longer predefined sequences.
|
||||
|
||||
|
||||
|
||||
* Bugs Fixed:
|
||||
|
||||
Now works on 64 bit target.
|
||||
|
||||
|
||||
|
||||
* New Restriction for Windows version:
|
||||
|
||||
Minimum processor is now Pentium 3 or equivalent or later.
|
||||
It's possible to run on something older but you will need
|
||||
to rebuild it from source.
|
||||
|
||||
|
||||
|
||||
|
||||
-----------
|
||||
Version 0.8 August 2013
|
||||
-----------
|
||||
|
||||
* New Features:
|
||||
|
||||
Internet Gateway (IGate) including IPv6 support.
|
||||
|
||||
Compatibility with YAAC.
|
||||
|
||||
Preemptive digipeating option.
|
||||
|
||||
KISS TNC should now work with connected AX.25 protocols
|
||||
(e.g. AX25 for Linux), not just APRS.
|
||||
|
||||
|
||||
|
||||
-----------
|
||||
Version 0.7 March 2013
|
||||
-----------
|
||||
|
||||
* New Features:
|
||||
|
||||
Added APRStt gateway capability. For details, see:
|
||||
|
||||
APRStt-Implementation-Notes.pdf
|
||||
|
||||
|
||||
|
||||
|
||||
-----------
|
||||
Version 0.6
|
||||
-----------
|
||||
|
||||
|
||||
* New Features:
|
||||
|
||||
Improved performance of AFSK demodulator.
|
||||
Now decodes 965 frames from Track 2 of WA8LMF’s TNC Test CD.
|
||||
|
||||
KISS protocol now available thru a TCP socket.
|
||||
Default port is 8001.
|
||||
Change it with KISSPORT option in configuration file.
|
||||
|
||||
Ability to salvage frames with bad FCS.
|
||||
See section mentioning "bad apple" in the user guide.
|
||||
Default of fixing 1 bit works well.
|
||||
Fixing more bits not recommended because there is a high
|
||||
probability of occasional corrupted data getting thru.
|
||||
|
||||
Added AGW "monitor" format messages.
|
||||
Now compatible with APRS-TW for telemetry.
|
||||
|
||||
|
||||
* Bugs Fixed:
|
||||
|
||||
None.
|
||||
|
||||
|
||||
|
||||
* Known Problem:
|
||||
|
||||
The Linux (but not Cygwin) version eventually hangs if nothing is
|
||||
reading from the KISS pseudo terminal. Some operating system
|
||||
queue fills up, the application write blocks, and decoding stops.
|
||||
|
||||
|
||||
* Workaround:
|
||||
|
||||
If another application is not using the serial KISS interface,
|
||||
run this in another window:
|
||||
|
||||
tail -f /tmp/kisstnc
|
||||
|
||||
|
||||
-----------
|
||||
Version 0.5
|
||||
-----------
|
||||
|
||||
|
||||
More error checking and messages for invalid APRS data.
|
||||
|
||||
|
||||
-----------
|
||||
Version 0.4
|
||||
-----------
|
||||
|
||||
First general availability.
|
||||
|
|
@ -0,0 +1,414 @@
|
|||
cmake_minimum_required(VERSION 3.5.0)
|
||||
|
||||
project(direwolf)
|
||||
|
||||
# configure version
|
||||
set(direwolf_VERSION_MAJOR "1")
|
||||
set(direwolf_VERSION_MINOR "7")
|
||||
set(direwolf_VERSION_PATCH "0")
|
||||
set(direwolf_VERSION_SUFFIX "Development")
|
||||
|
||||
# options
|
||||
# See Issue 297.
|
||||
option(FORCE_SSE "Compile with SSE instruction only" ON)
|
||||
option(FORCE_SSSE3 "Compile with SSSE3 instruction only" OFF)
|
||||
option(FORCE_SSE41 "Compile with SSE4.1 instruction only" OFF)
|
||||
option(OPTIONAL_TEST "Compile optional test (might be broken)" OFF)
|
||||
# UNITTEST option must be after CMAKE_BUILT_TYPE
|
||||
|
||||
# where cmake find custom modules
|
||||
list(APPEND CMAKE_MODULE_PATH ${CMAKE_SOURCE_DIR}/cmake/modules)
|
||||
|
||||
# fix c standard used on the project
|
||||
set(CMAKE_C_STANDARD 99)
|
||||
|
||||
# Set additional project information
|
||||
set(COMPANY "wb2osz")
|
||||
add_definitions("-DCOMPANY=\"${COMPANY}\"")
|
||||
set(APPLICATION_NAME "Dire Wolf")
|
||||
add_definitions("-DAPPLICATION_NAME=\"${APPLICATION_NAME}\"")
|
||||
set(APPLICATION_MAINTAINER="John Langner, WB2OSZ")
|
||||
set(COPYRIGHT "Copyright (c) 2019 John Langner, WB2OSZ. All rights reserved.")
|
||||
add_definitions("-DCOPYRIGHT=\"${COPYRIGHT}\"")
|
||||
set(IDENTIFIER "com.${COMPANY}.${APPLICATION_NAME}")
|
||||
add_definitions("-DIDENTIFIER=\"${IDENTIFIER}\"")
|
||||
# raspberry as only lxterminal not xterm
|
||||
if(NOT (WIN32 OR CYGWIN))
|
||||
find_program(BINARY_TERMINAL_BIN lxterminal)
|
||||
if(BINARY_TERMINAL_BIN)
|
||||
set(APPLICATION_DESKTOP_EXEC "${BINARY_TERMINAL_BIN} -e ${CMAKE_PROJECT_NAME}")
|
||||
else()
|
||||
set(APPLICATION_DESKTOP_EXEC "xterm -e ${CMAKE_PROJECT_NAME}")
|
||||
endif()
|
||||
endif()
|
||||
|
||||
find_package(Git)
|
||||
if(GIT_FOUND AND EXISTS "${CMAKE_SOURCE_DIR}/.git/")
|
||||
# we can also use `git describe --tags`
|
||||
execute_process(COMMAND "${GIT_EXECUTABLE}" rev-parse --short HEAD
|
||||
WORKING_DIRECTORY "${CMAKE_SOURCE_DIR}"
|
||||
RESULT_VARIABLE res
|
||||
OUTPUT_VARIABLE out
|
||||
ERROR_QUIET
|
||||
OUTPUT_STRIP_TRAILING_WHITESPACE)
|
||||
if(NOT res)
|
||||
string(REGEX REPLACE "^v([0-9]+)\.([0-9]+)\.([0-9]+)-" "" git_commit ${out})
|
||||
set(direwolf_VERSION_SUFFIX "-${git_commit}")
|
||||
set(direwolf_VERSION_COMMIT "${git_commit}")
|
||||
endif()
|
||||
endif()
|
||||
|
||||
# set variables
|
||||
set(direwolf_VERSION "${direwolf_VERSION_MAJOR}.${direwolf_VERSION_MINOR}.${direwolf_VERSION_PATCH}${direwolf_VERSION_SUFFIX}")
|
||||
message(STATUS "${APPLICATION_NAME} Version: ${direwolf_VERSION}")
|
||||
add_definitions("-DIREWOLF_VERSION=\"${direwolf_VERSION}\"")
|
||||
add_definitions("-DMAJOR_VERSION=${direwolf_VERSION_MAJOR}")
|
||||
add_definitions("-DMINOR_VERSION=${direwolf_VERSION_MINOR}")
|
||||
if(direwolf_VERSION_COMMIT)
|
||||
add_definitions("-DEXTRA_VERSION=${direwolf_VERSION_COMMIT}")
|
||||
endif()
|
||||
|
||||
set(CUSTOM_SRC_DIR "${CMAKE_SOURCE_DIR}/src")
|
||||
set(CUSTOM_EXTERNAL_DIR "${CMAKE_SOURCE_DIR}/external")
|
||||
set(CUSTOM_MISC_DIR "${CUSTOM_EXTERNAL_DIR}/misc")
|
||||
set(CUSTOM_REGEX_DIR "${CUSTOM_EXTERNAL_DIR}/regex")
|
||||
set(CUSTOM_HIDAPI_DIR "${CUSTOM_EXTERNAL_DIR}/hidapi")
|
||||
set(CUSTOM_GEOTRANZ_DIR "${CUSTOM_EXTERNAL_DIR}/geotranz")
|
||||
set(CUSTOM_DATA_DIR "${CMAKE_SOURCE_DIR}/data")
|
||||
set(CUSTOM_SCRIPTS_DIR "${CMAKE_SOURCE_DIR}/scripts")
|
||||
set(CUSTOM_TELEMETRY_DIR "${CUSTOM_SCRIPTS_DIR}/telemetry-toolkit")
|
||||
set(CUSTOM_CONF_DIR "${CMAKE_SOURCE_DIR}/conf")
|
||||
set(CUSTOM_DOC_DIR "${CMAKE_SOURCE_DIR}/doc")
|
||||
set(CUSTOM_MAN_DIR "${CMAKE_SOURCE_DIR}/man")
|
||||
set(CUSTOM_TEST_DIR "${CMAKE_SOURCE_DIR}/test")
|
||||
set(CUSTOM_TEST_SCRIPTS_DIR "${CUSTOM_TEST_DIR}/scripts")
|
||||
set(CUSTOM_SHELL_SHABANG "#!/bin/sh -e")
|
||||
|
||||
# cpack variables
|
||||
set(CPACK_GENERATOR "ZIP")
|
||||
set(CPACK_STRIP_FILES true)
|
||||
set(CPACK_PACKAGE_NAME "${CMAKE_PROJECT_NAME}")
|
||||
# This has architecture of the build machine, not the target platform.
|
||||
# e.g. Comes out as x86_64 when building for i686 target platform.
|
||||
#set(CPACK_PACKAGE_FILE_NAME "${CMAKE_PROJECT_NAME}-${direwolf_VERSION}_${CMAKE_SYSTEM_PROCESSOR}")
|
||||
# We don't know the target yet so this is set after FindCPUflags.
|
||||
set(CPACK_PACKAGE_CONTACT "https://github.com/wb2osz/direwolf")
|
||||
SET(CPACK_PACKAGE_DESCRIPTION_SUMMARY "Dire Wolf is an AX.25 soundcard TNC, digipeater, APRS IGate, GPS tracker, and APRStt gateway")
|
||||
set(CPACK_PACKAGE_DESCRIPTION_FILE "${CMAKE_SOURCE_DIR}/README.md")
|
||||
set(CPACK_RESOURCE_FILE_README "${CMAKE_SOURCE_DIR}/README.md")
|
||||
set(CPACK_RESOURCE_FILE_LICENSE "${CMAKE_SOURCE_DIR}/LICENSE")
|
||||
set(CPACK_SOURCE_IGNORE_FILES "${PROJECT_BINARY_DIR};/.git/;.gitignore;menu.yml;.travis.yml;.appveyor.yml;default.nix;.envrc;TODOs.org;/.scripts/")
|
||||
SET(CPACK_PACKAGE_VERSION "${direwolf_VERSION}")
|
||||
SET(CPACK_PACKAGE_VERSION_MAJOR "${direwolf_VERSION_MAJOR}")
|
||||
SET(CPACK_PACKAGE_VERSION_MINOR "${direwolf_VERSION_MINOR}")
|
||||
SET(CPACK_PACKAGE_VERSION_PATCH "${direwolf_VERSION_PATCH}")
|
||||
SET(CPACK_DEBIAN_PACKAGE_DEPENDS "libasound2,libgps23")
|
||||
|
||||
# if we don't set build_type
|
||||
if(NOT DEFINED CMAKE_BUILD_TYPE OR "${CMAKE_BUILD_TYPE}" STREQUAL "")
|
||||
set(CMAKE_BUILD_TYPE Release CACHE STRING "Build type" FORCE)
|
||||
endif()
|
||||
message(STATUS "Build type set to: ${CMAKE_BUILD_TYPE}")
|
||||
message("CMake system: ${CMAKE_SYSTEM_NAME}")
|
||||
|
||||
# Unittest should be on for dev builds and off for releases.
|
||||
if(CMAKE_BUILD_TYPE MATCHES "Release")
|
||||
option(UNITTEST "Build unittest binaries." OFF)
|
||||
else()
|
||||
option(UNITTEST "Build unittest binaries." ON)
|
||||
endif()
|
||||
|
||||
# set compiler
|
||||
include(FindCompiler)
|
||||
|
||||
# find cpu flags (and set compiler)
|
||||
include(FindCPUflags)
|
||||
|
||||
if(${ARCHITECTURE} MATCHES "x86")
|
||||
set(CPACK_PACKAGE_FILE_NAME "${CMAKE_PROJECT_NAME}-${direwolf_VERSION}_i686")
|
||||
else()
|
||||
set(CPACK_PACKAGE_FILE_NAME "${CMAKE_PROJECT_NAME}-${direwolf_VERSION}_${ARCHITECTURE}")
|
||||
endif()
|
||||
|
||||
# auto include current directory
|
||||
set(CMAKE_INCLUDE_CURRENT_DIR ON)
|
||||
|
||||
# set OS dependent variables
|
||||
if(${CMAKE_SYSTEM_NAME} STREQUAL "Linux")
|
||||
set(LINUX TRUE)
|
||||
|
||||
configure_file("${CMAKE_SOURCE_DIR}/cmake/cpack/${CMAKE_PROJECT_NAME}.desktop.in"
|
||||
"${CMAKE_BINARY_DIR}/${CMAKE_PROJECT_NAME}.desktop" @ONLY)
|
||||
|
||||
elseif(${CMAKE_SYSTEM_NAME} STREQUAL "FreeBSD")
|
||||
set(FREEBSD TRUE)
|
||||
configure_file("${CMAKE_SOURCE_DIR}/cmake/cpack/${CMAKE_PROJECT_NAME}.desktop.in"
|
||||
"${CMAKE_BINARY_DIR}/${CMAKE_PROJECT_NAME}.desktop" @ONLY)
|
||||
|
||||
elseif(${CMAKE_SYSTEM_NAME} STREQUAL "OpenBSD")
|
||||
set(OPENBSD TRUE)
|
||||
set(HAVE_SNDIO TRUE)
|
||||
|
||||
elseif(APPLE)
|
||||
if("${CMAKE_OSX_DEPLOYMENT_TARGET}" STREQUAL "")
|
||||
message(STATUS "Build for macOS target: local version")
|
||||
else()
|
||||
message(STATUS "Build for macOS target: ${CMAKE_OSX_DEPLOYMENT_TARGET}")
|
||||
endif()
|
||||
|
||||
# prepend path to find_*()
|
||||
set(CMAKE_FIND_ROOT_PATH "/opt/local")
|
||||
|
||||
set(CMAKE_MACOSX_RPATH ON)
|
||||
message(STATUS "RPATH support: ${CMAKE_MACOSX_RPATH}")
|
||||
|
||||
# just blindly enable dns-sd
|
||||
set(USE_MACOS_DNSSD ON)
|
||||
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -DUSE_MACOS_DNSSD")
|
||||
|
||||
elseif (WIN32)
|
||||
if(C_MSVC)
|
||||
if (NOT VS2015 AND NOT VS2017 AND NOT VS2019)
|
||||
message(FATAL_ERROR "You must use Microsoft Visual Studio 2015, 2017 or 2019 as compiler")
|
||||
else()
|
||||
# compile with full multicore
|
||||
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} /MP")
|
||||
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /MP")
|
||||
set(CUSTOM_SHELL_BIN "")
|
||||
endif()
|
||||
endif()
|
||||
endif()
|
||||
|
||||
if (C_CLANG OR C_GCC)
|
||||
# _BSD_SOURCE is deprecated we need to use _DEFAULT_SOURCE.
|
||||
#
|
||||
# That works find for more modern compilers but we have issues with:
|
||||
# Centos 7, gcc 4.8.5, glibc 2.17
|
||||
# Centos 6, gcc 4.4.7, glibc 2.12
|
||||
#
|
||||
# CentOS 6 & 7: Without -D_BSD_SOURCE, we get Warning: Implicit declaration of
|
||||
# functions alloca, cfmakeraw, scandir, setlinebuf, strcasecmp, strncasecmp, and strsep.
|
||||
# When a function (like strsep) returns a pointer, the compiler instead assumes a 32 bit
|
||||
# int and sign extends it out to be a 64 bit pointer. Use the pointer and Kaboom!
|
||||
#
|
||||
# CentOS 6: We have additional problem. Without -D_POSIX_C_SOURCE=199309L, we get
|
||||
# implicit declaration of function clock_gettime and the linker can't find it.
|
||||
#
|
||||
# It turns out that -D_GNU_SOURCE can be used instead of both of those. For more information,
|
||||
# see https://www.gnu.org/software/libc/manual/html_node/Feature-Test-Macros.html
|
||||
#
|
||||
# Why was this not an issue before? If gcc is used without the -std=c99 option,
|
||||
# it is perfectly happy with clock_gettime, strsep, etc. but with the c99 option, it no longer
|
||||
# recognizes a bunch of commonly used functions. Using _GNU_SOURCE, rather than _DEFAULT_SOURCE
|
||||
# solves the problem for CentOS 6 & 7. This also makes -D_XOPEN_SOURCE= unnecessary.
|
||||
# I hope it doesn't break with newer versions of glibc.
|
||||
#
|
||||
# I also took out -Wextra because it spews out so much noise a serious problem was not noticed.
|
||||
# It might go back in someday when I have more patience to clean up all the warnings.
|
||||
#
|
||||
|
||||
# TODO:
|
||||
# Try error checking -fsanitize=bounds-strict -fsanitize=leak
|
||||
# Requires libubsan and liblsan, respectively.
|
||||
|
||||
###set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wall -Wextra -Wvla -ffast-math -ftree-vectorize -D_XOPEN_SOURCE=600 -D_DEFAULT_SOURCE ${EXTRA_FLAGS}")
|
||||
if(FREEBSD)
|
||||
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wall -Wextra -Wvla -ffast-math -ftree-vectorize -D_DEFAULT_SOURCE ${EXTRA_FLAGS}")
|
||||
else()
|
||||
#set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wall -Wvla -ffast-math -ftree-vectorize -D_GNU_SOURCE -fsanitize=bounds-strict ${EXTRA_FLAGS}")
|
||||
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wall -Wvla -ffast-math -ftree-vectorize -D_GNU_SOURCE ${EXTRA_FLAGS}")
|
||||
endif()
|
||||
#
|
||||
#
|
||||
# -lm is needed for functions in math.h
|
||||
if (LINUX)
|
||||
# We have another problem with CentOS 6. clock_gettime() is in librt so we need -lrt.
|
||||
# The clock_* functions were moved into gnu libc for version 2.17.
|
||||
# https://sourceware.org/ml/libc-announce/2012/msg00001.html
|
||||
# If using gnu libc 2.17, or later, the -lrt is no longer needed but doesn't hurt.
|
||||
# I'm making this conditional on LINUX because it is not needed for BSD and MacOSX.
|
||||
link_libraries("-lrt -lm")
|
||||
else()
|
||||
link_libraries("-lm")
|
||||
endif()
|
||||
elseif (C_MSVC)
|
||||
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -W3 -MP ${EXTRA_FLAGS}")
|
||||
endif()
|
||||
|
||||
if (C_CLANG)
|
||||
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -ferror-limit=1")
|
||||
elseif (C_GCC)
|
||||
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -fmax-errors=1")
|
||||
endif()
|
||||
|
||||
# set installation directories
|
||||
if (WIN32 OR CYGWIN)
|
||||
set(INSTALL_BIN_DIR ".")
|
||||
set(INSTALL_DOC_DIR "doc")
|
||||
set(INSTALL_CONF_DIR ".")
|
||||
set(INSTALL_SCRIPTS_DIR "scripts")
|
||||
set(INSTALL_MAN_DIR "man")
|
||||
set(INSTALL_DATA_DIR "data")
|
||||
else()
|
||||
set(INSTALL_BIN_DIR "bin")
|
||||
set(INSTALL_DOC_DIR "share/doc/${CMAKE_PROJECT_NAME}")
|
||||
set(INSTALL_CONF_DIR "${INSTALL_DOC_DIR}/conf")
|
||||
set(INSTALL_SCRIPTS_DIR "${INSTALL_DOC_DIR}/scripts")
|
||||
if(FREEBSD)
|
||||
set(INSTALL_MAN_DIR "man/man1")
|
||||
else()
|
||||
set(INSTALL_MAN_DIR "share/man/man1")
|
||||
endif()
|
||||
set(INSTALL_DATA_DIR "share/${PROJECT_NAME}")
|
||||
endif(WIN32 OR CYGWIN)
|
||||
|
||||
# requirements
|
||||
|
||||
include(CheckSymbolExists)
|
||||
|
||||
# Some platforms provide their own strlcpy & strlcat. (BSD, MacOSX)
|
||||
# Others don't so we provide our own. (Windows, most, but not all Linux)
|
||||
# Here we detect whether these are provided by the OS and set a symbol
|
||||
# so that:
|
||||
# (1) libgps does not supply its own version.
|
||||
# (2) we know whether we need to supply our own copy.
|
||||
#
|
||||
# This was all working fine until these were added to the gnu c library 2.38.
|
||||
# References:
|
||||
# - https://www.gnu.org/software/libc/sources.html
|
||||
# - https://sourceware.org/git/?p=glibc.git;a=blob_plain;f=NEWS;hb=HEAD
|
||||
#
|
||||
# This test is not detecting them for glibc 2.38 resulting in a conflict.
|
||||
# Why? Are they declared in a different file or in some strange way?
|
||||
#
|
||||
# This is how they are declared in include/string.h:
|
||||
#
|
||||
# extern __typeof (strlcpy) __strlcpy;
|
||||
# libc_hidden_proto (__strlcpy)
|
||||
# extern __typeof (strlcat) __strlcat;
|
||||
# libc_hidden_proto (__strlcat)
|
||||
#
|
||||
# Apparently cmake does not recognize this style.
|
||||
# Keep this here for BSD type systems where it behaves as expected.
|
||||
# We will need to add a hack in direwolf.h to define these if glibc version >= 2.38.
|
||||
|
||||
check_symbol_exists(strlcpy string.h HAVE_STRLCPY)
|
||||
if(HAVE_STRLCPY)
|
||||
add_compile_options(-DHAVE_STRLCPY)
|
||||
endif()
|
||||
check_symbol_exists(strlcat string.h HAVE_STRLCAT)
|
||||
if(HAVE_STRLCAT)
|
||||
add_compile_options(-DHAVE_STRLCAT)
|
||||
endif()
|
||||
|
||||
set(THREADS_PREFER_PTHREAD_FLAG ON)
|
||||
find_package(Threads REQUIRED)
|
||||
|
||||
find_package(GPSD)
|
||||
if(GPSD_FOUND)
|
||||
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -DENABLE_GPSD")
|
||||
else()
|
||||
set(GPSD_INCLUDE_DIRS "")
|
||||
set(GPSD_LIBRARIES "")
|
||||
endif()
|
||||
|
||||
find_package(hamlib)
|
||||
if(HAMLIB_FOUND)
|
||||
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -DUSE_HAMLIB")
|
||||
else()
|
||||
set(HAMLIB_INCLUDE_DIRS "")
|
||||
set(HAMLIB_LIBRARIES "")
|
||||
endif()
|
||||
|
||||
if(LINUX)
|
||||
find_package(ALSA REQUIRED)
|
||||
if(ALSA_FOUND)
|
||||
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -DUSE_ALSA")
|
||||
endif()
|
||||
|
||||
find_package(udev)
|
||||
if(UDEV_FOUND)
|
||||
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -DUSE_CM108")
|
||||
endif()
|
||||
|
||||
find_package(Avahi)
|
||||
if(AVAHI_CLIENT_FOUND)
|
||||
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -DUSE_AVAHI_CLIENT")
|
||||
endif()
|
||||
|
||||
elseif (HAVE_SNDIO)
|
||||
find_package(sndio REQUIRED)
|
||||
if(SNDIO_FOUND)
|
||||
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -DUSE_SNDIO")
|
||||
endif()
|
||||
|
||||
elseif (NOT WIN32 AND NOT CYGWIN)
|
||||
find_package(Portaudio REQUIRED)
|
||||
if(PORTAUDIO_FOUND)
|
||||
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -DUSE_PORTAUDIO")
|
||||
endif()
|
||||
|
||||
else()
|
||||
set(ALSA_INCLUDE_DIRS "")
|
||||
set(ALSA_LIBRARIES "")
|
||||
set(UDEV_INCLUDE_DIRS "")
|
||||
set(UDEV_LIBRARIES "")
|
||||
# Version 1.7 supports CM108/CM119 GPIO PTT for Windows.
|
||||
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -DUSE_CM108")
|
||||
set(PORTAUDIO_INCLUDE_DIRS "")
|
||||
set(PORTAUDIO_LIBRARIES "")
|
||||
set(SNDIO_INCLUDE_DIRS "")
|
||||
set(SNDIO_LIBRARIES "")
|
||||
endif()
|
||||
|
||||
# manage and fetch new data
|
||||
add_subdirectory(data)
|
||||
|
||||
# external libraries
|
||||
add_subdirectory(${CUSTOM_GEOTRANZ_DIR})
|
||||
add_subdirectory(${CUSTOM_REGEX_DIR})
|
||||
add_subdirectory(${CUSTOM_HIDAPI_DIR})
|
||||
add_subdirectory(${CUSTOM_MISC_DIR})
|
||||
|
||||
# direwolf source code and utilities
|
||||
add_subdirectory(src)
|
||||
|
||||
# ctest
|
||||
if(UNITTEST)
|
||||
message(STATUS "Build unit test binaries")
|
||||
include(CTest)
|
||||
enable_testing()
|
||||
add_subdirectory(test)
|
||||
endif(UNITTEST)
|
||||
|
||||
# manage scripts
|
||||
add_subdirectory(scripts)
|
||||
|
||||
# manage config
|
||||
add_subdirectory(conf)
|
||||
|
||||
# install basic docs
|
||||
install(FILES ${CMAKE_SOURCE_DIR}/CHANGES.md DESTINATION ${INSTALL_DOC_DIR})
|
||||
install(FILES ${CMAKE_SOURCE_DIR}/LICENSE DESTINATION ${INSTALL_DOC_DIR})
|
||||
install(FILES ${CMAKE_SOURCE_DIR}/external/LICENSE DESTINATION ${INSTALL_DOC_DIR}/external)
|
||||
add_subdirectory(doc)
|
||||
add_subdirectory(man)
|
||||
|
||||
# install desktop link
|
||||
if (LINUX OR FREEBSD)
|
||||
install(FILES ${CMAKE_BINARY_DIR}/${CMAKE_PROJECT_NAME}.desktop DESTINATION share/applications)
|
||||
install(FILES ${CMAKE_SOURCE_DIR}/cmake/cpack/${CMAKE_PROJECT_NAME}_icon.png DESTINATION share/pixmaps)
|
||||
endif()
|
||||
|
||||
############ uninstall target ################
|
||||
configure_file(
|
||||
"${CMAKE_CURRENT_SOURCE_DIR}/cmake/include/uninstall.cmake.in"
|
||||
"${CMAKE_CURRENT_BINARY_DIR}/uninstall.cmake"
|
||||
IMMEDIATE @ONLY)
|
||||
|
||||
add_custom_target(uninstall
|
||||
COMMAND ${CMAKE_COMMAND} -P
|
||||
${CMAKE_CURRENT_BINARY_DIR}/uninstall.cmake)
|
||||
|
||||
############ packaging ################
|
||||
add_subdirectory(cmake/cpack)
|
|
@ -0,0 +1,36 @@
|
|||
|
||||
all:
|
||||
@echo "The build procedure has changed in version 1.6."
|
||||
@echo "In general, it now looks like this:"
|
||||
@echo " "
|
||||
@echo "Download the source code:"
|
||||
@echo " "
|
||||
@echo " cd ~"
|
||||
@echo " git clone https://www.github.com/wb2osz/direwolf"
|
||||
@echo " cd direwolf"
|
||||
@echo " "
|
||||
@echo "Optional - Do this to get the latest development version"
|
||||
@echo "rather than the latest stable release."
|
||||
@echo " "
|
||||
@echo " git checkout dev"
|
||||
@echo " "
|
||||
@echo "Build it. There are two new steps not used for earlier releases."
|
||||
@echo " "
|
||||
@echo " mkdir build && cd build"
|
||||
@echo " cmake .."
|
||||
@echo " make -j4"
|
||||
@echo " "
|
||||
@echo "Install:"
|
||||
@echo " "
|
||||
@echo " sudo make install"
|
||||
@echo " make install-conf"
|
||||
@echo " "
|
||||
@echo "You will probably need to install additional applications and"
|
||||
@echo "libraries depending on your operating system."
|
||||
@echo "More details are in the README.md file."
|
||||
@echo " "
|
||||
@echo "Questions?"
|
||||
@echo " "
|
||||
@echo " - Extensive documentation can be found in the 'doc' directory."
|
||||
@echo " - Join the discussion forum here: https://groups.io/g/direwolf"
|
||||
@echo " "
|
289
Makefile.linux
289
Makefile.linux
|
@ -1,289 +0,0 @@
|
|||
#
|
||||
# Makefile for Linux version of Dire Wolf.
|
||||
#
|
||||
|
||||
all : direwolf decode_aprs text2tt tt2text ll2utm utm2ll aclients
|
||||
|
||||
CC = gcc
|
||||
|
||||
#
|
||||
# The DSP filters can be sped up considerably with the SSE
|
||||
# instructions. The SSE instructions were introduced in 1999
|
||||
# with the Pentium III series.
|
||||
# SSE2 instructions, added in 2000, don't seem to offer any advantage.
|
||||
#
|
||||
# Let's look at impact of various optimization levels.
|
||||
#
|
||||
# Benchmark results with Ubuntu gcc version 4.6.3, 32 bit platform.
|
||||
# Intel(R) Celeron(R) CPU 2.53GHz. Appears to have only 32 bit instructions.
|
||||
#
|
||||
# seconds options, comments
|
||||
# ------ -----------------
|
||||
# 123 -O2
|
||||
# 128 -O3 Slower than -O2 ?
|
||||
# 123 -Ofast (should be same as -O3 -ffastmath)
|
||||
# 126 -Ofast -march=pentium
|
||||
# 88 -Ofast -msse
|
||||
# 108 -Ofast -march=pentium -msse
|
||||
# 88 -Ofast -march=pentium3 (this implies -msse)
|
||||
# 89 -Ofast -march=pentium3 -msse
|
||||
#
|
||||
#
|
||||
# Raspberry Pi, ARM11 (ARMv6 + VFP2)
|
||||
# gcc (Debian 4.6.3-14+rpi1) 4.6.3
|
||||
#
|
||||
# seconds options, comments
|
||||
# ------ -----------------
|
||||
# 1015 -O2
|
||||
# 948 -O3
|
||||
# 928 -Ofast
|
||||
# 937 -Ofast -fmpu=vfp (worse, no option for vfp2)
|
||||
#
|
||||
# Are we getting any vectorizing?
|
||||
#
|
||||
|
||||
|
||||
|
||||
#
|
||||
# Release 0.9 added a new feature than can consume a lot of CPU
|
||||
# power: multiple AFSK demodulators running in parallel.
|
||||
# These spend a lot of time spinning around in little loops
|
||||
# calculating the sums of products for the DSP filters.
|
||||
#
|
||||
# When gcc is generating code for a 32 bit x86 target, it
|
||||
# assumes the ancient i386 processor. This is good for
|
||||
# portability but bad for performance.
|
||||
#
|
||||
# The code can run considerably faster by taking advantage of
|
||||
# the SSE instructions available in the Pentium 3 or later.
|
||||
# Here we find out if the gcc compiler is generating code
|
||||
# for the i386. If so, we add the option to assume we will
|
||||
# have at least a Pentium 3 to run on.
|
||||
#
|
||||
# When generating code for the x86_64 target, it is automatically
|
||||
# assumed that the SSE instructions are available.
|
||||
#
|
||||
# If you are using gcc version 4.6 or later, you might get a
|
||||
# small improvement by using the new "-Ofast" option that is
|
||||
# not available in older compilers.
|
||||
# "-O3" is used here for compatibility with older compilers.
|
||||
#
|
||||
# You might also get some improvement by using "-march=native"
|
||||
# to fine tune the application for your particular type of
|
||||
# hardware.
|
||||
#
|
||||
# If you are planning to distribute the binary version to
|
||||
# other people (in some ham radio software collection), avoid
|
||||
# fine tuning it for your particular computer. It could
|
||||
# cause compatibility issues for those with older computers.
|
||||
#
|
||||
|
||||
arch := $(shell echo | gcc -E -dM - | grep __i386__)
|
||||
|
||||
ifneq ($(arch),)
|
||||
CFLAGS := -DUSE_ALSA -O3 -march=pentium3 -pthread
|
||||
else
|
||||
CFLAGS := -DUSE_ALSA -O3 -pthread
|
||||
endif
|
||||
|
||||
|
||||
# Uncomment following lines to enable GPS interface.
|
||||
# DO NOT USE THIS. Still needs more work.
|
||||
#CFLAGS += -DENABLE_GPS
|
||||
#LDLIBS += -lgps
|
||||
|
||||
|
||||
# Name of current directory.
|
||||
# Used to generate zip file name for distribution.
|
||||
|
||||
z=$(notdir ${CURDIR})
|
||||
|
||||
|
||||
# Main application.
|
||||
|
||||
direwolf : direwolf.o config.o demod.o dsp.o demod_afsk.o demod_9600.o hdlc_rec.o \
|
||||
hdlc_rec2.o multi_modem.o redecode.o rdq.o rrbb.o \
|
||||
fcs_calc.o ax25_pad.o \
|
||||
decode_aprs.o symbols.o server.o kiss.o kissnet.o kiss_frame.o hdlc_send.o fcs_calc.o \
|
||||
gen_tone.o audio.o digipeater.o dedupe.o tq.o xmit.o \
|
||||
ptt.o beacon.o dwgps.o encode_aprs.o latlong.o encode_aprs.o latlong.o textcolor.o \
|
||||
dtmf.o aprs_tt.o tt_user.o tt_text.o igate.o \
|
||||
utm.a
|
||||
$(CC) $(CFLAGS) -o $@ $^ -lpthread -lrt -lasound $(LDLIBS) -lm
|
||||
|
||||
|
||||
# Optimization for slow processors.
|
||||
|
||||
demod.o : fsk_fast_filter.h
|
||||
|
||||
demod_afsk.o : fsk_fast_filter.h
|
||||
|
||||
|
||||
fsk_fast_filter.h : demod_afsk.c
|
||||
$(CC) $(CFLAGS) -o gen_fff -DGEN_FFF demod_afsk.c dsp.c textcolor.c -lm
|
||||
./gen_fff > fsk_fast_filter.h
|
||||
|
||||
|
||||
|
||||
utm.a : LatLong-UTMconversion.o
|
||||
ar -cr $@ $^
|
||||
|
||||
LatLong-UTMconversion.o : utm/LatLong-UTMconversion.c
|
||||
$(CC) $(CFLAGS) -c -o $@ $^
|
||||
|
||||
|
||||
# Optional install step.
|
||||
# TODO: Review file locations.
|
||||
# TODO: Handle Linux variations correctly.
|
||||
# The Raspberry Pi has ~/Desktop but Ubuntu does not.
|
||||
# For now, just put reference to it at the end so only last step fails.
|
||||
|
||||
install : direwolf decode_aprs tocalls.txt symbols-new.txt symbolsX.txt dw-icon.png direwolf.desktop
|
||||
sudo install direwolf /usr/local/bin
|
||||
sudo install decode_aprs /usr/local/bin
|
||||
sudo install text2tt /usr/local/bin
|
||||
sudo install tt2text /usr/local/bin
|
||||
sudo install ll2utm /usr/local/bin
|
||||
sudo install utm2ll /usr/local/bin
|
||||
sudo install aclients /usr/local/bin
|
||||
sudo install -D --mode=644 tocalls.txt /usr/share/direwolf/tocalls.txt
|
||||
sudo install -D --mode=644 symbols-new.txt /usr/share/direwolf/symbols-new.txt
|
||||
sudo install -D --mode=644 symbolsX.txt /usr/share/direwolf/symbolsX.txt
|
||||
sudo install -D --mode=644 dw-icon.png /usr/share/direwolf/dw-icon.png
|
||||
sudo install -D --mode=644 direwolf.desktop /usr/share/applications/direwolf.desktop
|
||||
cp direwolf.conf ~
|
||||
cp dw-start.sh ~
|
||||
sudo install -D --mode=644 CHANGES.txt /usr/local/share/doc/direwolf/CHANGES.txt
|
||||
sudo install -D --mode=644 LICENSE-dire-wolf.txt /usr/local/share/doc/direwolf/LICENSE-dire-wolf.txt
|
||||
sudo install -D --mode=644 LICENSE-other.txt /usr/local/share/doc/direwolf/LICENSE-other.txt
|
||||
sudo install -D --mode=644 User-Guide.pdf /usr/local/share/doc/direwolf/User-Guide.pdf
|
||||
sudo install -D --mode=644 Raspberry-Pi-APRS.pdf /usr/local/share/doc/direwolf/Raspberry-Pi-APRS.pdf
|
||||
sudo install -D --mode=644 APRStt-Implementation-Notes.pdf /usr/local/share/doc/direwolf/APRStt-Implementation-Notes.pdf
|
||||
sudo install -D --mode=644 Quick-Start-Guide-Windows.pdf /usr/local/share/doc/direwolf/Quick-Start-Guide-Windows.pdf
|
||||
ln -f -s /usr/share/applications/direwolf.desktop ~/Desktop/direwolf.desktop
|
||||
|
||||
|
||||
# Separate application to decode raw data.
|
||||
|
||||
decode_aprs : decode_aprs.c symbols.c ax25_pad.c textcolor.c fcs_calc.c
|
||||
$(CC) $(CFLAGS) -o decode_aprs -DTEST $^ -lm
|
||||
|
||||
|
||||
|
||||
# Convert between text and touch tone representation.
|
||||
|
||||
text2tt : tt_text.c
|
||||
$(CC) $(CFLAGS) -DENC_MAIN -o text2tt tt_text.c
|
||||
|
||||
tt2text : tt_text.c
|
||||
$(CC) $(CFLAGS) -DDEC_MAIN -o tt2text tt_text.c
|
||||
|
||||
|
||||
# Convert between Latitude/Longitude and UTM coordinates.
|
||||
|
||||
ll2utm : ll2utm.c utm.a
|
||||
$(CC) $(CFLAGS) -I utm -o $@ $^ -lm
|
||||
|
||||
utm2ll : utm2ll.c utm.a
|
||||
$(CC) $(CFLAGS) -I utm -o $@ $^ -lm
|
||||
|
||||
|
||||
|
||||
# Test application to generate sound.
|
||||
|
||||
gen_packets : gen_packets.c ax25_pad.c hdlc_send.c fcs_calc.c gen_tone.c textcolor.c
|
||||
$(CC) $(CFLAGS) -o $@ $^ -lasound -lm
|
||||
|
||||
demod.o : tune.h
|
||||
demod_afsk.o : tune.h
|
||||
demod_9600.o : tune.h
|
||||
|
||||
testagc : atest.c demod.c dsp.c demod_afsk.c demod_9600.c hdlc_rec.c hdlc_rec2.o multi_modem.o rrbb.o fcs_calc.c ax25_pad.c decode_aprs.c symbols.c tune.h textcolor.c
|
||||
$(CC) $(CFLAGS) -o atest $^ -lm
|
||||
./atest 02_Track_2.wav | grep "packets decoded in" > atest.out
|
||||
|
||||
|
||||
# Unit test for AFSK demodulator
|
||||
|
||||
|
||||
atest : atest.c demod.c dsp.c demod_afsk.c demod_9600.c hdlc_rec.c hdlc_rec2.o multi_modem.o rrbb.o fcs_calc.c ax25_pad.c decode_aprs.c symbols.c textcolor.c
|
||||
$(CC) $(CFLAGS) -o $@ $^ -lm
|
||||
time ./atest ../direwolf-0.2/02_Track_2.wav
|
||||
|
||||
# Unit test for inner digipeater algorithm
|
||||
|
||||
|
||||
dtest : digipeater.c ax25_pad.c dedupe.c fcs_calc.c tq.c textcolor.c
|
||||
$(CC) $(CFLAGS) -DTEST -o $@ $^
|
||||
./dtest
|
||||
|
||||
|
||||
# Unit test for IGate
|
||||
|
||||
|
||||
itest : igate.c textcolor.c ax25_pad.c fcs_calc.c
|
||||
$(CC) $(CFLAGS) -DITEST -o $@ $^
|
||||
./itest
|
||||
|
||||
|
||||
# Unit test for UDP reception with AFSK demodulator
|
||||
|
||||
udptest : udp_test.c demod.c dsp.c demod_afsk.c demod_9600.c hdlc_rec.c hdlc_rec2.c multi_modem.c rrbb.c fcs_calc.c ax25_pad.c decode_aprs.c symbols.c textcolor.c
|
||||
$(CC) $(CFLAGS) -o $@ $^ -lm -lrt
|
||||
./udptest
|
||||
|
||||
|
||||
# Multiple AGWPE network or serial port clients to test TNCs side by side.
|
||||
|
||||
aclients : aclients.c ax25_pad.c fcs_calc.c textcolor.c
|
||||
$(CC) $(CFLAGS) -g -o $@ $^
|
||||
|
||||
|
||||
SRCS = direwolf.c demod.c dsp.c demod_afsk.c demod_9600.c hdlc_rec.c multi_modem.c fcs_calc.c ax25_pad.c decode_aprs.c symbols.c \
|
||||
server.c kiss.c kissnet.c kiss_frame.c hdlc_send.c fcs_calc.c gen_tone.c audio.c \
|
||||
digipeater.c dedupe.c tq.c xmit.c beacon.c encode_aprs.c latlong.c encode_aprs.c latlong.c
|
||||
|
||||
|
||||
depend : $(SRCS)
|
||||
makedepend $(INCLUDES) $^
|
||||
|
||||
|
||||
clean :
|
||||
rm -f direwolf decode_aprs text2tt tt2text ll2utm utm2ll fsk_fast_filter.h *.o *.a
|
||||
echo " " > tune.h
|
||||
|
||||
|
||||
# Package it up for distribution.
|
||||
|
||||
dist-src : CHANGES.txt User-Guide.pdf Quick-Start-Guide-Windows.pdf Raspberry-Pi-APRS.pdf \
|
||||
direwolf.desktop dw-start.sh
|
||||
rm -f fsk_fast_filter.h
|
||||
echo " " > tune.h
|
||||
rm -f ../$z-src.zip
|
||||
(cd .. ; zip $z-src.zip $z/CHANGES.txt $z/LICENSE* \
|
||||
$z/User-Guide.pdf $z/Quick-Start-Guide-Windows.pdf $z/Raspberry-Pi-APRS.pdf \
|
||||
$z/Makefile* $z/*.c $z/*.h $z/regex/* $z/misc/* $z/utm/* \
|
||||
$z/*.conf $z/tocalls.txt $z/symbols-new.txt $z/symbolsX.txt \
|
||||
$z/dw-icon.png $z/dw-icon.rc $z/dw-icon.ico \
|
||||
$z/direwolf.desktop $z/dw-start.sh )
|
||||
|
||||
|
||||
#User-Guide.pdf : User-Guide.docx
|
||||
# echo "***** User-Guide.pdf is out of date *****"
|
||||
|
||||
#Quick-Start-Guide-Windows.pdf : Quick-Start-Guide-Windows.docx
|
||||
# echo "***** Quick-Start-Guide-Windows.pdf is out of date *****"
|
||||
|
||||
#Raspberry-Pi-APRS.pdf : Raspberry-Pi-APRS.docx
|
||||
# echo "***** Raspberry-Pi-APRS.pdf is out of date *****"
|
||||
|
||||
|
||||
backup :
|
||||
mkdir /cygdrive/e/backup-cygwin-home/`date +"%Y-%m-%d"`
|
||||
cp -r . /cygdrive/e/backup-cygwin-home/`date +"%Y-%m-%d"`
|
||||
|
||||
#
|
||||
# The following is updated by "make depend"
|
||||
#
|
||||
# DO NOT DELETE
|
||||
|
326
Makefile.win
326
Makefile.win
|
@ -1,326 +0,0 @@
|
|||
#
|
||||
# Makefile for native Windows version of Dire Wolf.
|
||||
#
|
||||
#
|
||||
# This is built in the Cygwin environment but with the
|
||||
# compiler from http://www.mingw.org/ so there is no
|
||||
# dependency on extra DLLs.
|
||||
#
|
||||
# The MinGW/bin directory must be in the PATH for the
|
||||
# compiler. e.g. export PATH=/cygdrive/c/MinGW/bin:$PATH
|
||||
#
|
||||
# Failure to have the path set correctly will result in the
|
||||
# obscure message: Makefile.win:... recipe for target ... failed.
|
||||
#
|
||||
# Type "which gcc" to make sure you are getting the right one!
|
||||
#
|
||||
|
||||
|
||||
all : direwolf decode_aprs text2tt tt2text ll2utm utm2ll aclients
|
||||
|
||||
|
||||
# People say we need -mthreads option for threads to work properly.
|
||||
# They also say it creates a dependency on mingwm10.dll but I'm not seeing that.
|
||||
|
||||
#TODO: put -Ofast back in.
|
||||
|
||||
CC = gcc
|
||||
#CFLAGS = -g -Wall -Ofast -march=pentium3 -msse -Iregex -mthreads -DUSE_REGEX_STATIC
|
||||
CFLAGS = -g -Wall -march=pentium3 -msse -Iregex -mthreads -DUSE_REGEX_STATIC
|
||||
AR = ar
|
||||
|
||||
|
||||
#
|
||||
# Let's see impact of various optimization levels.
|
||||
# Benchmark results with MinGW gcc version 4.6.2.
|
||||
#
|
||||
# seconds options, comments
|
||||
# ------ -----------------
|
||||
# 119.8 -O2 Used for version 0.8
|
||||
# 92.1 -O3
|
||||
# 88.7 -Ofast (should be same as -O3 -ffastmath)
|
||||
# 87.5 -Ofast -march=pentium
|
||||
# 74.1 -Ofast -msse
|
||||
# 72.2 -Ofast -march=pentium -msse
|
||||
# 62.0 -Ofast -march=pentium3 (this implies -msse)
|
||||
# 61.9 -Ofast -march=pentium3 -msse
|
||||
#
|
||||
# A minimum of Windows XP is required due to some of the system
|
||||
# features being used. XP requires a Pentium processor or later.
|
||||
# The DSP filters can be sped up considerably with the SSE instructions.
|
||||
# The SSE instructions were introduced in 1999 with the
|
||||
# Pentium III series.
|
||||
# SSE2 instructions, added in 2000, don't seem to offer any advantage.
|
||||
#
|
||||
# For version 0.9, a Pentium 3 or equivalent is now the minimum required
|
||||
# for the prebuilt Windows distribution.
|
||||
# If you insist on using a computer from the previous century,
|
||||
# you can compile this yourself with different options.
|
||||
#
|
||||
|
||||
# Name of zip file for distribution.
|
||||
|
||||
z=$(notdir ${CURDIR})
|
||||
|
||||
|
||||
|
||||
# Main application.
|
||||
|
||||
demod.o : fsk_demod_state.h
|
||||
demod_9600.o : fsk_demod_state.h
|
||||
demod_afsk.o : fsk_demod_state.h
|
||||
|
||||
|
||||
direwolf : direwolf.o config.o demod.o dsp.o demod_afsk.o demod_9600.o hdlc_rec.o \
|
||||
hdlc_rec2.o multi_modem.o redecode.o rdq.o rrbb.o \
|
||||
fcs_calc.o ax25_pad.o \
|
||||
decode_aprs.o symbols.o server.o kiss.o kissnet.o kiss_frame.o hdlc_send.o fcs_calc.o \
|
||||
gen_tone.o audio_win.o digipeater.o dedupe.o tq.o xmit.o \
|
||||
ptt.o beacon.o dwgps.o encode_aprs.o latlong.o textcolor.o \
|
||||
dtmf.o aprs_tt.o tt_user.o tt_text.o igate.o \
|
||||
dw-icon.o regex.a misc.a utm.a
|
||||
$(CC) $(CFLAGS) -g -o $@ $^ -lwinmm -lws2_32
|
||||
|
||||
dw-icon.o : dw-icon.rc dw-icon.ico
|
||||
windres dw-icon.rc -o $@
|
||||
|
||||
|
||||
# Optimization for slow processors.
|
||||
|
||||
demod.o : fsk_fast_filter.h
|
||||
|
||||
demod_afsk.o : fsk_fast_filter.h
|
||||
|
||||
|
||||
fsk_fast_filter.h : demod_afsk.c
|
||||
$(CC) $(CFLAGS) -o gen_fff -DGEN_FFF demod_afsk.c dsp.c textcolor.c
|
||||
./gen_fff > fsk_fast_filter.h
|
||||
|
||||
|
||||
utm.a : LatLong-UTMconversion.o
|
||||
ar -cr $@ $^
|
||||
|
||||
LatLong-UTMconversion.o : utm/LatLong-UTMconversion.c
|
||||
$(CC) $(CFLAGS) -c -o $@ $^
|
||||
|
||||
|
||||
#
|
||||
# When building for Linux, we use regular expression
|
||||
# functions supplied by the gnu C library.
|
||||
# For the native WIN32 version, we need to use our own copy.
|
||||
# These were copied from http://gnuwin32.sourceforge.net/packages/regex.htm
|
||||
#
|
||||
|
||||
regex.a : regex.o
|
||||
ar -cr $@ $^
|
||||
|
||||
regex.o : regex/regex.c
|
||||
$(CC) $(CFLAGS) -Dbool=int -Dtrue=1 -Dfalse=0 -c -o $@ $^
|
||||
|
||||
|
||||
# There are also a couple other functions in the misc
|
||||
# subdirectory that are missing on Windows.
|
||||
|
||||
misc.a : strsep.o strtok_r.o strcasestr.o
|
||||
ar -cr $@ $^
|
||||
|
||||
strsep.o : misc/strsep.c
|
||||
$(CC) $(CFLAGS) -c -o $@ $^
|
||||
|
||||
strtok_r.o : misc/strtok_r.c
|
||||
$(CC) $(CFLAGS) -c -o $@ $^
|
||||
|
||||
strcasestr.o : misc/strcasestr.c
|
||||
$(CC) $(CFLAGS) -c -o $@ $^
|
||||
|
||||
|
||||
|
||||
# Separate application to decode raw data.
|
||||
|
||||
decode_aprs : decode_aprs.c symbols.c ax25_pad.c textcolor.c fcs_calc.c regex.a misc.a
|
||||
$(CC) $(CFLAGS) -o decode_aprs -DTEST $^
|
||||
|
||||
|
||||
# Convert between text and touch tone representation.
|
||||
|
||||
text2tt : tt_text.c
|
||||
$(CC) $(CFLAGS) -DENC_MAIN -o text2tt tt_text.c
|
||||
|
||||
tt2text : tt_text.c
|
||||
$(CC) $(CFLAGS) -DDEC_MAIN -o tt2text tt_text.c
|
||||
|
||||
|
||||
# Convert between Latitude/Longitude and UTM coordinates.
|
||||
|
||||
ll2utm : ll2utm.c utm.a
|
||||
$(CC) $(CFLAGS) -I utm -o $@ $^
|
||||
|
||||
utm2ll : utm2ll.c utm.a
|
||||
$(CC) $(CFLAGS) -I utm -o $@ $^
|
||||
|
||||
|
||||
# Test application to generate sound.
|
||||
|
||||
gen_packets : gen_packets.o ax25_pad.o hdlc_send.o fcs_calc.o gen_tone.o textcolor.o misc.a regex.a
|
||||
$(CC) $(CFLAGS) -o $@ $^
|
||||
|
||||
# For tweaking the demodulator.
|
||||
|
||||
demod.o : tune.h
|
||||
demod_9600.o : tune.h
|
||||
demod_afsk.o : tune.h
|
||||
|
||||
|
||||
testagc : atest.c demod.c dsp.c demod_afsk.c demod_9600.c hdlc_rec.c hdlc_rec2.c multi_modem.c \
|
||||
rrbb.c fcs_calc.c ax25_pad.c decode_aprs.c symbols.c textcolor.c regex.a misc.a \
|
||||
fsk_demod_agc.h
|
||||
rm -f atest.exe
|
||||
$(CC) $(CFLAGS) -DNOFIX -o atest $^
|
||||
./atest ../direwolf-0.2/02_Track_2.wav | grep "packets decoded in" >atest.out
|
||||
|
||||
|
||||
noisy3.wav : gen_packets
|
||||
./gen_packets -B 300 -n 100 -o noisy3.wav
|
||||
|
||||
testagc3 : atest.c demod.c dsp.c demod_afsk.c demod_9600.c hdlc_rec.c hdlc_rec2.c multi_modem.c \
|
||||
rrbb.c fcs_calc.c ax25_pad.c decode_aprs.c symbols.c textcolor.c regex.a misc.a \
|
||||
tune.h
|
||||
rm -f atest.exe
|
||||
$(CC) $(CFLAGS) -o atest $^
|
||||
./atest -B 300 -P D -D 3 noisy3.wav | grep "packets decoded in" >atest.out
|
||||
|
||||
|
||||
noisy96.wav : gen_packets
|
||||
./gen_packets -B 9600 -n 100 -o noisy96.wav
|
||||
|
||||
testagc9 : atest.c demod.c dsp.c demod_afsk.c demod_9600.c hdlc_rec.c hdlc_rec2.c multi_modem.c \
|
||||
rrbb.c fcs_calc.c ax25_pad.c decode_aprs.c symbols.c textcolor.c regex.a misc.a \
|
||||
tune.h
|
||||
rm -f atest.exe
|
||||
$(CC) $(CFLAGS) -o atest $^
|
||||
./atest -B 9600 ../walkabout9600.wav | grep "packets decoded in" >atest.out
|
||||
#./atest -B 9600 noisy96.wav | grep "packets decoded in" >atest.out
|
||||
|
||||
|
||||
# Unit test for AFSK demodulator
|
||||
|
||||
|
||||
atest : atest.c demod.c dsp.c demod_afsk.c demod_9600.c hdlc_rec.c hdlc_rec2.c multi_modem.c \
|
||||
rrbb.c fcs_calc.c ax25_pad.c decode_aprs.c symbols.c textcolor.c misc.a regex.a \
|
||||
fsk_fast_filter.h
|
||||
$(CC) $(CFLAGS) -o $@ $^
|
||||
echo " " > tune.h
|
||||
./atest ..\\direwolf-0.2\\02_Track_2.wav
|
||||
|
||||
atest9 : atest.c demod.c dsp.c demod_afsk.c demod_9600.c hdlc_rec.c hdlc_rec2.c multi_modem.c \
|
||||
rrbb.c fcs_calc.c ax25_pad.c decode_aprs.c symbols.c textcolor.c misc.a regex.a \
|
||||
fsk_fast_filter.h
|
||||
$(CC) $(CFLAGS) -o $@ $^
|
||||
./atest9 -B 9600 ../walkabout9600.wav | grep "packets decoded in" >atest.out
|
||||
#./atest9 -B 9600 noise96.wav
|
||||
|
||||
|
||||
# Unit test for inner digipeater algorithm
|
||||
|
||||
|
||||
dtest : digipeater.c ax25_pad.c dedupe.c fcs_calc.c tq.c textcolor.c misc.a regex.a
|
||||
$(CC) $(CFLAGS) -DTEST -o $@ $^
|
||||
./dtest
|
||||
rm dtest.exe
|
||||
|
||||
# Unit test for APRStt.
|
||||
|
||||
ttest : aprs_tt.c tt_text.c misc.a utm.a
|
||||
$(CC) $(CFLAGS) -DTT_MAIN -o ttest aprs_tt.c tt_text.c misc.a utm.a
|
||||
|
||||
|
||||
# Unit test for IGate
|
||||
|
||||
itest : igate.c textcolor.c ax25_pad.c fcs_calc.c misc.a regex.a
|
||||
$(CC) $(CFLAGS) -DITEST -g -o $@ $^ -lwinmm -lws2_32
|
||||
|
||||
|
||||
# Unit test for UDP reception with AFSK demodulator
|
||||
|
||||
udptest : udp_test.c demod.c dsp.c demod_afsk.c demod_9600.c hdlc_rec.c hdlc_rec2.c multi_modem.c rrbb.c fcs_calc.c ax25_pad.c decode_aprs.c symbols.c textcolor.c
|
||||
$(CC) $(CFLAGS) -o $@ $^ -lm -lrt
|
||||
./udptest
|
||||
|
||||
|
||||
# Multiple AGWPE network or serial port clients to test TNCs side by side.
|
||||
|
||||
aclients : aclients.c ax25_pad.c fcs_calc.c textcolor.c misc.a regex.a
|
||||
$(CC) $(CFLAGS) -g -o $@ $^ -lwinmm -lws2_32
|
||||
|
||||
|
||||
SRCS = direwolf.c demod.c dsp.c demod_afsk.c demod_9600.c hdlc_rec.c \
|
||||
hdlc_rec2.c multi_modem.c redecode.c rdq.c rrbb.c \
|
||||
fcs_calc.c ax25_pad.c decode_aprs.c symbols.c \
|
||||
server.c kiss.c kissnet.c kiss_frame.c hdlc_send.c fcs_calc.c gen_tone.c audio_win.c \
|
||||
digipeater.c dedupe.c tq.c xmit.c beacon.c \
|
||||
encode_aprs.c latlong.c \
|
||||
dtmf.c aprs_tt.c tt_text.c igate.c
|
||||
|
||||
|
||||
depend : $(SRCS)
|
||||
makedepend $(INCLUDES) $^
|
||||
|
||||
|
||||
clean :
|
||||
rm -f *.o *.a *.exe fsk_fast_filter.h noisy96.wav
|
||||
echo " " > tune.h
|
||||
|
||||
|
||||
# Package it up for distribution: Prebuilt Windows & source versions.
|
||||
|
||||
|
||||
dist-win : direwolf.exe decode_aprs.exe CHANGES.txt User-Guide.pdf Quick-Start-Guide-Windows.pdf \
|
||||
Raspberry-Pi-APRS.pdf APRStt-Implementation-Notes.pdf
|
||||
rm -f ../$z-win.zip
|
||||
zip ../$z-win.zip CHANGES.txt User-Guide.pdf Quick-Start-Guide-Windows.pdf \
|
||||
Raspberry-Pi-APRS.pdf APRStt-Implementation-Notes.pdf LICENSE* *.conf \
|
||||
direwolf.exe decode_aprs.exe tocalls.txt symbols-new.txt symbolsX.txt \
|
||||
text2tt.exe tt2text.exe ll2utm.exe utm2ll.exe aclients.exe
|
||||
|
||||
dist-src : CHANGES.txt User-Guide.pdf Quick-Start-Guide-Windows.pdf Raspberry-Pi-APRS.pdf \
|
||||
APRStt-Implementation-Notes.pdf \
|
||||
direwolf.desktop dw-start.sh \
|
||||
tocalls.txt symbols-new.txt symbolsX.txt
|
||||
rm -f fsk_fast_filter.h
|
||||
echo " " > tune.h
|
||||
rm -f ../$z-src.zip
|
||||
(cd .. ; zip $z-src.zip \
|
||||
$z/CHANGES.txt $z/LICENSE* \
|
||||
$z/User-Guide.pdf $z/Quick-Start-Guide-Windows.pdf \
|
||||
$z/Raspberry-Pi-APRS.pdf $z/APRStt-Implementation-Notes.pdf \
|
||||
$z/Makefile* $z/*.c $z/*.h $z/regex/* $z/misc/* $z/utm/* \
|
||||
$z/*.conf $z/tocalls.txt $z/symbols-new.txt $z/symbolsX.txt \
|
||||
$z/dw-icon.png $z/dw-icon.rc $z/dw-icon.ico \
|
||||
$z/direwolf.desktop $z/dw-start.sh )
|
||||
|
||||
|
||||
|
||||
User-Guide.pdf : User-Guide.docx
|
||||
echo "***** User-Guide.pdf is out of date *****"
|
||||
|
||||
Quick-Start-Guide-Windows.pdf : Quick-Start-Guide-Windows.docx
|
||||
echo "***** Quick-Start-Guide-Windows.pdf is out of date *****"
|
||||
|
||||
Raspberry-Pi-APRS.pdf : Raspberry-Pi-APRS.docx
|
||||
echo "***** Raspberry-Pi-APRS.pdf is out of date *****"
|
||||
|
||||
APRStt-Implementation-Notes.pdf : APRStt-Implementation-Notes.docx
|
||||
echo "***** APRStt-Implementation-Notes.pdf is out of date *****"
|
||||
|
||||
|
||||
backup :
|
||||
mkdir /cygdrive/e/backup-cygwin-home/`date +"%Y-%m-%d"`
|
||||
cp -r . /cygdrive/e/backup-cygwin-home/`date +"%Y-%m-%d"`
|
||||
|
||||
#
|
||||
# The following is updated by "make depend"
|
||||
#
|
||||
# DO NOT DELETE
|
||||
|
||||
|
||||
|
Binary file not shown.
|
@ -0,0 +1,235 @@
|
|||
|
||||
# Dire Wolf #
|
||||
|
||||
### Decoded Information from Radio Emissions for Windows Or Linux Fans ###
|
||||
|
||||
In the early days of Amateur Packet Radio, it was necessary to use an expensive "Terminal Node Controller" (TNC) with specialized hardware. Those days are gone. You can now get better results at lower cost by connecting your radio to the "soundcard" interface of a computer and using software to decode the signals.
|
||||
|
||||
Why waste $200 and settle for mediocre receive performance from a 1980's technology TNC using an old modem chip? Dire Wolf decodes over 1000 error-free frames from Track 2 of the [WA8LMF TNC Test CD](https://github.com/wb2osz/direwolf/tree/dev/doc/WA8LMF-TNC-Test-CD-Results.pdf), leaving all the hardware TNCs, and first generation "soundcard" modems, behind in the dust.
|
||||
|
||||

|
||||
|
||||
Dire Wolf includes [FX.25](https://en.wikipedia.org/wiki/FX.25_Forward_Error_Correction) which adds Forward Error Correction (FEC) in a way that is completely compatible with existing systems. If both ends are capable of FX.25, your information will continue to get through under conditions where regular AX.25 is completely useless. This was originally developed for satellites and is now seeing widespread use on HF.
|
||||
|
||||

|
||||
|
||||
Version 1.7 adds [IL2P](https://en.wikipedia.org/wiki/Improved_Layer_2_Protocol), a different method of FEC with less overhead but it is not compatible with AX.25.
|
||||
|
||||
|
||||
|
||||
### Dire Wolf is a modern software replacement for the old 1980's style TNC built with special hardware. ###
|
||||
|
||||
Without any additional software, it can perform as:
|
||||
|
||||
- APRS GPS Tracker
|
||||
- Digipeater
|
||||
- Internet Gateway (IGate)
|
||||
- [APRStt](http://www.aprs.org/aprstt.html) gateway
|
||||
|
||||
|
||||
It can also be used as a virtual TNC for other applications such as [APRSIS32](http://aprsisce.wikidot.com/), [Xastir](http://xastir.org/index.php/Main_Page), [APRS-TW](http://aprstw.blandranch.net/), [YAAC](http://www.ka2ddo.org/ka2ddo/YAAC.html), [PinPoint APRS](http://www.pinpointaprs.com/), [UI-View32](http://www.ui-view.net/),[UISS](http://users.belgacom.net/hamradio/uiss.htm), [Linux AX25](http://www.linux-ax25.org/wiki/Main_Page), [SARTrack](http://www.sartrack.co.nz/index.html), [Winlink Express (formerly known as RMS Express, formerly known as Winlink 2000 or WL2K)](http://www.winlink.org/RMSExpress), [BPQ32](http://www.cantab.net/users/john.wiseman/Documents/BPQ32.html), [Outpost PM](http://www.outpostpm.org/), [Ham Radio of Things](https://github.com/wb2osz/hrot), [Packet Compressed Sensing Imaging (PCSI)](https://maqifrnswa.github.io/PCSI/), and many others.
|
||||
|
||||
|
||||
## Features & Benefits ##
|
||||
|
||||

|
||||
|
||||
### Dire Wolf includes: ###
|
||||
|
||||
|
||||
|
||||
- **Beaconing, Tracker, Telemetry Toolkit.**
|
||||
|
||||
Send periodic beacons to provide information to others. For tracking the location is provided by a GPS receiver.
|
||||
Build your own telemetry applications with the toolkit.
|
||||
|
||||
|
||||
- **APRStt Gateway.**
|
||||
|
||||
Very few hams have portable equipment for APRS but nearly everyone has a handheld radio that can send DTMF tones. APRStt allows a user, equipped with only DTMF (commonly known as Touch Tone) generation capability, to enter information into the global APRS data network. Responses can be sent by Morse Code or synthesized speech.
|
||||
|
||||
- **Digipeaters for APRS and traditional Packet Radio.**
|
||||
|
||||
Extend the range of other stations by re-transmitting their signals. Unmatched flexibility for cross band repeating and filtering to limit what is retransmitted.
|
||||
|
||||
- **Internet Gateway (IGate).**
|
||||
|
||||
IGate stations allow communication between disjoint radio networks by allowing some content to flow between them over the Internet.
|
||||
|
||||
- **Ham Radio of Things (HRoT).**
|
||||
|
||||
There have been occasional mentions of merging Ham Radio with the Internet of Things but only ad hoc incompatible narrowly focused applications. Here is a proposal for a standardized more flexible method so different systems can communicate with each other.
|
||||
|
||||
[Ham Radio of Things - IoT over Ham Radio](https://github.com/wb2osz/hrot)
|
||||
|
||||
- **AX.25 v2.2 Link Layer.**
|
||||
|
||||
Traditional connected mode packet radio where the TNC automatically retries transmissions and delivers data in the right order.
|
||||
|
||||
- **KISS Interface (TCP/IP, serial port, Bluetooth) & AGW network Interface (TCP/IP).**
|
||||
|
||||
Dire Wolf can be used as a virtual TNC for applications such as [APRSIS32](http://aprsisce.wikidot.com/), [Xastir](http://xastir.org/index.php/Main_Page), [APRS-TW](http://aprstw.blandranch.net/), [YAAC](http://www.ka2ddo.org/ka2ddo/YAAC.html), [PinPoint APRS](http://www.pinpointaprs.com/), [UI-View32](http://www.ui-view.net/),[UISS](http://users.belgacom.net/hamradio/uiss.htm), [Linux AX25](http://www.linux-ax25.org/wiki/Main_Page), [SARTrack](http://www.sartrack.co.nz/index.html), [Winlink Express (formerly known as RMS Express, formerly known as Winlink 2000 or WL2K)](http://www.winlink.org/RMSExpress), [BPQ32](http://www.cantab.net/users/john.wiseman/Documents/BPQ32.html), [Outpost PM](http://www.outpostpm.org/), [Ham Radio of Things](https://github.com/wb2osz/hrot), [Packet Compressed Sensing Imaging (PCSI)](https://maqifrnswa.github.io/PCSI/), and many others.
|
||||
|
||||
### Radio Interfaces: ###
|
||||
|
||||
- **Uses computer's "soundcard" and digital signal processing.**
|
||||
|
||||
Lower cost and better performance than specialized hardware.
|
||||
|
||||
Compatible interfaces include [DRAWS](http://nwdigitalradio.com/draws/), [UDRC](https://nw-digital-radio.groups.io/g/udrc/wiki/UDRC%E2%84%A2-and-Direwolf-Packet-Modem), [SignaLink USB](http://www.tigertronics.com/slusbmain.htm), [DMK URI](http://www.dmkeng.com/URI_Order_Page.htm), [RB-USB RIM](http://www.repeater-builder.com/products/usb-rim-lite.html), [RA-35](http://www.masterscommunications.com/products/radio-adapter/ra35.html), [DINAH](https://hamprojects.info/dinah/), [SHARI](https://hamprojects.info/shari/), and many others.
|
||||
|
||||
|
||||
|
||||
- **Modems:**
|
||||
|
||||
300 bps AFSK for HF
|
||||
|
||||
1200 bps AFSK most common for VHF/UHF
|
||||
|
||||
2400 & 4800 bps PSK
|
||||
|
||||
9600 bps GMSK/G3RUH
|
||||
|
||||
AIS reception
|
||||
|
||||
EAS SAME reception
|
||||
|
||||
|
||||
|
||||
- **DTMF ("Touch Tone") Decoding and Encoding.**
|
||||
|
||||
- **Speech Synthesizer interface & Morse code generator.**
|
||||
|
||||
Transmit human understandable messages.
|
||||
|
||||
- **Compatible with Software Defined Radios such as gqrx, rtl_fm, and SDR#.**
|
||||
|
||||
- **Concurrent operation with up to 3 soundcards and 6 radios.**
|
||||
|
||||
### Portable & Open Source: ###
|
||||
|
||||
- **Runs on Windows, Linux (PC/laptop, Raspberry Pi, etc.), Mac OSX.**
|
||||
|
||||
|
||||
|
||||
## Documentation ##
|
||||
|
||||
|
||||
[Stable Version](https://github.com/wb2osz/direwolf/tree/master/doc)
|
||||
|
||||
[Latest Development Version ("dev" branch)](https://github.com/wb2osz/direwolf/tree/dev/doc)
|
||||
|
||||
[Additional Topics](https://github.com/wb2osz/direwolf-doc)
|
||||
|
||||
[Power Point presentations](https://github.com/wb2osz/direwolf-presentation) -- Why not give a talk at a local club meeting?
|
||||
|
||||
Youtube has many interesting and helpful videos. Searching for [direwolf tnc](https://www.youtube.com/results?search_query=direwolf+tnc) or [direwolf aprs](https://www.youtube.com/results?search_query=direwolf+aprs) will produce the most relevant results.
|
||||
|
||||
## Installation ##
|
||||
|
||||
### Windows ###
|
||||
|
||||
Go to the [**releases** page](https://github.com/wb2osz/direwolf/releases). Download a zip file with "win" in its name, unzip it, and run direwolf.exe from a command window.
|
||||
|
||||
You can also build it yourself from source. For more details see the **User Guide** in the [**doc** directory](https://github.com/wb2osz/direwolf/tree/master/doc).
|
||||
|
||||
|
||||
|
||||
|
||||
### Linux - Using git clone (recommended) ###
|
||||
|
||||
***Note that this has changed for version 1.6. There are now a couple extra steps.***
|
||||
|
||||
|
||||
First you will need to install some software development packages using different commands depending on your flavor of Linux.
|
||||
In most cases, the first few will already be there and the package installer will tell you that installation is not necessary.
|
||||
|
||||
On Debian / Ubuntu / Raspbian / Raspberry Pi OS:
|
||||
|
||||
sudo apt-get install git
|
||||
sudo apt-get install gcc
|
||||
sudo apt-get install g++
|
||||
sudo apt-get install make
|
||||
sudo apt-get install cmake
|
||||
sudo apt-get install libasound2-dev
|
||||
sudo apt-get install libudev-dev
|
||||
sudo apt-get install libavahi-client-dev
|
||||
|
||||
Or on Red Hat / Fedora / CentOS:
|
||||
|
||||
sudo yum install git
|
||||
sudo yum install gcc
|
||||
sudo yum install gcc-c++
|
||||
sudo yum install make
|
||||
sudo yum install alsa-lib-devel
|
||||
sudo yum install libudev-devel
|
||||
sudo yum install avahi-devel
|
||||
|
||||
CentOS 6 & 7 currently have cmake 2.8 but we need 3.1 or later.
|
||||
First you need to enable the EPEL repository. Add a symlink if you don't already have the older version and want to type cmake rather than cmake3.
|
||||
|
||||
sudo yum install epel-release
|
||||
sudo rpm -e cmake
|
||||
sudo yum install cmake3
|
||||
sudo ln -s /usr/bin/cmake3 /usr/bin/cmake
|
||||
|
||||
Then on any flavor of Linux:
|
||||
|
||||
cd ~
|
||||
git clone https://www.github.com/wb2osz/direwolf
|
||||
cd direwolf
|
||||
git checkout dev
|
||||
mkdir build && cd build
|
||||
cmake ..
|
||||
make -j4
|
||||
sudo make install
|
||||
make install-conf
|
||||
|
||||
This gives you the latest development version. Leave out the "git checkout dev" to get the most recent stable release.
|
||||
|
||||
For more details see the **User Guide** in the [**doc** directory](https://github.com/wb2osz/direwolf/tree/master/doc). Special considerations for the Raspberry Pi are found in **Raspberry-Pi-APRS.pdf**
|
||||
|
||||
|
||||
### Linux - Using apt-get (Debian flavor operating systems) ###
|
||||
|
||||
Results will vary depending on your hardware platform and operating system version because it depends on various volunteers who perform the packaging. Expect the version to lag significantly behind development.
|
||||
|
||||
sudo apt-get update
|
||||
apt-cache showpkg direwolf
|
||||
sudo apt-get install direwolf
|
||||
|
||||
|
||||
### Linux - Using yum (Red Hat flavor operating systems) ###
|
||||
|
||||
Results will vary depending on your hardware platform and operating system version because it depends on various volunteers who perform the packaging. Expect the version to lag significantly behind development.
|
||||
|
||||
sudo yum check-update
|
||||
sudo yum list direwolf
|
||||
sudo yum install direwolf
|
||||
|
||||
|
||||
### Macintosh OS X ###
|
||||
|
||||
Read the **User Guide** in the [**doc** directory](https://github.com/wb2osz/direwolf/tree/master/doc). It is more complicated than Linux.
|
||||
|
||||
If you have problems, post them to the [Dire Wolf packet TNC](https://groups.io/g/direwolf) discussion group.
|
||||
|
||||
You can also install a pre-built version from Mac Ports. Keeping this up to date depends on volunteers who perform the packaging. This version could lag behind development.
|
||||
|
||||
sudo port install direwolf
|
||||
|
||||
|
||||
## Join the conversation ##
|
||||
|
||||
Here are some good places to ask questions and share your experience:
|
||||
|
||||
- [Dire Wolf Software TNC](https://groups.io/g/direwolf)
|
||||
|
||||
- [Raspberry Pi 4 Ham Radio](https://groups.io/g/RaspberryPi-4-HamRadio)
|
||||
|
||||
- [linuxham](https://groups.io/g/linuxham)
|
||||
|
||||
- [TAPR aprssig](http://www.tapr.org/pipermail/aprssig/)
|
||||
|
||||
|
||||
The github "issues" section is for reporting software defects and enhancement requests. It is NOT a place to ask questions or have general discussions. Please use one of the locations above.
|
Binary file not shown.
BIN
User-Guide.pdf
BIN
User-Guide.pdf
Binary file not shown.
100
aprs_tt.h
100
aprs_tt.h
|
@ -1,100 +0,0 @@
|
|||
|
||||
/* aprs_tt.h */
|
||||
|
||||
#ifndef APRS_TT_H
|
||||
#define APRS_TT_H 1
|
||||
|
||||
/*
|
||||
* For holding location format specifications from config file.
|
||||
* Same thing is also useful for macro definitions.
|
||||
* We have exactly the same situation of looking for a pattern
|
||||
* match and extracting fixed size groups of digits.
|
||||
*/
|
||||
|
||||
struct ttloc_s {
|
||||
enum { TTLOC_POINT, TTLOC_VECTOR, TTLOC_GRID, TTLOC_UTM, TTLOC_MACRO } type;
|
||||
|
||||
char pattern[20]; /* e.g. B998, B5bbbdddd, B2xxyy, Byyyxxx */
|
||||
/* For macros, it should be all fixed digits, */
|
||||
/* and the letters x, y, z. e.g. 911, xxyyyz */
|
||||
|
||||
union {
|
||||
|
||||
struct {
|
||||
double lat; /* Specific locations. */
|
||||
double lon;
|
||||
} point;
|
||||
|
||||
struct {
|
||||
double lat; /* For bearing/direction. */
|
||||
double lon;
|
||||
double scale; /* conversion to meters */
|
||||
} vector;
|
||||
|
||||
struct {
|
||||
double lat0; /* yyy all zeros. */
|
||||
double lon0; /* xxx */
|
||||
double lat9; /* yyy all nines. */
|
||||
double lon9; /* xxx */
|
||||
} grid;
|
||||
|
||||
struct {
|
||||
char zone[8];
|
||||
double scale;
|
||||
double x_offset;
|
||||
double y_offset;
|
||||
} utm;
|
||||
|
||||
struct {
|
||||
char *definition;
|
||||
} macro;
|
||||
};
|
||||
};
|
||||
|
||||
/*
|
||||
* Configuratin options for APRStt.
|
||||
*/
|
||||
|
||||
#define TT_MAX_XMITS 10
|
||||
|
||||
struct tt_config_s {
|
||||
|
||||
int obj_xmit_chan; /* Channel to transmit object report. */
|
||||
char obj_xmit_header[AX25_MAX_ADDRS*AX25_MAX_ADDR_LEN];
|
||||
/* e.g. "WB2OSZ-5>APDW07,WIDE1-1" */
|
||||
|
||||
int retain_time; /* Seconds to keep information about a user. */
|
||||
int num_xmits; /* Number of times to transmit object report. */
|
||||
int xmit_delay[TT_MAX_XMITS]; /* Delay between them. */
|
||||
|
||||
struct ttloc_s *ttloc_ptr; /* Pointer to variable length array of above. */
|
||||
int ttloc_size; /* Number of elements allocated. */
|
||||
int ttloc_len; /* Number of elements actually used. */
|
||||
|
||||
double corral_lat; /* The "corral" for unknown locations. */
|
||||
double corral_lon;
|
||||
double corral_offset;
|
||||
int corral_ambiguity;
|
||||
};
|
||||
|
||||
|
||||
void aprs_tt_init (struct tt_config_s *p_config);
|
||||
|
||||
void aprs_tt_button (int chan, char button);
|
||||
|
||||
/* Error codes for sending responses to user. */
|
||||
|
||||
#define TT_ERROR_D_MSG 1 /* D was first char of field. Not implemented yet. */
|
||||
#define TT_ERROR_INTERNAL 2 /* Internal error. Shouldn't be here. */
|
||||
#define TT_ERROR_MACRO_NOMATCH 3 /* No definition for digit sequence. */
|
||||
#define TT_ERROR_BAD_CHECKSUM 4 /* Bad checksum on call. */
|
||||
#define TT_ERROR_INVALID_CALL 5 /* Invalid callsign. */
|
||||
#define TT_ERROR_INVALID_OBJNAME 6 /* Invalid object name. */
|
||||
#define TT_ERROR_INVALID_SYMBOL 7 /* Invalid symbol specification. */
|
||||
#define TT_ERROR_INVALID_LOC 8 /* Invalid location. */
|
||||
#define TT_ERROR_NO_CALL 9 /* No call or object name included. */
|
||||
|
||||
|
||||
#endif
|
||||
|
||||
/* end aprs_tt.h */
|
447
atest.c
447
atest.c
|
@ -1,447 +0,0 @@
|
|||
|
||||
//
|
||||
// This file is part of Dire Wolf, an amateur radio packet TNC.
|
||||
//
|
||||
// Copyright (C) 2011,2012,2013 John Langner, WB2OSZ
|
||||
//
|
||||
// This program is free software: you can redistribute it and/or modify
|
||||
// it under the terms of the GNU General Public License as published by
|
||||
// the Free Software Foundation, either version 2 of the License, or
|
||||
// (at your option) any later version.
|
||||
//
|
||||
// This program is distributed in the hope that it will be useful,
|
||||
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
// GNU General Public License for more details.
|
||||
//
|
||||
// You should have received a copy of the GNU General Public License
|
||||
// along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
//
|
||||
|
||||
|
||||
/*-------------------------------------------------------------------
|
||||
*
|
||||
* Name: atest.c
|
||||
*
|
||||
* Purpose: Unit test for the AFSK demodulator.
|
||||
*
|
||||
* Inputs: Takes audio from a .WAV file insted of the audio device.
|
||||
*
|
||||
* Description: This can be used to test the AFSK demodulator under
|
||||
* controlled and reproducable conditions for tweaking.
|
||||
*
|
||||
* For example
|
||||
*
|
||||
* (1) Download WA8LMF's TNC Test CD image file from
|
||||
* http://wa8lmf.net/TNCtest/index.htm
|
||||
*
|
||||
* (2) Burn a physical CD.
|
||||
*
|
||||
* (3) "Rip" the desired tracks with Windows Media Player.
|
||||
* This results in .WMA files.
|
||||
*
|
||||
* (4) Upload the .WMA file(s) to http://media.io/ and
|
||||
* convert to .WAV format.
|
||||
*
|
||||
*
|
||||
* Comparison to others:
|
||||
*
|
||||
* Here are some other scores from Track 2 of the TNC Test CD:
|
||||
* http://sites.google.com/site/ki4mcw/Home/arduino-tnc
|
||||
*
|
||||
* Without ONE_CHAN defined:
|
||||
*
|
||||
* Notice that the number of packets decoded, as reported by
|
||||
* this test program, will be twice the number expected because
|
||||
* we are decoding the left and right audio channels separately.
|
||||
*
|
||||
*
|
||||
* With ONE_CHAN defined:
|
||||
*
|
||||
* Only process one channel.
|
||||
*
|
||||
* Version 0.4 decoded 870 packets.
|
||||
*
|
||||
* After a little tweaking, version 0.5 decodes 931 packets.
|
||||
*
|
||||
* After more tweaking, version 0.6 gets 965 packets.
|
||||
* This is without the option to retry after getting a bad FCS.
|
||||
*
|
||||
*--------------------------------------------------------------------*/
|
||||
|
||||
// #define X 1
|
||||
|
||||
|
||||
#include <stdio.h>
|
||||
#include <unistd.h>
|
||||
//#include <fcntl.h>
|
||||
#include <stdlib.h>
|
||||
#include <assert.h>
|
||||
#include <string.h>
|
||||
#include <time.h>
|
||||
#include <getopt.h>
|
||||
|
||||
|
||||
#define ATEST_C 1
|
||||
|
||||
#include "audio.h"
|
||||
#include "demod.h"
|
||||
// #include "fsk_demod_agc.h"
|
||||
#include "textcolor.h"
|
||||
#include "ax25_pad.h"
|
||||
#include "hdlc_rec2.h"
|
||||
|
||||
|
||||
|
||||
struct wav_header { /* .WAV file header. */
|
||||
char riff[4]; /* "RIFF" */
|
||||
int filesize; /* file length - 8 */
|
||||
char wave[4]; /* "WAVE" */
|
||||
char fmt[4]; /* "fmt " */
|
||||
int fmtsize; /* 16. */
|
||||
short wformattag; /* 1 for PCM. */
|
||||
short nchannels; /* 1 for mono, 2 for stereo. */
|
||||
int nsamplespersec; /* sampling freq, Hz. */
|
||||
int navgbytespersec; /* = nblockalign*nsamplespersec. */
|
||||
short nblockalign; /* = wbitspersample/8 * nchannels. */
|
||||
short wbitspersample; /* 16 or 8. */
|
||||
char data[4]; /* "data" */
|
||||
int datasize; /* number of bytes following. */
|
||||
} ;
|
||||
|
||||
/* 8 bit samples are unsigned bytes */
|
||||
/* in range of 0 .. 255. */
|
||||
|
||||
/* 16 bit samples are signed short */
|
||||
/* in range of -32768 .. +32767. */
|
||||
|
||||
static struct wav_header header;
|
||||
static FILE *fp;
|
||||
static int e_o_f;
|
||||
static int packets_decoded = 0;
|
||||
static int decimate = 1; /* Reduce that sampling rate. */
|
||||
/* 1 = normal, 2 = half, etc. */
|
||||
|
||||
|
||||
int main (int argc, char *argv[])
|
||||
{
|
||||
|
||||
//int err;
|
||||
int c;
|
||||
struct audio_s modem;
|
||||
int channel;
|
||||
time_t start_time;
|
||||
|
||||
text_color_init(1);
|
||||
text_color_set(DW_COLOR_INFO);
|
||||
|
||||
/*
|
||||
* First apply defaults.
|
||||
*/
|
||||
|
||||
memset (&modem, 0, sizeof(modem));
|
||||
|
||||
modem.num_channels = DEFAULT_NUM_CHANNELS;
|
||||
modem.samples_per_sec = DEFAULT_SAMPLES_PER_SEC;
|
||||
modem.bits_per_sample = DEFAULT_BITS_PER_SAMPLE;
|
||||
|
||||
/* TODO: should have a command line option for this. */
|
||||
/* Results v0.9: 971/69, 990/64, 992/65, 992/67, 1004/476 */
|
||||
|
||||
modem.fix_bits = RETRY_NONE;
|
||||
modem.fix_bits = RETRY_SINGLE;
|
||||
modem.fix_bits = RETRY_DOUBLE;
|
||||
//modem.fix_bits = RETRY_TRIPLE;
|
||||
//modem.fix_bits = RETRY_TWO_SEP;
|
||||
|
||||
for (channel=0; channel<MAX_CHANS; channel++) {
|
||||
|
||||
modem.modem_type[channel] = AFSK;
|
||||
|
||||
modem.mark_freq[channel] = DEFAULT_MARK_FREQ;
|
||||
modem.space_freq[channel] = DEFAULT_SPACE_FREQ;
|
||||
modem.baud[channel] = DEFAULT_BAUD;
|
||||
strcpy (modem.profiles[channel], "C");
|
||||
// temp
|
||||
// strcpy (modem.profiles[channel], "F");
|
||||
modem.num_subchan[channel] = strlen(modem.profiles[channel]);
|
||||
|
||||
modem.num_freq[channel] = 1;
|
||||
modem.offset[channel] = 0;
|
||||
// temp test
|
||||
//modem.num_subchan[channel] = modem.num_freq[channel] = 3;
|
||||
//modem.num_subchan[channel] = modem.num_freq[channel] = 5;
|
||||
//modem.offset[channel] = 100;
|
||||
|
||||
//strcpy (modem.ptt_device[channel], "");
|
||||
//modem.ptt_line[channel] = PTT_NONE;
|
||||
|
||||
//modem.slottime[channel] = DEFAULT_SLOTTIME;
|
||||
//modem.persist[channel] = DEFAULT_PERSIST;
|
||||
//modem.txdelay[channel] = DEFAULT_TXDELAY;
|
||||
//modem.txtail[channel] = DEFAULT_TXTAIL;
|
||||
}
|
||||
|
||||
while (1) {
|
||||
int this_option_optind = optind ? optind : 1;
|
||||
int option_index = 0;
|
||||
static struct option long_options[] = {
|
||||
{"future1", 1, 0, 0},
|
||||
{"future2", 0, 0, 0},
|
||||
{"future3", 1, 0, 'c'},
|
||||
{0, 0, 0, 0}
|
||||
};
|
||||
|
||||
/* ':' following option character means arg is required. */
|
||||
|
||||
c = getopt_long(argc, argv, "B:P:D:",
|
||||
long_options, &option_index);
|
||||
if (c == -1)
|
||||
break;
|
||||
|
||||
switch (c) {
|
||||
|
||||
case 'B': /* -B for data Bit rate */
|
||||
/* 300 implies 1600/1800 AFSK. */
|
||||
/* 1200 implies 1200/2200 AFSK. */
|
||||
/* 9600 implies scrambled. */
|
||||
|
||||
modem.baud[0] = atoi(optarg);
|
||||
|
||||
printf ("Data rate set to %d bits / second.\n", modem.baud[0]);
|
||||
|
||||
if (modem.baud[0] < 100 || modem.baud[0] > 10000) {
|
||||
fprintf (stderr, "Use a more reasonable bit rate in range of 100 - 10000.\n");
|
||||
exit (EXIT_FAILURE);
|
||||
}
|
||||
if (modem.baud[0] < 600) {
|
||||
modem.modem_type[0] = AFSK;
|
||||
modem.mark_freq[0] = 1600;
|
||||
modem.space_freq[0] = 1800;
|
||||
}
|
||||
else if (modem.baud[0] > 2400) {
|
||||
modem.modem_type[0] = SCRAMBLE;
|
||||
modem.mark_freq[0] = 0;
|
||||
modem.space_freq[0] = 0;
|
||||
printf ("Using scrambled baseband signal rather than AFSK.\n");
|
||||
}
|
||||
else {
|
||||
modem.modem_type[0] = AFSK;
|
||||
modem.mark_freq[0] = 1200;
|
||||
modem.space_freq[0] = 2200;
|
||||
}
|
||||
break;
|
||||
|
||||
case 'P': /* -P for modem profile. */
|
||||
|
||||
printf ("Demodulator profile set to \"%s\"\n", optarg);
|
||||
strcpy (modem.profiles[0], optarg);
|
||||
break;
|
||||
|
||||
case 'D': /* -D reduce sampling rate for lower CPU usage. */
|
||||
|
||||
decimate = atoi(optarg);
|
||||
printf ("Decimate factor = %d\n", decimate);
|
||||
modem.decimate[0] = decimate;
|
||||
break;
|
||||
|
||||
case '?':
|
||||
|
||||
/* Unknown option message was already printed. */
|
||||
//usage (argv);
|
||||
break;
|
||||
|
||||
default:
|
||||
|
||||
/* Should not be here. */
|
||||
printf("?? getopt returned character code 0%o ??\n", c);
|
||||
//usage (argv);
|
||||
}
|
||||
}
|
||||
|
||||
if (optind >= argc) {
|
||||
printf ("Specify .WAV file name on command line.\n");
|
||||
exit (1);
|
||||
}
|
||||
|
||||
fp = fopen(argv[optind], "rb");
|
||||
if (fp == NULL) {
|
||||
text_color_set(DW_COLOR_ERROR);
|
||||
fprintf (stderr, "Couldn't open file for read: %s\n", argv[optind]);
|
||||
//perror ("more info?");
|
||||
exit (1);
|
||||
}
|
||||
|
||||
start_time = time(NULL);
|
||||
|
||||
|
||||
/*
|
||||
* Read the file header.
|
||||
*/
|
||||
|
||||
fread (&header, sizeof(header), (size_t)1, fp);
|
||||
|
||||
assert (header.nchannels == 1 || header.nchannels == 2);
|
||||
assert (header.wbitspersample == 8 || header.wbitspersample == 16);
|
||||
|
||||
modem.samples_per_sec = header.nsamplespersec;
|
||||
modem.samples_per_sec = modem.samples_per_sec;
|
||||
modem.bits_per_sample = header.wbitspersample;
|
||||
modem.num_channels = header.nchannels;
|
||||
|
||||
text_color_set(DW_COLOR_INFO);
|
||||
printf ("%d samples per second\n", modem.samples_per_sec);
|
||||
printf ("%d bits per sample\n", modem.bits_per_sample);
|
||||
printf ("%d audio channels\n", modem.num_channels);
|
||||
printf ("%d audio bytes in file\n", (int)(header.datasize));
|
||||
|
||||
|
||||
/*
|
||||
* Initialize the AFSK demodulator and HDLC decoder.
|
||||
*/
|
||||
multi_modem_init (&modem);
|
||||
|
||||
|
||||
e_o_f = 0;
|
||||
while ( ! e_o_f)
|
||||
{
|
||||
|
||||
|
||||
int audio_sample;
|
||||
int c;
|
||||
|
||||
for (c=0; c<modem.num_channels; c++)
|
||||
{
|
||||
|
||||
/* This reads either 1 or 2 bytes depending on */
|
||||
/* bits per sample. */
|
||||
|
||||
audio_sample = demod_get_sample ();
|
||||
|
||||
if (audio_sample >= 256 * 256)
|
||||
e_o_f = 1;
|
||||
|
||||
#define ONE_CHAN 1 /* only use one audio channel. */
|
||||
|
||||
#if ONE_CHAN
|
||||
if (c != 0) continue;
|
||||
#endif
|
||||
|
||||
multi_modem_process_sample(c,audio_sample);
|
||||
}
|
||||
|
||||
/* When a complete frame is accumulated, */
|
||||
/* process_rec_frame, below, is called. */
|
||||
|
||||
}
|
||||
|
||||
text_color_set(DW_COLOR_INFO);
|
||||
printf ("\n\n");
|
||||
printf ("%d packets decoded in %d seconds.\n", packets_decoded, (int)(time(NULL) - start_time));
|
||||
|
||||
exit (0);
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* Simulate sample from the audio device.
|
||||
*/
|
||||
|
||||
int audio_get (void)
|
||||
{
|
||||
int ch;
|
||||
|
||||
ch = getc(fp);
|
||||
|
||||
if (ch < 0) e_o_f = 1;
|
||||
|
||||
return (ch);
|
||||
}
|
||||
|
||||
|
||||
|
||||
/*
|
||||
* Rather than queuing up frames with bad FCS,
|
||||
* try to fix them immediately.
|
||||
*/
|
||||
|
||||
void rdq_append (rrbb_t rrbb)
|
||||
{
|
||||
int chan;
|
||||
int alevel;
|
||||
int subchan;
|
||||
|
||||
|
||||
chan = rrbb_get_chan(rrbb);
|
||||
subchan = rrbb_get_subchan(rrbb);
|
||||
alevel = rrbb_get_audio_level(rrbb);
|
||||
|
||||
hdlc_rec2_try_to_fix_later (rrbb, chan, subchan, alevel);
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* This is called when we have a good frame.
|
||||
*/
|
||||
|
||||
void app_process_rec_packet (int chan, int subchan, packet_t pp, int alevel, retry_t retries, char *spectrum)
|
||||
{
|
||||
|
||||
//int err;
|
||||
//char *p;
|
||||
char stemp[500];
|
||||
unsigned char *pinfo;
|
||||
int info_len;
|
||||
int h;
|
||||
char heard[20];
|
||||
//packet_t pp;
|
||||
|
||||
|
||||
packets_decoded++;
|
||||
|
||||
|
||||
ax25_format_addrs (pp, stemp);
|
||||
|
||||
info_len = ax25_get_info (pp, &pinfo);
|
||||
|
||||
/* Print so we can see what is going on. */
|
||||
|
||||
#if 1
|
||||
/* Display audio input level. */
|
||||
/* Who are we hearing? Original station or digipeater. */
|
||||
|
||||
h = ax25_get_heard(pp);
|
||||
ax25_get_addr_with_ssid(pp, h, heard);
|
||||
|
||||
text_color_set(DW_COLOR_DEBUG);
|
||||
printf ("\n");
|
||||
|
||||
if (h != AX25_SOURCE) {
|
||||
printf ("Digipeater ");
|
||||
}
|
||||
printf ("%s audio level = %d [%s] %s\n", heard, alevel, retry_text[(int)retries], spectrum);
|
||||
|
||||
|
||||
#endif
|
||||
|
||||
// Display non-APRS packets in a different color.
|
||||
|
||||
if (ax25_is_aprs(pp)) {
|
||||
text_color_set(DW_COLOR_REC);
|
||||
printf ("[%d] ", chan);
|
||||
}
|
||||
else {
|
||||
text_color_set(DW_COLOR_DEBUG);
|
||||
printf ("[%d] ", chan);
|
||||
}
|
||||
|
||||
printf ("%s", stemp); /* stations followed by : */
|
||||
ax25_safe_print ((char *)pinfo, info_len, 0);
|
||||
printf ("\n");
|
||||
|
||||
ax25_delete (pp);
|
||||
|
||||
} /* end app_process_rec_packet */
|
||||
|
||||
|
||||
/* end atest.c */
|
208
audio.h
208
audio.h
|
@ -1,208 +0,0 @@
|
|||
|
||||
/*------------------------------------------------------------------
|
||||
*
|
||||
* Module: audio.h
|
||||
*
|
||||
* Purpose: Interface to audio device commonly called a "sound card."
|
||||
*
|
||||
*---------------------------------------------------------------*/
|
||||
|
||||
|
||||
#ifndef AUDIO_H
|
||||
#define AUDIO_H 1
|
||||
|
||||
#include "direwolf.h" /* for MAX_CHANS used throughout the application. */
|
||||
#include "hdlc_rec2.h" /* for enum retry_e */
|
||||
|
||||
|
||||
/*
|
||||
* PTT control.
|
||||
*/
|
||||
|
||||
enum ptt_method_e {
|
||||
PTT_METHOD_NONE, /* VOX or no transmit. */
|
||||
PTT_METHOD_SERIAL, /* Serial port RTS or DTR. */
|
||||
PTT_METHOD_GPIO }; /* General purpos I/O. */
|
||||
|
||||
typedef enum ptt_method_e ptt_method_t;
|
||||
|
||||
enum ptt_line_e { PTT_LINE_RTS = 1, PTT_LINE_DTR = 2 };
|
||||
typedef enum ptt_line_e ptt_line_t;
|
||||
|
||||
enum audio_in_type_e {
|
||||
AUDIO_IN_TYPE_SOUNDCARD,
|
||||
AUDIO_IN_TYPE_SDR_UDP,
|
||||
AUDIO_IN_TYPE_STDIN };
|
||||
|
||||
struct audio_s {
|
||||
|
||||
/* Properites of the sound device. */
|
||||
|
||||
char adevice_in[80]; /* Name of the audio input device (or file?). */
|
||||
/* TODO: Can be "-" to read from stdin. */
|
||||
|
||||
char adevice_out[80]; /* Name of the audio output device (or file?). */
|
||||
|
||||
int num_channels; /* Should be 1 for mono or 2 for stereo. */
|
||||
int samples_per_sec; /* Audio sampling rate. Typically 11025, 22050, or 44100. */
|
||||
int bits_per_sample; /* 8 (unsigned char) or 16 (signed short). */
|
||||
|
||||
enum audio_in_type_e audio_in_type;
|
||||
/* Where is input (receive) audio coming from? */
|
||||
|
||||
/* Common to all channels. */
|
||||
|
||||
enum retry_e fix_bits; /* Level of effort to recover from */
|
||||
/* a bad FCS on the frame. */
|
||||
|
||||
/* Properties for each audio channel, common to receive and transmit. */
|
||||
/* Can be different for each radio channel. */
|
||||
|
||||
enum modem_t {AFSK, NONE, SCRAMBLE} modem_type[MAX_CHANS];
|
||||
/* Usual AFSK. */
|
||||
/* Baseband signal. */
|
||||
/* Scrambled http://www.amsat.org/amsat/articles/g3ruh/109/fig03.gif */
|
||||
|
||||
int decimate[MAX_CHANS]; /* Reduce AFSK sample rate by this factor to */
|
||||
/* decrease computational requirements. */
|
||||
|
||||
int mark_freq[MAX_CHANS]; /* Two tones for AFSK modulation, in Hz. */
|
||||
int space_freq[MAX_CHANS]; /* Standard tones are 1200 and 2200 for 1200 baud. */
|
||||
|
||||
int baud[MAX_CHANS]; /* Data bits (more accurately, symbols) per second. */
|
||||
/* Standard rates are 1200 for VHF and 300 for HF. */
|
||||
|
||||
char profiles[MAX_CHANS][16]; /* 1 or more of ABC etc. */
|
||||
|
||||
int num_freq[MAX_CHANS]; /* Number of different frequency pairs for decoders. */
|
||||
|
||||
int offset[MAX_CHANS]; /* Spacing between filter frequencies. */
|
||||
|
||||
int num_subchan[MAX_CHANS]; /* Total number of modems / hdlc decoders for each channel. */
|
||||
/* Potentially it could be product of strlen(profiles) * num_freq. */
|
||||
/* Currently can't use both at once. */
|
||||
|
||||
|
||||
/* Additional properties for transmit. */
|
||||
|
||||
ptt_method_t ptt_method[MAX_CHANS]; /* serial port or GPIO. */
|
||||
|
||||
char ptt_device[MAX_CHANS][20]; /* Serial device name for PTT. e.g. COM1 or /dev/ttyS0 */
|
||||
|
||||
ptt_line_t ptt_line[MAX_CHANS]; /* Control line wehn using serial port. */
|
||||
/* PTT_RTS, PTT_DTR. */
|
||||
|
||||
int ptt_gpio[MAX_CHANS]; /* GPIO number. */
|
||||
|
||||
int ptt_invert[MAX_CHANS]; /* Invert the output. */
|
||||
|
||||
int slottime[MAX_CHANS]; /* Slot time in 10 mS units for persistance algorithm. */
|
||||
/* Typical value is 10 meaning 100 milliseconds. */
|
||||
|
||||
int persist[MAX_CHANS]; /* Sets probability for transmitting after each */
|
||||
/* slot time delay. Transmit if a random number */
|
||||
/* in range of 0 - 255 <= persist value. */
|
||||
/* Otherwise wait another slot time and try again. */
|
||||
/* Default value is 63 for 25% probability. */
|
||||
|
||||
int txdelay[MAX_CHANS]; /* After turning on the transmitter, */
|
||||
/* send "flags" for txdelay * 10 mS. */
|
||||
/* Default value is 30 meaning 300 milliseconds. */
|
||||
|
||||
int txtail[MAX_CHANS]; /* Amount of time to keep transmitting after we */
|
||||
/* are done sending the data. This is to avoid */
|
||||
/* dropping PTT too soon and chopping off the end */
|
||||
/* of the frame. Again 10 mS units. */
|
||||
/* At this point, I'm thinking of 10 as the default. */
|
||||
};
|
||||
|
||||
#if __WIN32__
|
||||
#define DEFAULT_ADEVICE "" /* Windows: Empty string = default audio device. */
|
||||
#else
|
||||
#if USE_ALSA
|
||||
#define DEFAULT_ADEVICE "default" /* Use default device for ALSA. */
|
||||
#else
|
||||
#define DEFAULT_ADEVICE "/dev/dsp" /* First audio device for OSS. */
|
||||
#endif
|
||||
#endif
|
||||
|
||||
|
||||
/*
|
||||
* UDP audio receiving port. Couldn't find any standard or usage precedent.
|
||||
* Got the number from this example: http://gqrx.dk/doc/streaming-audio-over-udp
|
||||
* Any better suggestions?
|
||||
*/
|
||||
|
||||
#define DEFAULT_UDP_AUDIO_PORT 7355
|
||||
|
||||
|
||||
// Maximum size of the UDP buffer (for allowing IP routing, udp packets are often limited to 1472 bytes)
|
||||
|
||||
#define SDR_UDP_BUF_MAXLEN 2000
|
||||
|
||||
|
||||
|
||||
#define DEFAULT_NUM_CHANNELS 1
|
||||
#define DEFAULT_SAMPLES_PER_SEC 44100 /* Very early observations. Might no longer be valid. */
|
||||
/* 22050 works a lot better than 11025. */
|
||||
/* 44100 works a little better than 22050. */
|
||||
/* If you have a reasonable machine, use the highest rate. */
|
||||
#define MIN_SAMPLES_PER_SEC 8000
|
||||
#define MAX_SAMPLES_PER_SEC 48000 /* Formerly 44100. */
|
||||
/* Software defined radio often uses 48000. */
|
||||
|
||||
#define DEFAULT_BITS_PER_SAMPLE 16
|
||||
|
||||
#define DEFAULT_FIX_BITS RETRY_SINGLE
|
||||
|
||||
/*
|
||||
* Standard for AFSK on VHF FM.
|
||||
* Reversing mark and space makes no difference because
|
||||
* NRZI encoding only cares about change or lack of change
|
||||
* between the two tones.
|
||||
*
|
||||
* HF SSB uses 300 baud and 200 Hz shift.
|
||||
* 1600 & 1800 Hz is a popular tone pair, sometimes
|
||||
* called the KAM tones.
|
||||
*/
|
||||
|
||||
#define DEFAULT_MARK_FREQ 1200
|
||||
#define DEFAULT_SPACE_FREQ 2200
|
||||
#define DEFAULT_BAUD 1200
|
||||
|
||||
|
||||
|
||||
/*
|
||||
* Typical transmit timings for VHF.
|
||||
*/
|
||||
|
||||
#define DEFAULT_SLOTTIME 10
|
||||
#define DEFAULT_PERSIST 63
|
||||
#define DEFAULT_TXDELAY 30
|
||||
#define DEFAULT_TXTAIL 10 /* not sure yet. */
|
||||
|
||||
|
||||
/*
|
||||
* Note that we have two versions of these in audio.c and audio_win.c.
|
||||
* Use one or the other depending on the platform.
|
||||
*/
|
||||
|
||||
|
||||
int audio_open (struct audio_s *pa);
|
||||
|
||||
int audio_get (void);
|
||||
|
||||
int audio_put (int c);
|
||||
|
||||
int audio_flush (void);
|
||||
|
||||
int audio_wait (int duration);
|
||||
|
||||
int audio_close (void);
|
||||
|
||||
|
||||
#endif /* ifdef AUDIO_H */
|
||||
|
||||
|
||||
/* end audio.h */
|
||||
|
1044
audio_win.c
1044
audio_win.c
File diff suppressed because it is too large
Load Diff
1722
ax25_pad.c
1722
ax25_pad.c
File diff suppressed because it is too large
Load Diff
298
ax25_pad.h
298
ax25_pad.h
|
@ -1,298 +0,0 @@
|
|||
/*-------------------------------------------------------------------
|
||||
*
|
||||
* Name: ax25_pad.h
|
||||
*
|
||||
* Purpose: Header file for using ax25_pad.c
|
||||
*
|
||||
*------------------------------------------------------------------*/
|
||||
|
||||
#ifndef AX25_PAD_H
|
||||
#define AX25_PAD_H 1
|
||||
|
||||
|
||||
#define AX25_MAX_REPEATERS 8
|
||||
#define AX25_MIN_ADDRS 2 /* Destinatin & Source. */
|
||||
#define AX25_MAX_ADDRS 10 /* Destination, Source, 8 digipeaters. */
|
||||
|
||||
#define AX25_DESTINATION 0 /* Address positions in frame. */
|
||||
#define AX25_SOURCE 1
|
||||
#define AX25_REPEATER_1 2
|
||||
#define AX25_REPEATER_2 3
|
||||
#define AX25_REPEATER_3 4
|
||||
#define AX25_REPEATER_4 5
|
||||
#define AX25_REPEATER_5 6
|
||||
#define AX25_REPEATER_6 7
|
||||
#define AX25_REPEATER_7 8
|
||||
#define AX25_REPEATER_8 9
|
||||
|
||||
#define AX25_MAX_ADDR_LEN 12 /* In theory, you would expect the maximum length */
|
||||
/* to be 6 letters, dash, 2 digits, and nul for a */
|
||||
/* total of 10. However, object labels can be 10 */
|
||||
/* characters so throw in a couple extra bytes */
|
||||
/* to be safe. */
|
||||
|
||||
#define AX25_MIN_INFO_LEN 0 /* Previously 1 when considering only APRS. */
|
||||
|
||||
#define AX25_MAX_INFO_LEN 2048 /* Maximum size for APRS. */
|
||||
/* AX.25 starts out with 256 as the default max */
|
||||
/* length but the end stations can negotiate */
|
||||
/* something different. */
|
||||
/* version 0.8: Change from 256 to 2028 to */
|
||||
/* handle the larger paclen for Linux AX25. */
|
||||
|
||||
/* These don't include the 2 bytes for the */
|
||||
/* HDLC frame FCS. */
|
||||
|
||||
/*
|
||||
* Previously, for APRS only.
|
||||
* #define AX25_MIN_PACKET_LEN ( 2 * 7 + 2 + AX25_MIN_INFO_LEN)
|
||||
* #define AX25_MAX_PACKET_LEN ( AX25_MAX_ADDRS * 7 + 2 + AX25_MAX_INFO_LEN)
|
||||
*/
|
||||
|
||||
/* the more general case. */
|
||||
|
||||
#define AX25_MIN_PACKET_LEN ( 2 * 7 + 1 )
|
||||
|
||||
#define AX25_MAX_PACKET_LEN ( AX25_MAX_ADDRS * 7 + 2 + 3 + AX25_MAX_INFO_LEN)
|
||||
|
||||
|
||||
/*
|
||||
* packet_t is a pointer to a packet object.
|
||||
*
|
||||
* The actual implementation is not visible outside ax25_pad.c.
|
||||
*/
|
||||
|
||||
#define AX25_UI_FRAME 3 /* Control field value. */
|
||||
#define AX25_NO_LAYER_3 0xf0 /* protocol ID */
|
||||
|
||||
|
||||
|
||||
#ifdef AX25_PAD_C /* Keep this hidden - implementation could change. */
|
||||
|
||||
struct packet_s {
|
||||
|
||||
int magic1; /* for error checking. */
|
||||
|
||||
#define MAGIC 0x41583235
|
||||
|
||||
struct packet_s *nextp; /* Pointer to next in queue. */
|
||||
|
||||
int num_addr; /* Number of elements used in two below. */
|
||||
/* Range of 0 .. AX25_MAX_ADDRS. */
|
||||
|
||||
char addrs[AX25_MAX_ADDRS][AX25_MAX_ADDR_LEN];
|
||||
/* Contains the address without the ssid. */
|
||||
/* Why is it larger than 7? */
|
||||
/* Messages from an IGate server can have longer */
|
||||
/* addresses after qAC. Up to 9 observed so far. */
|
||||
|
||||
/* usual human readable form. e.g. WB20SZ-15 */
|
||||
|
||||
unsigned char ssid_etc[AX25_MAX_ADDRS]; /* SSID octet from each address. */
|
||||
|
||||
/*
|
||||
* Bits: H R R SSID 0
|
||||
*
|
||||
* H for digipeaters set to 0 intially.
|
||||
* Changed to 1 when position has been used.
|
||||
*
|
||||
* for source & destination it is called
|
||||
* command/response and is normally 1.
|
||||
*
|
||||
* R R Reserved. Normally set to 1 1.
|
||||
*
|
||||
* SSID Substation ID. Range of 0 - 15.
|
||||
*
|
||||
* 0 Usually 0 but 1 for last address.
|
||||
*/
|
||||
|
||||
#define SSID_H_MASK 0x80
|
||||
#define SSID_H_SHIFT 7
|
||||
|
||||
#define SSID_RR_MASK 0x60
|
||||
#define SSID_RR_SHIFT 5
|
||||
|
||||
#define SSID_SSID_MASK 0x1e
|
||||
#define SSID_SSID_SHIFT 1
|
||||
|
||||
#define SSID_LAST_MASK 0x01
|
||||
|
||||
|
||||
int the_rest_len; /* Frame length minus the address part. */
|
||||
|
||||
unsigned char the_rest[2 + 3 + AX25_MAX_INFO_LEN + 1];
|
||||
/* The rest after removing the addresses. */
|
||||
/* Includes control, protocol ID, Information, */
|
||||
/* and throw in one more for a character */
|
||||
/* string nul terminator. */
|
||||
|
||||
int magic2; /* Will get stomped on if above overflows. */
|
||||
};
|
||||
|
||||
|
||||
|
||||
|
||||
#else /* Public view. */
|
||||
|
||||
struct packet_s {
|
||||
int secret;
|
||||
};
|
||||
|
||||
#endif
|
||||
|
||||
|
||||
typedef struct packet_s *packet_t;
|
||||
|
||||
|
||||
|
||||
#ifdef AX25_PAD_C /* Keep this hidden - implementation could change. */
|
||||
|
||||
/*
|
||||
* APRS always has one control octet of 0x03 but the more
|
||||
* general AX.25 case is one or two control bytes depending on
|
||||
* "modulo 128 operation" is in effect. Unfortunately, it seems
|
||||
* this can be determined only by examining the XID frames and
|
||||
* keeping this information for each connection.
|
||||
* We can assume 1 for our purposes.
|
||||
*/
|
||||
|
||||
static inline int ax25_get_control_offset (packet_t this_p)
|
||||
{
|
||||
return (0);
|
||||
}
|
||||
|
||||
static inline int ax25_get_num_control (packet_t this_p)
|
||||
{
|
||||
return (1);
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* APRS always has one protocol octet of 0xF0 meaning no level 3
|
||||
* protocol but the more general case is 0, 1 or 2 protocol ID octets.
|
||||
*/
|
||||
|
||||
static inline int ax25_get_pid_offset (packet_t this_p)
|
||||
{
|
||||
return (ax25_get_num_control(this_p));
|
||||
}
|
||||
|
||||
static int ax25_get_num_pid (packet_t this_p)
|
||||
{
|
||||
int c;
|
||||
int pid;
|
||||
|
||||
c = this_p->the_rest[ax25_get_control_offset(this_p)];
|
||||
|
||||
if ( (c & 0x01) == 0 || /* I xxxx xxx0 */
|
||||
c == 0x03 || c == 0x13) { /* UI 000x 0011 */
|
||||
|
||||
pid = this_p->the_rest[ax25_get_pid_offset(this_p)];
|
||||
if (pid == 0xff) {
|
||||
return (2); /* pid 1111 1111 means another follows. */
|
||||
}
|
||||
return (1);
|
||||
}
|
||||
return (0);
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* APRS always has an Information field with at least one octet for the
|
||||
* Data Type Indicator. AX.25 has this for only 5 frame types depending
|
||||
* on the control field.
|
||||
* xxxx xxx0 I
|
||||
* 000x 0011 UI
|
||||
* 101x 1111 XID
|
||||
* 111x 0011 TEST
|
||||
* 100x 0111 FRMR
|
||||
*/
|
||||
|
||||
static inline int ax25_get_info_offset (packet_t this_p)
|
||||
{
|
||||
return (ax25_get_num_control(this_p) + ax25_get_num_pid(this_p));
|
||||
}
|
||||
|
||||
static int ax25_get_num_info (packet_t this_p)
|
||||
{
|
||||
int len;
|
||||
|
||||
len = this_p->the_rest_len - ax25_get_num_control(this_p) - ax25_get_num_pid(this_p);
|
||||
if (len < 0) {
|
||||
len = 0; /* print error? */
|
||||
}
|
||||
return (len);
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
//static packet_t ax25_new (void);
|
||||
|
||||
extern void ax25_delete (packet_t pp);
|
||||
|
||||
extern void ax25_clear (packet_t pp);
|
||||
|
||||
extern packet_t ax25_from_text (char *, int strict);
|
||||
|
||||
extern packet_t ax25_from_frame (unsigned char *data, int len, int alevel);
|
||||
|
||||
extern packet_t ax25_dup (packet_t copy_from);
|
||||
|
||||
extern int ax25_parse_addr (char *in_addr, int strict, char *out_addr, int *out_ssid, int *out_heard);
|
||||
|
||||
extern packet_t ax25_unwrap_third_party (packet_t from_pp);
|
||||
|
||||
extern void ax25_set_addr (packet_t pp, int, char *);
|
||||
extern void ax25_insert_addr (packet_t this_p, int n, char *ad);
|
||||
extern void ax25_remove_addr (packet_t this_p, int n);
|
||||
|
||||
extern int ax25_get_num_addr (packet_t pp);
|
||||
extern int ax25_get_num_repeaters (packet_t this_p);
|
||||
|
||||
extern void ax25_get_addr_with_ssid (packet_t pp, int n, char *);
|
||||
|
||||
extern int ax25_get_ssid (packet_t pp, int n);
|
||||
extern void ax25_set_ssid (packet_t this_p, int n, int ssid);
|
||||
|
||||
extern int ax25_get_h (packet_t pp, int n);
|
||||
|
||||
extern void ax25_set_h (packet_t pp, int n);
|
||||
|
||||
extern int ax25_get_heard(packet_t this_p);
|
||||
|
||||
extern int ax25_get_first_not_repeated(packet_t pp);
|
||||
|
||||
extern int ax25_get_info (packet_t pp, unsigned char **paddr);
|
||||
|
||||
extern void ax25_set_nextp (packet_t this_p, packet_t next_p);
|
||||
|
||||
extern int ax25_get_dti (packet_t this_p);
|
||||
|
||||
extern packet_t ax25_get_nextp (packet_t this_p);
|
||||
|
||||
extern void ax25_format_addrs (packet_t pp, char *);
|
||||
|
||||
extern int ax25_pack (packet_t pp, unsigned char result[AX25_MAX_PACKET_LEN]);
|
||||
|
||||
extern int ax25_is_aprs (packet_t pp);
|
||||
|
||||
extern int ax25_get_control (packet_t this_p);
|
||||
|
||||
extern int ax25_get_pid (packet_t this_p);
|
||||
|
||||
extern unsigned short ax25_dedupe_crc (packet_t pp);
|
||||
|
||||
extern unsigned short ax25_m_m_crc (packet_t pp);
|
||||
|
||||
extern void ax25_safe_print (char *, int, int ascii_only);
|
||||
|
||||
|
||||
#endif /* AX25_PAD_H */
|
||||
|
||||
/* end ax25_pad.h */
|
||||
|
||||
|
681
beacon.c
681
beacon.c
|
@ -1,681 +0,0 @@
|
|||
//#define DEBUG 1
|
||||
//#define DEBUG_SIM 1
|
||||
|
||||
|
||||
//
|
||||
// This file is part of Dire Wolf, an amateur radio packet TNC.
|
||||
//
|
||||
// Copyright (C) 2011,2013,2014 John Langner, WB2OSZ
|
||||
//
|
||||
// This program is free software: you can redistribute it and/or modify
|
||||
// it under the terms of the GNU General Public License as published by
|
||||
// the Free Software Foundation, either version 2 of the License, or
|
||||
// (at your option) any later version.
|
||||
//
|
||||
// This program is distributed in the hope that it will be useful,
|
||||
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
// GNU General Public License for more details.
|
||||
//
|
||||
// You should have received a copy of the GNU General Public License
|
||||
// along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
//
|
||||
|
||||
|
||||
/*------------------------------------------------------------------
|
||||
*
|
||||
* Module: beacon.c
|
||||
*
|
||||
* Purpose: Transmit messages on a fixed schedule.
|
||||
*
|
||||
* Description: Transmit periodic messages as specified in the config file.
|
||||
*
|
||||
*---------------------------------------------------------------*/
|
||||
|
||||
#include <stdio.h>
|
||||
#include <unistd.h>
|
||||
#include <stdlib.h>
|
||||
#include <assert.h>
|
||||
#include <string.h>
|
||||
#include <math.h>
|
||||
|
||||
#include <time.h>
|
||||
#if __WIN32__
|
||||
#include <windows.h>
|
||||
#endif
|
||||
|
||||
#include "direwolf.h"
|
||||
#include "ax25_pad.h"
|
||||
#include "textcolor.h"
|
||||
#include "audio.h"
|
||||
#include "tq.h"
|
||||
#include "xmit.h"
|
||||
#include "config.h"
|
||||
#include "digipeater.h"
|
||||
#include "version.h"
|
||||
#include "encode_aprs.h"
|
||||
#include "beacon.h"
|
||||
#include "latlong.h"
|
||||
#include "dwgps.h"
|
||||
|
||||
|
||||
|
||||
/*
|
||||
* Are we using GPS data?
|
||||
* Incremented if tracker beacons configured.
|
||||
* Cleared if dwgps_init fails.
|
||||
*/
|
||||
|
||||
static int g_using_gps = 0;
|
||||
|
||||
/*
|
||||
* Save pointers to configuration settings.
|
||||
*/
|
||||
|
||||
static struct misc_config_s *g_misc_config_p;
|
||||
static struct digi_config_s *g_digi_config_p;
|
||||
|
||||
|
||||
|
||||
#if __WIN32__
|
||||
static unsigned __stdcall beacon_thread (void *arg);
|
||||
#else
|
||||
static void * beacon_thread (void *arg);
|
||||
#endif
|
||||
|
||||
|
||||
|
||||
/*-------------------------------------------------------------------
|
||||
*
|
||||
* Name: beacon_init
|
||||
*
|
||||
* Purpose: Initialize the beacon process.
|
||||
*
|
||||
* Inputs: pconfig - misc. configuration from config file.
|
||||
* pdigi - digipeater configuration from config file.
|
||||
* Use to obtain "mycall" for each channel.
|
||||
*
|
||||
*
|
||||
* Outputs: Remember required information for future use.
|
||||
*
|
||||
* Description: Initialize the queue to be empty and set up other
|
||||
* mechanisms for sharing it between different threads.
|
||||
*
|
||||
* Start up xmit_thread to actually send the packets
|
||||
* at the appropriate time.
|
||||
*
|
||||
*--------------------------------------------------------------------*/
|
||||
|
||||
|
||||
|
||||
void beacon_init (struct misc_config_s *pconfig, struct digi_config_s *pdigi)
|
||||
{
|
||||
time_t now;
|
||||
int j;
|
||||
int count;
|
||||
#if __WIN32__
|
||||
HANDLE beacon_th;
|
||||
#else
|
||||
pthread_t beacon_tid;
|
||||
#endif
|
||||
|
||||
|
||||
|
||||
#if DEBUG
|
||||
text_color_set(DW_COLOR_DEBUG);
|
||||
dw_printf ("beacon_init ( ... )\n");
|
||||
#endif
|
||||
|
||||
|
||||
|
||||
/*
|
||||
* Save parameters for later use.
|
||||
*/
|
||||
g_misc_config_p = pconfig;
|
||||
g_digi_config_p = pdigi;
|
||||
|
||||
/*
|
||||
* Precompute the packet contents so any errors are
|
||||
* Reported once at start up time rather than for each transmission.
|
||||
* If a serious error is found, set type to BEACON_IGNORE and that
|
||||
* table entry should be ignored later on.
|
||||
*/
|
||||
for (j=0; j<g_misc_config_p->num_beacons; j++) {
|
||||
int chan = g_misc_config_p->beacon[j].chan;
|
||||
|
||||
if (chan < 0) chan = 0; /* For IGate, use channel 0 call. */
|
||||
|
||||
if (chan < pdigi->num_chans) {
|
||||
|
||||
if (strlen(pdigi->mycall[chan]) > 0 && strcasecmp(pdigi->mycall[chan], "NOCALL") != 0) {
|
||||
|
||||
switch (g_misc_config_p->beacon[j].btype) {
|
||||
|
||||
case BEACON_OBJECT:
|
||||
|
||||
/* Object name is required. */
|
||||
|
||||
if (strlen(g_misc_config_p->beacon[j].objname) == 0) {
|
||||
text_color_set(DW_COLOR_ERROR);
|
||||
dw_printf ("Config file, line %d: OBJNAME is required for OBEACON.\n", g_misc_config_p->beacon[j].lineno);
|
||||
g_misc_config_p->beacon[j].btype = BEACON_IGNORE;
|
||||
continue;
|
||||
}
|
||||
/* Fall thru. Ignore any warning about missing break. */
|
||||
|
||||
case BEACON_POSITION:
|
||||
|
||||
/* Location is required. */
|
||||
|
||||
if (g_misc_config_p->beacon[j].lat == G_UNKNOWN || g_misc_config_p->beacon[j].lon == G_UNKNOWN) {
|
||||
text_color_set(DW_COLOR_ERROR);
|
||||
dw_printf ("Config file, line %d: Latitude and longitude are required.\n", g_misc_config_p->beacon[j].lineno);
|
||||
g_misc_config_p->beacon[j].btype = BEACON_IGNORE;
|
||||
continue;
|
||||
}
|
||||
break;
|
||||
|
||||
case BEACON_TRACKER:
|
||||
|
||||
#if defined(GPS_ENABLED) || defined(DEBUG_SIM)
|
||||
g_using_gps++;
|
||||
#else
|
||||
text_color_set(DW_COLOR_ERROR);
|
||||
dw_printf ("Config file, line %d: GPS tracker feature is not enabled.\n", g_misc_config_p->beacon[j].lineno);
|
||||
g_misc_config_p->beacon[j].btype = BEACON_IGNORE;
|
||||
continue;
|
||||
#endif
|
||||
break;
|
||||
|
||||
case BEACON_CUSTOM:
|
||||
|
||||
/* INFO is required. */
|
||||
|
||||
if (g_misc_config_p->beacon[j].custom_info == NULL) {
|
||||
text_color_set(DW_COLOR_ERROR);
|
||||
dw_printf ("Config file, line %d: INFO is required for custom beacon.\n", g_misc_config_p->beacon[j].lineno);
|
||||
g_misc_config_p->beacon[j].btype = BEACON_IGNORE;
|
||||
continue;
|
||||
}
|
||||
break;
|
||||
|
||||
case BEACON_IGNORE:
|
||||
break;
|
||||
}
|
||||
}
|
||||
else {
|
||||
text_color_set(DW_COLOR_ERROR);
|
||||
dw_printf ("Config file, line %d: MYCALL must be set for beacon on channel %d. \n", g_misc_config_p->beacon[j].lineno, chan);
|
||||
g_misc_config_p->beacon[j].btype = BEACON_IGNORE;
|
||||
}
|
||||
}
|
||||
else {
|
||||
text_color_set(DW_COLOR_ERROR);
|
||||
dw_printf ("Config file, line %d: Invalid channel number %d for beacon. \n", g_misc_config_p->beacon[j].lineno, chan);
|
||||
g_misc_config_p->beacon[j].btype = BEACON_IGNORE;
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
* Calculate next time for each beacon.
|
||||
*/
|
||||
|
||||
now = time(NULL);
|
||||
|
||||
for (j=0; j<g_misc_config_p->num_beacons; j++) {
|
||||
#if DEBUG
|
||||
|
||||
text_color_set(DW_COLOR_DEBUG);
|
||||
dw_printf ("beacon[%d] chan=%d, delay=%d, every=%d\n",
|
||||
j,
|
||||
g_misc_config_p->beacon[j].chan,
|
||||
g_misc_config_p->beacon[j].delay,
|
||||
g_misc_config_p->beacon[j].every);
|
||||
#endif
|
||||
g_misc_config_p->beacon[j].next = now + g_misc_config_p->beacon[j].delay;
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* Connect to GPS receiver if any tracker beacons are configured.
|
||||
* If open fails, disable all tracker beacons.
|
||||
*/
|
||||
|
||||
#if DEBUG_SIM
|
||||
|
||||
g_using_gps = 1;
|
||||
|
||||
#elif ENABLE_GPS
|
||||
|
||||
if (g_using_gps > 0) {
|
||||
int err;
|
||||
|
||||
err = dwgps_init();
|
||||
if (err != 0) {
|
||||
text_color_set(DW_COLOR_ERROR);
|
||||
dw_printf ("All tracker beacons disabled.\n");
|
||||
g_using_gps = 0;
|
||||
|
||||
for (j=0; j<g_misc_config_p->num_beacons; j++) {
|
||||
if (g_misc_config_p->beacon[j].btype == BEACON_TRACKER) {
|
||||
g_misc_config_p->beacon[j].btype = BEACON_IGNORE;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
#endif
|
||||
|
||||
|
||||
/*
|
||||
* Start up thread for processing only if at least one is valid.
|
||||
*/
|
||||
|
||||
count = 0;
|
||||
for (j=0; j<g_misc_config_p->num_beacons; j++) {
|
||||
if (g_misc_config_p->beacon[j].btype != BEACON_IGNORE) {
|
||||
count++;
|
||||
}
|
||||
}
|
||||
|
||||
if (count >= 1) {
|
||||
|
||||
#if __WIN32__
|
||||
beacon_th = (HANDLE)_beginthreadex (NULL, 0, &beacon_thread, NULL, 0, NULL);
|
||||
if (beacon_th == NULL) {
|
||||
text_color_set(DW_COLOR_ERROR);
|
||||
dw_printf ("Could not create beacon thread\n");
|
||||
return;
|
||||
}
|
||||
#else
|
||||
int e;
|
||||
|
||||
e = pthread_create (&beacon_tid, NULL, beacon_thread, (void *)0);
|
||||
if (e != 0) {
|
||||
text_color_set(DW_COLOR_ERROR);
|
||||
perror("Could not create beacon thread");
|
||||
return;
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
|
||||
} /* end beacon_init */
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
/*-------------------------------------------------------------------
|
||||
*
|
||||
* Name: beacon_thread
|
||||
*
|
||||
* Purpose: Transmit beacons when it is time.
|
||||
*
|
||||
* Inputs: g_misc_config_p->beacon
|
||||
*
|
||||
* Outputs: g_misc_config_p->beacon[].next_time
|
||||
*
|
||||
* Description: Go to sleep until it is time for the next beacon.
|
||||
* Transmit any beacons scheduled for now.
|
||||
* Repeat.
|
||||
*
|
||||
*--------------------------------------------------------------------*/
|
||||
|
||||
#define KNOTS_TO_MPH 1.150779
|
||||
|
||||
#define MIN(x,y) ((x) < (y) ? (x) : (y))
|
||||
|
||||
|
||||
/* Difference between two angles. */
|
||||
|
||||
static inline float heading_change (float a, float b)
|
||||
{
|
||||
float diff;
|
||||
|
||||
diff = fabs(a - b);
|
||||
if (diff <= 180.)
|
||||
return (diff);
|
||||
else
|
||||
return (360. - diff);
|
||||
}
|
||||
|
||||
|
||||
#if __WIN32__
|
||||
static unsigned __stdcall beacon_thread (void *arg)
|
||||
#else
|
||||
static void * beacon_thread (void *arg)
|
||||
#endif
|
||||
{
|
||||
int j;
|
||||
time_t earliest;
|
||||
time_t now;
|
||||
|
||||
/*
|
||||
* Information from GPS.
|
||||
*/
|
||||
int fix = 0; /* 0 = none, 2 = 2D, 3 = 3D */
|
||||
double my_lat = 0; /* degrees */
|
||||
double my_lon = 0;
|
||||
float my_course = 0; /* degrees */
|
||||
float my_speed_knots = 0;
|
||||
float my_speed_mph = 0;
|
||||
float my_alt = 0; /* meters */
|
||||
|
||||
/*
|
||||
* SmartBeaconing state.
|
||||
*/
|
||||
time_t sb_prev_time = 0; /* Time of most recent transmission. */
|
||||
float sb_prev_course = 0; /* Most recent course reported. */
|
||||
//float sb_prev_speed_mph; /* Most recent speed reported. */
|
||||
int sb_every; /* Calculated time between transmissions. */
|
||||
|
||||
|
||||
#if DEBUG
|
||||
struct tm tm;
|
||||
char hms[20];
|
||||
|
||||
now = time(NULL);
|
||||
localtime_r (&now, &tm);
|
||||
strftime (hms, sizeof(hms), "%H:%M:%S", &tm);
|
||||
text_color_set(DW_COLOR_DEBUG);
|
||||
dw_printf ("beacon_thread: started %s\n", hms);
|
||||
#endif
|
||||
now = time(NULL);
|
||||
|
||||
while (1) {
|
||||
|
||||
assert (g_misc_config_p->num_beacons >= 1);
|
||||
|
||||
/*
|
||||
* Sleep until time for the earliest scheduled or
|
||||
* the soonest we could transmit due to corner pegging.
|
||||
*/
|
||||
|
||||
earliest = g_misc_config_p->beacon[0].next;
|
||||
for (j=1; j<g_misc_config_p->num_beacons; j++) {
|
||||
if (g_misc_config_p->beacon[j].btype == BEACON_IGNORE)
|
||||
continue;
|
||||
earliest = MIN(g_misc_config_p->beacon[j].next, earliest);
|
||||
}
|
||||
|
||||
if (g_misc_config_p->sb_configured && g_using_gps) {
|
||||
earliest = MIN(now + g_misc_config_p->sb_turn_time, earliest);
|
||||
earliest = MIN(now + g_misc_config_p->sb_fast_rate, earliest);
|
||||
}
|
||||
|
||||
if (earliest > now) {
|
||||
SLEEP_SEC (earliest - now);
|
||||
}
|
||||
|
||||
/*
|
||||
* Woke up. See what needs to be done.
|
||||
*/
|
||||
now = time(NULL);
|
||||
|
||||
#if DEBUG
|
||||
localtime_r (&now, &tm);
|
||||
strftime (hms, sizeof(hms), "%H:%M:%S", &tm);
|
||||
text_color_set(DW_COLOR_DEBUG);
|
||||
dw_printf ("beacon_thread: woke up %s\n", hms);
|
||||
#endif
|
||||
|
||||
/*
|
||||
* Get information from GPS if being used.
|
||||
* This needs to be done before the next scheduled tracker
|
||||
* beacon because corner pegging make it sooner.
|
||||
*/
|
||||
|
||||
#if DEBUG_SIM
|
||||
FILE *fp;
|
||||
char cs[40];
|
||||
|
||||
fp = fopen ("c:\\cygwin\\tmp\\cs", "r");
|
||||
if (fp != NULL) {
|
||||
fscanf (fp, "%f %f", &my_course, &my_speed_knots);
|
||||
fclose (fp);
|
||||
}
|
||||
else {
|
||||
fprintf (stderr, "Can't read /tmp/cs.\n");
|
||||
}
|
||||
fix = 3;
|
||||
my_speed_mph = KNOTS_TO_MPH * my_speed_knots;
|
||||
my_lat = 42.99;
|
||||
my_lon = 71.99;
|
||||
my_alt = 100;
|
||||
#else
|
||||
if (g_using_gps) {
|
||||
|
||||
fix = dwgps_read (&my_lat, &my_lon, &my_speed_knots, &my_course, &my_alt);
|
||||
my_speed_mph = KNOTS_TO_MPH * my_speed_knots;
|
||||
|
||||
/* Don't complain here for no fix. */
|
||||
/* Possibly at the point where about to transmit. */
|
||||
}
|
||||
#endif
|
||||
|
||||
/*
|
||||
* Run SmartBeaconing calculation if configured and GPS data available.
|
||||
*/
|
||||
if (g_misc_config_p->sb_configured && g_using_gps && fix >= 2) {
|
||||
|
||||
if (my_speed_mph > g_misc_config_p->sb_fast_speed) {
|
||||
sb_every = g_misc_config_p->sb_fast_rate;
|
||||
}
|
||||
else if (my_speed_mph < g_misc_config_p->sb_slow_speed) {
|
||||
sb_every = g_misc_config_p->sb_slow_rate;
|
||||
}
|
||||
else {
|
||||
/* Can't divide by 0 assuming sb_slow_speed > 0. */
|
||||
sb_every = ( g_misc_config_p->sb_fast_rate * g_misc_config_p->sb_fast_speed ) / my_speed_mph;
|
||||
}
|
||||
|
||||
#if DEBUG_SIM
|
||||
text_color_set(DW_COLOR_DEBUG);
|
||||
dw_printf ("SB: fast %d %d slow %d %d speed=%.1f every=%d\n",
|
||||
g_misc_config_p->sb_fast_speed, g_misc_config_p->sb_fast_rate,
|
||||
g_misc_config_p->sb_slow_speed, g_misc_config_p->sb_slow_rate,
|
||||
my_speed_mph, sb_every);
|
||||
#endif
|
||||
|
||||
/*
|
||||
* Test for "Corner Pegging" if moving.
|
||||
*/
|
||||
if (my_speed_mph >= 1.0) {
|
||||
int turn_threshold = g_misc_config_p->sb_turn_angle +
|
||||
g_misc_config_p->sb_turn_slope / my_speed_mph;
|
||||
|
||||
#if DEBUG_SIM
|
||||
text_color_set(DW_COLOR_DEBUG);
|
||||
dw_printf ("SB-moving: course %.0f prev %.0f thresh %d\n",
|
||||
my_course, sb_prev_course, turn_threshold);
|
||||
#endif
|
||||
if (heading_change(my_course, sb_prev_course) > turn_threshold &&
|
||||
now >= sb_prev_time + g_misc_config_p->sb_turn_time) {
|
||||
|
||||
/* Send it now. */
|
||||
for (j=0; j<g_misc_config_p->num_beacons; j++) {
|
||||
if (g_misc_config_p->beacon[j].btype == BEACON_TRACKER) {
|
||||
g_misc_config_p->beacon[j].next = now;
|
||||
}
|
||||
}
|
||||
} /* significant change in direction */
|
||||
} /* is moving */
|
||||
} /* apply SmartBeaconing */
|
||||
|
||||
|
||||
for (j=0; j<g_misc_config_p->num_beacons; j++) {
|
||||
|
||||
if (g_misc_config_p->beacon[j].btype == BEACON_IGNORE)
|
||||
continue;
|
||||
|
||||
if (g_misc_config_p->beacon[j].next <= now) {
|
||||
|
||||
int strict = 1; /* Strict packet checking because they will go over air. */
|
||||
char stemp[20];
|
||||
char info[AX25_MAX_INFO_LEN];
|
||||
char beacon_text[AX25_MAX_PACKET_LEN];
|
||||
packet_t pp = NULL;
|
||||
char mycall[AX25_MAX_ADDR_LEN];
|
||||
|
||||
/*
|
||||
* Obtain source call for the beacon.
|
||||
* This could potentially be different on different channels.
|
||||
* When sending to IGate server, use call from first radio channel.
|
||||
*
|
||||
* Check added in version 1.0a. Previously used index of -1.
|
||||
*/
|
||||
strcpy (mycall, "NOCALL");
|
||||
|
||||
if (g_misc_config_p->beacon[j].chan == -1) {
|
||||
strcpy (mycall, g_digi_config_p->mycall[0]);
|
||||
}
|
||||
else {
|
||||
strcpy (mycall, g_digi_config_p->mycall[g_misc_config_p->beacon[j].chan]);
|
||||
}
|
||||
|
||||
if (strlen(mycall) == 0 || strcmp(mycall, "NOCALL") == 0) {
|
||||
text_color_set(DW_COLOR_ERROR);
|
||||
dw_printf ("MYCALL not set for beacon in config file line %d.\n", g_misc_config_p->beacon[j].lineno);
|
||||
continue;
|
||||
}
|
||||
|
||||
/*
|
||||
* Prepare the monitor format header.
|
||||
*/
|
||||
|
||||
strcpy (beacon_text, mycall);
|
||||
strcat (beacon_text, ">");
|
||||
sprintf (stemp, "%s%1d%1d", APP_TOCALL, MAJOR_VERSION, MINOR_VERSION);
|
||||
strcat (beacon_text, stemp);
|
||||
if (g_misc_config_p->beacon[j].via) {
|
||||
strcat (beacon_text, ",");
|
||||
strcat (beacon_text, g_misc_config_p->beacon[j].via);
|
||||
}
|
||||
strcat (beacon_text, ":");
|
||||
|
||||
/*
|
||||
* Add the info part depending on beacon type.
|
||||
*/
|
||||
switch (g_misc_config_p->beacon[j].btype) {
|
||||
|
||||
case BEACON_POSITION:
|
||||
|
||||
encode_position (g_misc_config_p->beacon[j].compress, g_misc_config_p->beacon[j].lat, g_misc_config_p->beacon[j].lon,
|
||||
g_misc_config_p->beacon[j].symtab, g_misc_config_p->beacon[j].symbol,
|
||||
g_misc_config_p->beacon[j].power, g_misc_config_p->beacon[j].height, g_misc_config_p->beacon[j].gain, g_misc_config_p->beacon[j].dir,
|
||||
0, 0, /* course, speed */
|
||||
g_misc_config_p->beacon[j].freq, g_misc_config_p->beacon[j].tone, g_misc_config_p->beacon[j].offset,
|
||||
g_misc_config_p->beacon[j].comment,
|
||||
info);
|
||||
strcat (beacon_text, info);
|
||||
g_misc_config_p->beacon[j].next = now + g_misc_config_p->beacon[j].every;
|
||||
break;
|
||||
|
||||
case BEACON_OBJECT:
|
||||
|
||||
encode_object (g_misc_config_p->beacon[j].objname, g_misc_config_p->beacon[j].compress, 0, g_misc_config_p->beacon[j].lat, g_misc_config_p->beacon[j].lon,
|
||||
g_misc_config_p->beacon[j].symtab, g_misc_config_p->beacon[j].symbol,
|
||||
g_misc_config_p->beacon[j].power, g_misc_config_p->beacon[j].height, g_misc_config_p->beacon[j].gain, g_misc_config_p->beacon[j].dir,
|
||||
0, 0, /* course, speed */
|
||||
g_misc_config_p->beacon[j].freq, g_misc_config_p->beacon[j].tone, g_misc_config_p->beacon[j].offset, g_misc_config_p->beacon[j].comment,
|
||||
info);
|
||||
strcat (beacon_text, info);
|
||||
g_misc_config_p->beacon[j].next = now + g_misc_config_p->beacon[j].every;
|
||||
break;
|
||||
|
||||
case BEACON_TRACKER:
|
||||
|
||||
if (fix >= 2) {
|
||||
int coarse; /* APRS encoder wants 1 - 360. */
|
||||
/* 0 means none or unknown. */
|
||||
|
||||
coarse = (int)roundf(my_course);
|
||||
if (coarse == 0) {
|
||||
coarse = 360;
|
||||
}
|
||||
encode_position (g_misc_config_p->beacon[j].compress,
|
||||
my_lat, my_lon,
|
||||
g_misc_config_p->beacon[j].symtab, g_misc_config_p->beacon[j].symbol,
|
||||
g_misc_config_p->beacon[j].power, g_misc_config_p->beacon[j].height, g_misc_config_p->beacon[j].gain, g_misc_config_p->beacon[j].dir,
|
||||
coarse, (int)roundf(my_speed_knots),
|
||||
g_misc_config_p->beacon[j].freq, g_misc_config_p->beacon[j].tone, g_misc_config_p->beacon[j].offset,
|
||||
g_misc_config_p->beacon[j].comment,
|
||||
info);
|
||||
strcat (beacon_text, info);
|
||||
|
||||
/* Remember most recent tracker beacon. */
|
||||
|
||||
sb_prev_time = now;
|
||||
sb_prev_course = my_course;
|
||||
//sb_prev_speed_mph = my_speed_mph;
|
||||
|
||||
/* Calculate time for next transmission. */
|
||||
if (g_misc_config_p->sb_configured) {
|
||||
g_misc_config_p->beacon[j].next = now + sb_every;
|
||||
}
|
||||
else {
|
||||
g_misc_config_p->beacon[j].next = now + g_misc_config_p->beacon[j].every;
|
||||
}
|
||||
}
|
||||
else {
|
||||
g_misc_config_p->beacon[j].next = now + 2;
|
||||
continue; /* No fix. Try again in a couple seconds. */
|
||||
}
|
||||
break;
|
||||
|
||||
case BEACON_CUSTOM:
|
||||
|
||||
if (g_misc_config_p->beacon[j].custom_info != NULL) {
|
||||
strcat (beacon_text, g_misc_config_p->beacon[j].custom_info);
|
||||
}
|
||||
else {
|
||||
text_color_set(DW_COLOR_ERROR);
|
||||
dw_printf ("Internal error. custom_info is null. %s %d\n", __FILE__, __LINE__);
|
||||
continue;
|
||||
}
|
||||
g_misc_config_p->beacon[j].next = now + g_misc_config_p->beacon[j].every;
|
||||
break;
|
||||
|
||||
case BEACON_IGNORE:
|
||||
default:
|
||||
break;
|
||||
|
||||
} /* switch beacon type. */
|
||||
|
||||
/*
|
||||
* Parse monitor format into form for transmission.
|
||||
*/
|
||||
pp = ax25_from_text (beacon_text, strict);
|
||||
|
||||
if (pp != NULL) {
|
||||
|
||||
/* Send to IGate server or radio. */
|
||||
|
||||
if (g_misc_config_p->beacon[j].chan == -1) {
|
||||
#if 1
|
||||
text_color_set(DW_COLOR_XMIT);
|
||||
dw_printf ("[ig] %s\n", beacon_text);
|
||||
#endif
|
||||
igate_send_rec_packet (0, pp);
|
||||
ax25_delete (pp);
|
||||
}
|
||||
else {
|
||||
tq_append (g_misc_config_p->beacon[j].chan, TQ_PRIO_1_LO, pp);
|
||||
}
|
||||
}
|
||||
else {
|
||||
text_color_set(DW_COLOR_ERROR);
|
||||
dw_printf ("Config file: Failed to parse packet constructed from line %d.\n", g_misc_config_p->beacon[j].lineno);
|
||||
dw_printf ("%s\n", beacon_text);
|
||||
}
|
||||
|
||||
} /* if time to send it */
|
||||
|
||||
} /* for each configured beacon */
|
||||
|
||||
} /* do forever */
|
||||
|
||||
} /* end beacon_thread */
|
||||
|
||||
/* end beacon.c */
|
4
beacon.h
4
beacon.h
|
@ -1,4 +0,0 @@
|
|||
|
||||
/* beacon.h */
|
||||
|
||||
void beacon_init (struct misc_config_s *pconfig, struct digi_config_s *pdigi);
|
|
@ -0,0 +1 @@
|
|||
include(CPack)
|
|
@ -0,0 +1,10 @@
|
|||
[Desktop Entry]
|
||||
Name=@APPLICATION_NAME@
|
||||
Comment=APRS Soundcard TNC
|
||||
Exec=@APPLICATION_DESKTOP_EXEC@
|
||||
Icon=@CMAKE_PROJECT_NAME@_icon.png
|
||||
StartupNotify=true
|
||||
Terminal=false
|
||||
Type=Application
|
||||
Categories=HamRadio
|
||||
Keywords=Ham Radio;APRS;Soundcard TNC;KISS;AGWPE;AX.25
|
|
@ -0,0 +1 @@
|
|||
MAINICON ICON "direwolf_icon.ico"
|
Before Width: | Height: | Size: 361 KiB After Width: | Height: | Size: 361 KiB |
Before Width: | Height: | Size: 24 KiB After Width: | Height: | Size: 24 KiB |
|
@ -0,0 +1,16 @@
|
|||
#include <stdint.h>
|
||||
#include <arm_neon.h>
|
||||
#include <stdlib.h>
|
||||
#include <signal.h>
|
||||
|
||||
void signalHandler(int signum) {
|
||||
exit(signum); // SIGILL = 4
|
||||
}
|
||||
|
||||
int main(int argc, char* argv[])
|
||||
{
|
||||
signal(SIGILL, signalHandler);
|
||||
uint32x4_t x={0};
|
||||
x=veorq_u32(x,x);
|
||||
return 0;
|
||||
}
|
|
@ -0,0 +1,15 @@
|
|||
#include <signal.h>
|
||||
#include <stdlib.h>
|
||||
#include <immintrin.h>
|
||||
|
||||
void signalHandler(int signum) {
|
||||
exit(signum); // SIGILL = 4
|
||||
}
|
||||
|
||||
int main(int argc, char* argv[])
|
||||
{
|
||||
signal(SIGILL, signalHandler);
|
||||
__m256d x = _mm256_setzero_pd();
|
||||
x=_mm256_addsub_pd(x,x);
|
||||
return 0;
|
||||
}
|
|
@ -0,0 +1,15 @@
|
|||
#include <signal.h>
|
||||
#include <stdlib.h>
|
||||
#include <immintrin.h>
|
||||
|
||||
void signalHandler(int signum) {
|
||||
exit(signum); // SIGILL = 4
|
||||
}
|
||||
|
||||
int main(int argc, char* argv[])
|
||||
{
|
||||
signal(SIGILL, signalHandler);
|
||||
__m256i x = _mm256_setzero_si256();
|
||||
x=_mm256_add_epi64 (x,x);
|
||||
return 0;
|
||||
}
|
|
@ -0,0 +1,16 @@
|
|||
#include <stdint.h>
|
||||
#include <stdlib.h>
|
||||
#include <signal.h>
|
||||
#include <immintrin.h>
|
||||
|
||||
void signalHandler(int signum) {
|
||||
exit(signum); // SIGILL = 4
|
||||
}
|
||||
|
||||
int main(int argc, char* argv[])
|
||||
{
|
||||
signal(SIGILL, signalHandler);
|
||||
uint64_t x[8] = {0};
|
||||
__m512i y = _mm512_loadu_si512((__m512i*)x);
|
||||
return 0;
|
||||
}
|
|
@ -0,0 +1,15 @@
|
|||
#include <signal.h>
|
||||
#include <stdlib.h>
|
||||
#include <emmintrin.h>
|
||||
|
||||
void signalHandler(int signum) {
|
||||
exit(signum); // SIGILL = 4
|
||||
}
|
||||
|
||||
int main(int argc, char* argv[])
|
||||
{
|
||||
signal(SIGILL, signalHandler);
|
||||
__m128i x = _mm_setzero_si128();
|
||||
x=_mm_add_epi64(x,x);
|
||||
return 0;
|
||||
}
|
|
@ -0,0 +1,16 @@
|
|||
#include <signal.h>
|
||||
#include <stdlib.h>
|
||||
#include <emmintrin.h>
|
||||
#include <pmmintrin.h>
|
||||
|
||||
void signalHandler(int signum) {
|
||||
exit(signum); // SIGILL = 4
|
||||
}
|
||||
|
||||
int main(int argc, char* argv[])
|
||||
{
|
||||
signal(SIGILL, signalHandler);
|
||||
__m128d x = _mm_setzero_pd();
|
||||
x=_mm_addsub_pd(x,x);
|
||||
return 0;
|
||||
}
|
|
@ -0,0 +1,18 @@
|
|||
#include <signal.h>
|
||||
#include <stdlib.h>
|
||||
#include <emmintrin.h>
|
||||
#include <smmintrin.h>
|
||||
|
||||
void signalHandler(int signum) {
|
||||
exit(signum); // SIGILL = 4
|
||||
}
|
||||
|
||||
int main(int argc, char* argv[])
|
||||
{
|
||||
signal(SIGILL, signalHandler);
|
||||
__m128i x = _mm_setzero_si128();
|
||||
__m128i a = _mm_setzero_si128();
|
||||
__m128i b = _mm_setzero_si128();
|
||||
x=_mm_blend_epi16(a,b,4);
|
||||
return 0;
|
||||
}
|
|
@ -0,0 +1,15 @@
|
|||
#include <signal.h>
|
||||
#include <stdlib.h>
|
||||
#include <nmmintrin.h>
|
||||
|
||||
void signalHandler(int signum) {
|
||||
exit(signum); // SIGILL = 4
|
||||
}
|
||||
|
||||
int main(int argc, char* argv[])
|
||||
{
|
||||
signal(SIGILL, signalHandler);
|
||||
unsigned int x=32;
|
||||
x=_mm_crc32_u8(x,4);
|
||||
return 0;
|
||||
}
|
|
@ -0,0 +1,16 @@
|
|||
#include <signal.h>
|
||||
#include <stdlib.h>
|
||||
#include <emmintrin.h>
|
||||
#include <tmmintrin.h>
|
||||
|
||||
void signalHandler(int signum) {
|
||||
exit(signum); // SIGILL = 4
|
||||
}
|
||||
|
||||
int main(int argc, char* argv[])
|
||||
{
|
||||
signal(SIGILL, signalHandler);
|
||||
__m128i x = _mm_setzero_si128();
|
||||
x=_mm_alignr_epi8(x,x,2);
|
||||
return 0;
|
||||
}
|
|
@ -0,0 +1,21 @@
|
|||
if(NOT EXISTS "@CMAKE_CURRENT_BINARY_DIR@/install_manifest.txt")
|
||||
message(FATAL_ERROR "Cannot find install manifest: @CMAKE_CURRENT_BINARY_DIR@/install_manifest.txt")
|
||||
endif(NOT EXISTS "@CMAKE_CURRENT_BINARY_DIR@/install_manifest.txt")
|
||||
|
||||
file(READ "@CMAKE_CURRENT_BINARY_DIR@/install_manifest.txt" files)
|
||||
string(REGEX REPLACE "\n" ";" files "${files}")
|
||||
foreach(file ${files})
|
||||
message(STATUS "Uninstalling $ENV{DESTDIR}${file}")
|
||||
if(IS_SYMLINK "$ENV{DESTDIR}${file}" OR EXISTS "$ENV{DESTDIR}${file}")
|
||||
exec_program(
|
||||
"@CMAKE_COMMAND@" ARGS "-E remove \"$ENV{DESTDIR}${file}\""
|
||||
OUTPUT_VARIABLE rm_out
|
||||
RETURN_VALUE rm_retval
|
||||
)
|
||||
if(NOT "${rm_retval}" STREQUAL 0)
|
||||
message(FATAL_ERROR "Problem when removing $ENV{DESTDIR}${file}")
|
||||
endif(NOT "${rm_retval}" STREQUAL 0)
|
||||
else(IS_SYMLINK "$ENV{DESTDIR}${file}" OR EXISTS "$ENV{DESTDIR}${file}")
|
||||
message(STATUS "File $ENV{DESTDIR}${file} does not exist.")
|
||||
endif(IS_SYMLINK "$ENV{DESTDIR}${file}" OR EXISTS "$ENV{DESTDIR}${file}")
|
||||
endforeach(file)
|
|
@ -0,0 +1,19 @@
|
|||
|
||||
find_library(AVAHI_COMMON_LIBRARY NAMES avahi-common PATHS ${PC_AVAHI_CLIENT_LIBRARY_DIRS})
|
||||
if(AVAHI_COMMON_LIBRARY)
|
||||
set(AVAHI_COMMON_FOUND TRUE)
|
||||
endif()
|
||||
|
||||
find_library(AVAHI_CLIENT_LIBRARY NAMES avahi-client PATHS ${PC_AVAHI_CLIENT_LIBRARY_DIRS})
|
||||
if(AVAHI_CLIENT_LIBRARY)
|
||||
set(AVAHI_CLIENT_FOUND TRUE)
|
||||
endif()
|
||||
|
||||
FIND_PACKAGE_HANDLE_STANDARD_ARGS(Avahi DEFAULT_MSG AVAHI_COMMON_FOUND AVAHI_CLIENT_FOUND)
|
||||
|
||||
if (AVAHI_FOUND)
|
||||
set(AVAHI_INCLUDE_DIRS ${AVAHI_UI_INCLUDE_DIR})
|
||||
set(AVAHI_LIBRARIES ${AVAHI_COMMON_LIBRARY} ${AVAHI_CLIENT_LIBRARY})
|
||||
endif()
|
||||
|
||||
mark_as_advanced(AVAHI_INCLUDE_DIRS AVAHI_LIBRARIES)
|
|
@ -0,0 +1,383 @@
|
|||
# Clang or AppleClang (see CMP0025)
|
||||
if(NOT DEFINED C_CLANG AND CMAKE_CXX_COMPILER_ID MATCHES "Clang")
|
||||
set(C_CLANG 1)
|
||||
elseif(NOT DEFINED C_GCC AND CMAKE_CXX_COMPILER_ID MATCHES "GNU")
|
||||
set(C_GCC 1)
|
||||
elseif(NOT DEFINED C_MSVC AND CMAKE_CXX_COMPILER_ID MATCHES "MSVC")
|
||||
set(C_MSVC 1)
|
||||
endif()
|
||||
|
||||
# Detect current compilation architecture and create standard definitions
|
||||
include(CheckSymbolExists)
|
||||
function(detect_architecture symbol arch)
|
||||
if (NOT DEFINED ARCHITECTURE)
|
||||
set(CMAKE_REQUIRED_QUIET 1)
|
||||
check_symbol_exists("${symbol}" "" ARCHITECTURE_${arch})
|
||||
unset(CMAKE_REQUIRED_QUIET)
|
||||
|
||||
# The output variable needs to be unique across invocations otherwise
|
||||
# CMake's crazy scope rules will keep it defined
|
||||
if (ARCHITECTURE_${arch})
|
||||
set(ARCHITECTURE "${arch}" PARENT_SCOPE)
|
||||
set(ARCHITECTURE_${arch} 1 PARENT_SCOPE)
|
||||
add_definitions(-DARCHITECTURE_${arch}=1)
|
||||
endif()
|
||||
endif()
|
||||
endfunction()
|
||||
|
||||
# direwolf versions thru 1.5 were available pre-built for 32 bit Windows targets.
|
||||
# Research and experimentation revealed that the SSE instructions made a big
|
||||
# difference in runtime speed but SSE2 and later were not significantly better
|
||||
# for this application. I decided to build with only the SSE instructions making
|
||||
# the Pentium 3 the minimum requirement. SSE2 would require at least a Pentium 4
|
||||
# and offered no significant performance advantage.
|
||||
# These are ancient history - from the previous Century - but old computers, generally
|
||||
# considered useless for anything else, often end up in the ham shack.
|
||||
#
|
||||
# When cmake was first used for direwolf, the default target became 64 bit and the
|
||||
# SSE2, SSE3, SSE4.1, and SSE4.2 instructions were automatically enabled based on the
|
||||
# build machine capabilities. This was fine until I tried running the application
|
||||
# on a computer much older than where it was built. It did not have the SSE4 instructions
|
||||
# and the application died without a clue for the reason.
|
||||
# Just how much benefit do these new instructions provide for this application?
|
||||
#
|
||||
# These were all run on the same computer, but compiled in different ways.
|
||||
# Times to run atest with Track 1 of the TNC test CD:
|
||||
#
|
||||
# direwolf 1.5 - 32 bit target - gcc 6.3.0
|
||||
#
|
||||
# 60.4 sec. Pentium 3 with SSE
|
||||
#
|
||||
# direwolf 1.6 - 32 bit target - gcc 7.4.0
|
||||
#
|
||||
# 81.0 sec. with no SIMD instructions enabled.
|
||||
# 54.4 sec. with SSE
|
||||
# 52.0 sec. with SSE2
|
||||
# 52.4 sec. with SSE2, SSE3
|
||||
# 52.3 sec. with SSE2, SSE3, SSE4.1, SSE4.2
|
||||
# 49.9 sec. Fedora standard: -m32 -march=i686 -mtune=generic -msse2 -mfpmath=sse
|
||||
# 50.4 sec. sse not sse2: -m32 -march=i686 -mtune=generic -msse -mfpmath=sse
|
||||
#
|
||||
# That's what I found several years ago with a much older compiler.
|
||||
# The original SSE helped a lot but SSE2 and later made little difference.
|
||||
#
|
||||
# direwolf 1.6 - 64 bit target - gcc 7.4.0
|
||||
#
|
||||
# 34.8 sec. with no SIMD instructions enabled.
|
||||
# 34.8 sec. with SSE
|
||||
# 34.8 sec. with SSE2
|
||||
# 34.2 sec. with SSE2, SSE3
|
||||
# 33.5 sec. with SSE2, SSE3, SSE4.1, SSE4.2
|
||||
# 33.4 Fedora standard: -mtune=generic
|
||||
#
|
||||
# Why do we see such little variation? 64-bit target implies
|
||||
# SSE, SSE2, SSE3 instructions are available.
|
||||
#
|
||||
# Building for a 64 bit target makes it run about 1.5x faster on the same hardware.
|
||||
#
|
||||
# The default will be set for maximum portability so packagers won't need to
|
||||
# to anything special.
|
||||
#
|
||||
#
|
||||
# While ENABLE_GENERIC also had the desired result (for x86_64), I don't think
|
||||
# it is the right approach. It prevents the detection of the architecture,
|
||||
# i.e. x86, x86_64, ARM, ARM64. That's why it did not go looking for the various
|
||||
# SSE instructions. For x86, we would miss out on using SSE.
|
||||
|
||||
if (NOT ENABLE_GENERIC)
|
||||
if (C_MSVC)
|
||||
detect_architecture("_M_AMD64" x86_64)
|
||||
detect_architecture("_M_IX86" x86)
|
||||
detect_architecture("_M_ARM" ARM)
|
||||
detect_architecture("_M_ARM64" ARM64)
|
||||
else()
|
||||
detect_architecture("__x86_64__" x86_64)
|
||||
detect_architecture("__i386__" x86)
|
||||
detect_architecture("__arm__" ARM)
|
||||
detect_architecture("__aarch64__" ARM64)
|
||||
endif()
|
||||
endif()
|
||||
if (NOT DEFINED ARCHITECTURE)
|
||||
set(ARCHITECTURE "GENERIC")
|
||||
set(ARCHITECTURE_GENERIC 1)
|
||||
add_definitions(-DARCHITECTURE_GENERIC=1)
|
||||
endif()
|
||||
message(STATUS "Target architecture: ${ARCHITECTURE}")
|
||||
|
||||
set(TEST_DIR ${PROJECT_SOURCE_DIR}/cmake/cpu_tests)
|
||||
|
||||
# flag that set the minimum cpu flag requirements
|
||||
# used to create re-distribuitable binary
|
||||
|
||||
if (${ARCHITECTURE} MATCHES "x86_64|x86" AND (FORCE_SSE OR FORCE_SSSE3 OR FORCE_SSE41))
|
||||
if (FORCE_SSE)
|
||||
set(HAS_SSE ON CACHE BOOL "SSE SIMD enabled")
|
||||
if(C_GCC OR C_CLANG)
|
||||
if (${ARCHITECTURE} MATCHES "x86_64")
|
||||
# All 64-bit capable chips support MMX, SSE, SSE2, and SSE3
|
||||
# so they are all enabled automatically. We don't want to use
|
||||
# SSE4, based on build machine capabilites, because the application
|
||||
# would not run properly on an older CPU.
|
||||
set( CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -mtune=generic" )
|
||||
set( CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -mtune=generic" )
|
||||
else()
|
||||
# Fedora standard uses -msse2 here.
|
||||
# I dropped it down to -msse for greater compatibility and little penalty.
|
||||
set( CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -m32 -march=i686 -mtune=generic -msse -mfpmath=sse" )
|
||||
set( CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -m32 -march=i686 -mtune=generic -msse -mfpmath=sse" )
|
||||
endif()
|
||||
message(STATUS "Use SSE SIMD instructions")
|
||||
add_definitions(-DUSE_SSE)
|
||||
elseif(C_MSVC)
|
||||
set( CMAKE_C_FLAGS_DEBUG "${CMAKE_C_FLAGS_DEBUG} /arch:SSE" )
|
||||
set( CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} /arch:SSE" )
|
||||
set( CMAKE_C_FLAGS_RELEASE "${CMAKE_C_FLAGS_RELEASE} /Oi /GL /Ot /Ox" )
|
||||
set( CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} /Oi /GL /Ot /Ox" )
|
||||
set( CMAKE_EXE_LINKER_FLAGS_RELEASE "${CMAKE_EXE_LINKER_FLAGS_RELEASE} /LTCG" )
|
||||
message(STATUS "Use MSVC SSSE3 SIMD instructions")
|
||||
add_definitions (/D "_CRT_SECURE_NO_WARNINGS")
|
||||
add_definitions(-DUSE_SSSE3)
|
||||
endif()
|
||||
elseif (FORCE_SSSE3)
|
||||
set(HAS_SSSE3 ON CACHE BOOL "SSSE3 SIMD enabled")
|
||||
if(C_GCC OR C_CLANG)
|
||||
set( CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -mssse3" )
|
||||
set( CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -mssse3" )
|
||||
message(STATUS "Use SSSE3 SIMD instructions")
|
||||
add_definitions(-DUSE_SSSE3)
|
||||
elseif(C_MSVC)
|
||||
set( CMAKE_C_FLAGS_DEBUG "${CMAKE_C_FLAGS_DEBUG} /arch:SSSE3" )
|
||||
set( CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} /arch:SSSE3" )
|
||||
set( CMAKE_C_FLAGS_RELEASE "${CMAKE_C_FLAGS_RELEASE} /Oi /GL /Ot /Ox" )
|
||||
set( CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} /Oi /GL /Ot /Ox" )
|
||||
set( CMAKE_EXE_LINKER_FLAGS_RELEASE "${CMAKE_EXE_LINKER_FLAGS_RELEASE} /LTCG" )
|
||||
message(STATUS "Use MSVC SSSE3 SIMD instructions")
|
||||
add_definitions (/D "_CRT_SECURE_NO_WARNINGS")
|
||||
add_definitions(-DUSE_SSSE3)
|
||||
endif()
|
||||
elseif (FORCE_SSE41)
|
||||
set(HAS_SSSE3 ON CACHE BOOL "SSSE3 SIMD enabled")
|
||||
set(HAS_SSE4_1 ON CACHE BOOL "Architecture has SSE 4.1 SIMD enabled")
|
||||
if(C_GCC OR C_CLANG)
|
||||
set( CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -msse4.1" )
|
||||
set( CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -msse4.1" )
|
||||
message(STATUS "Use SSE 4.1 SIMD instructions")
|
||||
add_definitions(-DUSE_SSSE3)
|
||||
add_definitions(-DUSE_SSE4_1)
|
||||
elseif(C_MSVC)
|
||||
# seems that from MSVC 2015 comiler doesn't support those flags
|
||||
set( CMAKE_C_FLAGS_DEBUG "${CMAKE_C_FLAGS_DEBUG} /arch:SSE4_1" )
|
||||
set( CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} /arch:SSE4_1" )
|
||||
set( CMAKE_C_FLAGS_RELEASE "${CMAKE_C_FLAGS_RELEASE} /Oi /GL /Ot /Ox" )
|
||||
set( CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} /Oi /GL /Ot /Ox" )
|
||||
set( CMAKE_EXE_LINKER_FLAGS_RELEASE "${CMAKE_EXE_LINKER_FLAGS_RELEASE} /LTCG" )
|
||||
message(STATUS "Use SSE 4.1 SIMD instructions")
|
||||
add_definitions (/D "_CRT_SECURE_NO_WARNINGS")
|
||||
add_definitions(-DUSE_SSSE3)
|
||||
add_definitions(-DUSE_SSE4_1)
|
||||
endif()
|
||||
endif()
|
||||
else ()
|
||||
if (${ARCHITECTURE} MATCHES "x86_64|x86")
|
||||
if(C_MSVC)
|
||||
try_run(RUN_SSE2 COMPILE_SSE2 "${CMAKE_BINARY_DIR}/tmp" "${TEST_DIR}/test_x86_sse2.cxx" COMPILE_DEFINITIONS /O0)
|
||||
else()
|
||||
try_run(RUN_SSE2 COMPILE_SSE2 "${CMAKE_BINARY_DIR}/tmp" "${TEST_DIR}/test_x86_sse2.cxx" COMPILE_DEFINITIONS -msse2 -O0)
|
||||
endif()
|
||||
if(COMPILE_SSE2 AND RUN_SSE2 EQUAL 0)
|
||||
set(HAS_SSE2 ON CACHE BOOL "Architecture has SSSE2 SIMD enabled")
|
||||
message(STATUS "Use SSE2 SIMD instructions")
|
||||
if(C_GCC OR C_CLANG)
|
||||
set( CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -msse2" )
|
||||
set( CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -msse2" )
|
||||
add_definitions(-DUSE_SSE2)
|
||||
elseif(C_MSVC)
|
||||
set( CMAKE_C_FLAGS_DEBUG "${CMAKE_C_FLAGS_DEBUG} /arch:SSE2" )
|
||||
set( CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} /arch:SSE2" )
|
||||
set( CMAKE_C_FLAGS_RELEASE "${CMAKE_C_FLAGS_RELEASE} /Oi /GL /Ot /Ox /arch:SSE2" )
|
||||
set( CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} /Oi /GL /Ot /Ox /arch:SSE2" )
|
||||
set( CMAKE_EXE_LINKER_FLAGS_RELEASE "${CMAKE_EXE_LINKER_FLAGS_RELEASE} /LTCG" )
|
||||
add_definitions (/D "_CRT_SECURE_NO_WARNINGS")
|
||||
add_definitions(-DUSE_SSE2)
|
||||
endif()
|
||||
else()
|
||||
set(HAS_SSE2 OFF CACHE BOOL "Architecture does not have SSSE2 SIMD enabled")
|
||||
endif()
|
||||
if(C_MSVC)
|
||||
try_run(RUN_SSSE3 COMPILE_SSSE3 "${CMAKE_BINARY_DIR}/tmp" "${TEST_DIR}/test_x86_ssse3.cxx" COMPILE_DEFINITIONS /O0)
|
||||
else()
|
||||
try_run(RUN_SSSE3 COMPILE_SSSE3 "${CMAKE_BINARY_DIR}/tmp" "${TEST_DIR}/test_x86_ssse3.cxx" COMPILE_DEFINITIONS -mssse3 -O0)
|
||||
endif()
|
||||
if(COMPILE_SSSE3 AND RUN_SSSE3 EQUAL 0)
|
||||
set(HAS_SSSE3 ON CACHE BOOL "Architecture has SSSE3 SIMD enabled")
|
||||
message(STATUS "Use SSSE3 SIMD instructions")
|
||||
if(C_GCC OR C_CLANG)
|
||||
set( CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -mssse3" )
|
||||
set( CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -mssse3" )
|
||||
add_definitions(-DUSE_SSSE3)
|
||||
elseif(C_MSVC)
|
||||
# seems not present on MSVC 2017
|
||||
#set( CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} /Oi /GL /Ot /Ox /arch:SSSE3" )
|
||||
set( CMAKE_C_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} /Oi /GL /Ot /Ox" )
|
||||
set( CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} /Oi /GL /Ot /Ox" )
|
||||
set( CMAKE_EXE_LINKER_FLAGS_RELEASE "${CMAKE_EXE_LINKER_FLAGS_RELEASE} /LTCG" )
|
||||
add_definitions (/D "_CRT_SECURE_NO_WARNINGS")
|
||||
add_definitions(-DUSE_SSSE3)
|
||||
endif()
|
||||
else()
|
||||
set(HAS_SSSE3 OFF CACHE BOOL "Architecture does not have SSSE3 SIMD enabled")
|
||||
endif()
|
||||
if(C_MSVC)
|
||||
try_run(RUN_SSE4_1 COMPILE_SSE4_1 "${CMAKE_BINARY_DIR}/tmp" "${TEST_DIR}/test_x86_sse41.cxx" COMPILE_DEFINITIONS /O0)
|
||||
else()
|
||||
try_run(RUN_SSE4_1 COMPILE_SSE4_1 "${CMAKE_BINARY_DIR}/tmp" "${TEST_DIR}/test_x86_sse41.cxx" COMPILE_DEFINITIONS -msse4.1 -O0)
|
||||
endif()
|
||||
if(COMPILE_SSE4_1 AND RUN_SSE4_1 EQUAL 0)
|
||||
set(HAS_SSE4_1 ON CACHE BOOL "Architecture has SSE 4.1 SIMD enabled")
|
||||
message(STATUS "Use SSE 4.1 SIMD instructions")
|
||||
if(C_GCC OR C_CLANG)
|
||||
set( CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -msse4.1" )
|
||||
set( CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -msse4.1" )
|
||||
add_definitions(-DUSE_SSE4_1)
|
||||
elseif(C_MSVC)
|
||||
# seems not present on MSVC 2017
|
||||
#set( CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} /arch:SSE4_1" )
|
||||
#set( CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} /Oi /GL /Ot /Ox /arch:SSE4_1" )
|
||||
set( CMAKE_C_FLAGS_RELEASE "${CMAKE_C_FLAGS_RELEASE} /Oi /GL /Ot /Ox" )
|
||||
set( CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} /Oi /GL /Ot /Ox" )
|
||||
set( CMAKE_EXE_LINKER_FLAGS_RELEASE "${CMAKE_EXE_LINKER_FLAGS_RELEASE} /LTCG" )
|
||||
add_definitions (/D "_CRT_SECURE_NO_WARNINGS")
|
||||
add_definitions(-DUSE_SSE4_1)
|
||||
endif()
|
||||
else()
|
||||
set(HAS_SSE4_1 OFF CACHE BOOL "Architecture does not have SSE 4.1 SIMD enabled")
|
||||
endif()
|
||||
if(C_MSVC)
|
||||
try_run(RUN_SSE4_2 COMPILE_SSE4_2 "${CMAKE_BINARY_DIR}/tmp" "${TEST_DIR}/test_x86_sse42.cxx" COMPILE_DEFINITIONS /O0)
|
||||
else()
|
||||
try_run(RUN_SSE4_2 COMPILE_SSE4_2 "${CMAKE_BINARY_DIR}/tmp" "${TEST_DIR}/test_x86_sse42.cxx" COMPILE_DEFINITIONS -msse4.2 -O0)
|
||||
endif()
|
||||
if(COMPILE_SSE4_2 AND RUN_SSE4_2 EQUAL 0)
|
||||
set(HAS_SSE4_2 ON CACHE BOOL "Architecture has SSE 4.2 SIMD enabled")
|
||||
message(STATUS "Use SSE 4.2 SIMD instructions")
|
||||
if(C_GCC OR C_CLANG)
|
||||
set( CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -msse4.2" )
|
||||
set( CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -msse4.2" )
|
||||
add_definitions(-DUSE_SSE4_2)
|
||||
elseif(C_MSVC)
|
||||
# seems not present on MSVC 2017
|
||||
#set( CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} /arch:SSE4_2" )
|
||||
#set( CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} /Oi /GL /Ot /Ox /arch:SSE4_2" )
|
||||
set( CMAKE_C_FLAGS_RELEASE "${CMAKE_C_FLAGS_RELEASE} /Oi /GL /Ot /Ox" )
|
||||
set( CMAKE_CXX_FLAGS_RELEASE "${CMAKE_C_FLAGS_RELEASE} /Oi /GL /Ot /Ox" )
|
||||
set( CMAKE_EXE_LINKER_FLAGS_RELEASE "${CMAKE_EXE_LINKER_FLAGS_RELEASE} /LTCG" )
|
||||
add_definitions (/D "_CRT_SECURE_NO_WARNINGS")
|
||||
add_definitions(-DUSE_SSE4_2)
|
||||
endif()
|
||||
else()
|
||||
set(HAS_SSE4_2 OFF CACHE BOOL "Architecture does not have SSE 4.2 SIMD enabled")
|
||||
endif()
|
||||
if(C_MSVC)
|
||||
try_run(RUN_AVX COMPILE_AVX "${CMAKE_BINARY_DIR}/tmp" "${TEST_DIR}/test_x86_avx.cxx" COMPILE_DEFINITIONS /O0)
|
||||
else()
|
||||
try_run(RUN_AVX COMPILE_AVX "${CMAKE_BINARY_DIR}/tmp" "${TEST_DIR}/test_x86_avx.cxx" COMPILE_DEFINITIONS -mavx -O0)
|
||||
endif()
|
||||
if(COMPILE_AVX AND RUN_AVX EQUAL 0)
|
||||
set(HAS_AVX ON CACHE BOOL "Architecture has AVX SIMD enabled")
|
||||
message(STATUS "Use AVX SIMD instructions")
|
||||
if(C_GCC OR C_CLANG)
|
||||
set( CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -mavx" )
|
||||
set( CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -mavx" )
|
||||
add_definitions(-DUSE_AVX)
|
||||
elseif(C_MSVC)
|
||||
set( CMAKE_C_FLAGS_DEBUG "${CMAKE_C_FLAGS_DEBUG} /arch:AVX" )
|
||||
set( CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} /arch:AVX" )
|
||||
set( CMAKE_C_FLAGS_RELEASE "${CMAKE_C_FLAGS_RELEASE} /Oi /GL /Ot /Ox /arch:AVX" )
|
||||
set( CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} /Oi /GL /Ot /Ox /arch:AVX" )
|
||||
set( CMAKE_EXE_LINKER_FLAGS_RELEASE "${CMAKE_EXE_LINKER_FLAGS_RELEASE} /LTCG" )
|
||||
add_definitions (/D "_CRT_SECURE_NO_WARNINGS")
|
||||
add_definitions(-DUSE_AVX)
|
||||
endif()
|
||||
else()
|
||||
set(HAS_AVX OFF CACHE BOOL "Architecture does not have AVX SIMD enabled")
|
||||
endif()
|
||||
if(C_MSVC)
|
||||
try_run(RUN_AVX2 COMPILE_AVX2 "${CMAKE_BINARY_DIR}/tmp" "${TEST_DIR}/test_x86_avx2.cxx" COMPILE_DEFINITIONS /O0)
|
||||
else()
|
||||
try_run(RUN_AVX2 COMPILE_AVX2 "${CMAKE_BINARY_DIR}/tmp" "${TEST_DIR}/test_x86_avx2.cxx" COMPILE_DEFINITIONS -mavx2 -O0)
|
||||
endif()
|
||||
if(COMPILE_AVX2 AND RUN_AVX2 EQUAL 0)
|
||||
set(HAS_AVX2 ON CACHE BOOL "Architecture has AVX2 SIMD enabled")
|
||||
message(STATUS "Use AVX2 SIMD instructions")
|
||||
if(C_GCC OR C_CLANG)
|
||||
set( CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -mavx2" )
|
||||
set( CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -mavx2" )
|
||||
add_definitions(-DUSE_AVX2)
|
||||
elseif(C_MSVC)
|
||||
set( CMAKE_C_FLAGS_DEBUG "${CMAKE_C_FLAGS_DEBUG} /arch:AVX2" )
|
||||
set( CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} /arch:AVX2" )
|
||||
set( CMAKE_C_FLAGS_RELEASE "${CMAKE_C_FLAGS_RELEASE} /Oi /GL /Ot /Ox /arch:AVX2" )
|
||||
set( CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} /Oi /GL /Ot /Ox /arch:AVX2" )
|
||||
set( CMAKE_EXE_LINKER_FLAGS_RELEASE "${CMAKE_EXE_LINKER_FLAGS_RELEASE} /LTCG" )
|
||||
add_definitions (/D "_CRT_SECURE_NO_WARNINGS")
|
||||
add_definitions(-DUSE_AVX2)
|
||||
endif()
|
||||
else()
|
||||
set(HAS_AVX2 OFF CACHE BOOL "Architecture does not have AVX2 SIMD enabled")
|
||||
endif()
|
||||
if(C_MSVC)
|
||||
try_run(RUN_AVX512 COMPILE_AVX512 "${CMAKE_BINARY_DIR}/tmp" "${TEST_DIR}/test_x86_avx512.cxx" COMPILE_DEFINITIONS /O0)
|
||||
else()
|
||||
try_run(RUN_AVX512 COMPILE_AVX512 "${CMAKE_BINARY_DIR}/tmp" "${TEST_DIR}/test_x86_avx512.cxx" COMPILE_DEFINITIONS -mavx512f -O0)
|
||||
endif()
|
||||
if(COMPILE_AVX512 AND RUN_AVX512 EQUAL 0)
|
||||
set(HAS_AVX512 ON CACHE BOOL "Architecture has AVX512 SIMD enabled")
|
||||
message(STATUS "Use AVX512 SIMD instructions")
|
||||
if(C_GCC OR C_CLANG)
|
||||
set( CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -mavx512f" )
|
||||
set( CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -mavx512f" )
|
||||
add_definitions(-DUSE_AVX512)
|
||||
elseif(C_MSVC)
|
||||
set( CMAKE_C_FLAGS_DEBUG "${CMAKE_C_FLAGS_DEBUG} /arch:AVX512" )
|
||||
set( CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} /arch:AVX512" )
|
||||
set( CMAKE_C_FLAGS_RELEASE "${CMAKE_C_FLAGS_RELEASE} /Oi /GL /Ot /Ox /arch:AVX512" )
|
||||
set( CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} /Oi /GL /Ot /Ox /arch:AVX512" )
|
||||
set( CMAKE_EXE_LINKER_FLAGS_RELEASE "${CMAKE_EXE_LINKER_FLAGS_RELEASE} /LTCG" )
|
||||
add_definitions (/D "_CRT_SECURE_NO_WARNINGS")
|
||||
add_definitions(-DUSE_AVX512)
|
||||
endif()
|
||||
else()
|
||||
set(HAS_AVX512 OFF CACHE BOOL "Architecture does not have AVX512 SIMD enabled")
|
||||
endif()
|
||||
elseif(ARCHITECTURE_ARM)
|
||||
if(C_MSVC)
|
||||
try_run(RUN_NEON COMPILE_NEON "${CMAKE_BINARY_DIR}/tmp" "${TEST_DIR}/test_arm_neon.cxx" COMPILE_DEFINITIONS /O0)
|
||||
else()
|
||||
if(${CMAKE_HOST_SYSTEM_PROCESSOR} STREQUAL ${CMAKE_SYSTEM_PROCESSOR})
|
||||
try_run(RUN_NEON COMPILE_NEON "${CMAKE_BINARY_DIR}/tmp" "${TEST_DIR}/test_arm_neon.cxx" COMPILE_DEFINITIONS -mfpu=neon -O0)
|
||||
else()
|
||||
try_compile(COMPILE_NEON "${CMAKE_BINARY_DIR}/tmp" "${TEST_DIR}/test_arm_neon.cxx" COMPILE_DEFINITIONS -mfpu=neon -O0)
|
||||
set(RUN_NEON 0)
|
||||
endif()
|
||||
endif()
|
||||
if(COMPILE_NEON AND RUN_NEON EQUAL 0)
|
||||
set(HAS_NEON ON CACHE BOOL "Architecture has NEON SIMD enabled")
|
||||
message(STATUS "Use NEON SIMD instructions")
|
||||
if(C_GCC OR C_CLANG)
|
||||
set( CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -mfpu=neon" )
|
||||
set( CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -mfpu=neon" )
|
||||
add_definitions(-DUSE_NEON)
|
||||
endif()
|
||||
else()
|
||||
set(HAS_NEON OFF CACHE BOOL "Architecture does not have NEON SIMD enabled")
|
||||
endif()
|
||||
elseif(ARCHITECTURE_ARM64)
|
||||
# Advanced SIMD (aka NEON) is mandatory for AArch64
|
||||
set(HAS_NEON ON CACHE BOOL "Architecture has NEON SIMD enabled")
|
||||
message(STATUS "Use NEON SIMD instructions")
|
||||
add_definitions(-DUSE_NEON)
|
||||
endif()
|
||||
endif()
|
||||
|
||||
# clear binary test folder
|
||||
FILE(REMOVE_RECURSE ${CMAKE_BINARY_DIR}/tmp)
|
|
@ -0,0 +1,15 @@
|
|||
# Clang or AppleClang (see CMP0025)
|
||||
if(NOT DEFINED C_CLANG AND CMAKE_CXX_COMPILER_ID MATCHES "Clang")
|
||||
set(C_CLANG 1)
|
||||
elseif(NOT DEFINED C_GCC AND CMAKE_CXX_COMPILER_ID MATCHES "GNU")
|
||||
set(C_GCC 1)
|
||||
elseif(NOT DEFINED C_MSVC AND CMAKE_CXX_COMPILER_ID MATCHES "MSVC")
|
||||
set(C_MSVC 1)
|
||||
if(MSVC_VERSION GREATER_EQUAL 1920 AND MSVC_VERSION LESS_EQUAL 1929)
|
||||
set(VS2019 ON)
|
||||
elseif(MSVC_VERSION GREATER_EQUAL 1910 AND MSVC_VERSION LESS_EQUAL 1919)
|
||||
set(VS2017 ON)
|
||||
elseif(MSVC_VERSION GREATER 1899 AND MSVC_VERSION LESS 1910)
|
||||
set(VS2015 ON)
|
||||
endif()
|
||||
endif()
|
|
@ -0,0 +1,88 @@
|
|||
# - Try to find GPSD
|
||||
# Once done this will define
|
||||
#
|
||||
# GPSD_FOUND - system has GPSD
|
||||
# GPSD_INCLUDE_DIRS - the GPSD include directory
|
||||
# GPSD_LIBRARIES - Link these to use GPSD
|
||||
# GPSD_DEFINITIONS - Compiler switches required for using GPSD
|
||||
#
|
||||
# Copyright (c) 2006 Andreas Schneider <mail@cynapses.org>
|
||||
#
|
||||
# Redistribution and use is allowed according to the terms of the New
|
||||
# BSD license.
|
||||
# For details see the accompanying COPYING-CMAKE-SCRIPTS file.
|
||||
#
|
||||
|
||||
set(GPSD_ROOT_DIR
|
||||
"${GPSD_ROOT_DIR}"
|
||||
CACHE
|
||||
PATH
|
||||
"Directory to search for gpsd")
|
||||
|
||||
find_package(PkgConfig QUIET)
|
||||
if(PKG_CONFIG_FOUND)
|
||||
pkg_check_modules(PC_GPSD libgps)
|
||||
endif()
|
||||
|
||||
if (GPSD_LIBRARIES AND GPSD_INCLUDE_DIRS)
|
||||
# in cache already
|
||||
set(GPSD_FOUND TRUE)
|
||||
else (GPSD_LIBRARIES AND GPSD_INCLUDE_DIRS)
|
||||
find_path(GPSD_INCLUDE_DIRS
|
||||
NAMES
|
||||
gps.h
|
||||
PATHS
|
||||
/usr/include
|
||||
/usr/local/include
|
||||
/opt/local/include
|
||||
/sw/include
|
||||
/usr/include/gps
|
||||
/usr/local/include/gps
|
||||
/opt/local/include/gps
|
||||
/sw/include/gps
|
||||
HINTS
|
||||
${PC_GPSD_INCLUDEDIR}
|
||||
${GPSD_ROOT_DIR}
|
||||
)
|
||||
|
||||
# debian uses version suffixes
|
||||
# add suffix evey new release
|
||||
find_library(GPSD_LIBRARIES
|
||||
NAMES
|
||||
gps
|
||||
PATHS
|
||||
/usr/lib64
|
||||
/usr/lib
|
||||
/usr/local/lib
|
||||
/opt/local/lib
|
||||
/sw/lib
|
||||
HINTS
|
||||
${PC_GPSD_LIBDIR}
|
||||
${GPSD_ROOT_DIR}
|
||||
)
|
||||
|
||||
if (GPSD_INCLUDE_DIRS AND GPSD_LIBRARIES)
|
||||
set(GPSD_FOUND TRUE)
|
||||
endif (GPSD_INCLUDE_DIRS AND GPSD_LIBRARIES)
|
||||
|
||||
if (GPSD_FOUND)
|
||||
if (NOT GPSD_FIND_QUIETLY)
|
||||
message(STATUS "Found GPSD: ${GPSD_LIBRARIES}")
|
||||
endif (NOT GPSD_FIND_QUIETLY)
|
||||
else (GPSD_FOUND)
|
||||
if (GPSD_FIND_REQUIRED)
|
||||
message(FATAL_ERROR "Could not find GPSD")
|
||||
endif (GPSD_FIND_REQUIRED)
|
||||
endif (GPSD_FOUND)
|
||||
|
||||
# show the GPSD_INCLUDE_DIRS and GPSD_LIBRARIES variables only in the advanced view
|
||||
mark_as_advanced(GPSD_INCLUDE_DIRS GPSD_LIBRARIES)
|
||||
|
||||
endif (GPSD_LIBRARIES AND GPSD_INCLUDE_DIRS)
|
||||
|
||||
# maybe on CYGWIN gpsd works
|
||||
if (WIN32)
|
||||
set(GPSD_FOUND FALSE)
|
||||
set(GPSD_LIBRARIES "")
|
||||
set(GPSD_INCLUDE_DIRS "")
|
||||
endif (WIN32)
|
|
@ -0,0 +1,64 @@
|
|||
# - Try to find Portaudio
|
||||
# Once done this will define
|
||||
#
|
||||
# PORTAUDIO_FOUND - system has Portaudio
|
||||
# PORTAUDIO_INCLUDE_DIRS - the Portaudio include directory
|
||||
# PORTAUDIO_LIBRARIES - Link these to use Portaudio
|
||||
|
||||
set(PORTAUDIO_ROOT_DIR
|
||||
"${PORTAUDIO_ROOT_DIR}"
|
||||
CACHE
|
||||
PATH
|
||||
"Directory to search for portaudio")
|
||||
|
||||
find_package(PkgConfig QUIET)
|
||||
if(PKG_CONFIG_FOUND)
|
||||
pkg_check_modules(PC_PORTAUDIO portaudio-2.0)
|
||||
endif()
|
||||
|
||||
find_path(PORTAUDIO_INCLUDE_DIRS
|
||||
NAMES
|
||||
portaudio.h
|
||||
PATHS
|
||||
/usr/local/include
|
||||
/usr/include
|
||||
/opt/local/include
|
||||
HINTS
|
||||
${PC_PORTAUDIO_INCLUDEDIR}
|
||||
${PORTAUDIO_ROOT_DIR}
|
||||
)
|
||||
|
||||
find_library(PORTAUDIO_LIBRARIES
|
||||
NAMES
|
||||
portaudio
|
||||
PATHS
|
||||
/usr/local/lib
|
||||
/usr/lib
|
||||
/usr/lib64
|
||||
/opt/local/lib
|
||||
HINTS
|
||||
${PC_PORTAUDIO_LIBDIR}
|
||||
${PORTAUDIO_ROOT_DIR}
|
||||
)
|
||||
|
||||
mark_as_advanced(PORTAUDIO_INCLUDE_DIRS PORTAUDIO_LIBRARIES)
|
||||
|
||||
# Found PORTAUDIO, but it may be version 18 which is not acceptable.
|
||||
if(EXISTS ${PORTAUDIO_INCLUDE_DIRS}/portaudio.h)
|
||||
include(CheckCXXSourceCompiles)
|
||||
set(CMAKE_REQUIRED_INCLUDES_SAVED ${CMAKE_REQUIRED_INCLUDES})
|
||||
set(CMAKE_REQUIRED_INCLUDES ${PORTAUDIO_INCLUDE_DIRS})
|
||||
CHECK_CXX_SOURCE_COMPILES(
|
||||
"#include <portaudio.h>\nPaDeviceIndex pa_find_device_by_name(const char *name); int main () {return 0;}"
|
||||
PORTAUDIO2_FOUND)
|
||||
set(CMAKE_REQUIRED_INCLUDES ${CMAKE_REQUIRED_INCLUDES_SAVED})
|
||||
unset(CMAKE_REQUIRED_INCLUDES_SAVED)
|
||||
if(PORTAUDIO2_FOUND)
|
||||
INCLUDE(FindPackageHandleStandardArgs)
|
||||
FIND_PACKAGE_HANDLE_STANDARD_ARGS(PORTAUDIO DEFAULT_MSG PORTAUDIO_INCLUDE_DIRS PORTAUDIO_LIBRARIES)
|
||||
else(PORTAUDIO2_FOUND)
|
||||
message(STATUS
|
||||
" portaudio.h not compatible (requires API 2.0)")
|
||||
set(PORTAUDIO_FOUND FALSE)
|
||||
endif(PORTAUDIO2_FOUND)
|
||||
endif()
|
|
@ -0,0 +1,67 @@
|
|||
# - Try to find Hamlib
|
||||
#
|
||||
# HAMLIB_FOUND - system has Hamlib
|
||||
# HAMLIB_LIBRARIES - location of the library for hamlib
|
||||
# HAMLIB_INCLUDE_DIRS - location of the include files for hamlib
|
||||
#
|
||||
# Requires these CMake modules:
|
||||
# FindPackageHandleStandardArgs (known included with CMake >=2.6.2)
|
||||
#
|
||||
# Original Author:
|
||||
# 2019 Davide Gerhard <rainbow@irh.it>
|
||||
|
||||
set(HAMLIB_ROOT_DIR
|
||||
"${HAMLIB_ROOT_DIR}"
|
||||
CACHE
|
||||
PATH
|
||||
"Directory to search for hamlib")
|
||||
|
||||
find_package(PkgConfig QUIET)
|
||||
if(PKG_CONFIG_FOUND)
|
||||
pkg_check_modules(PC_HAMLIB hamlib)
|
||||
endif()
|
||||
|
||||
find_path(HAMLIB_INCLUDE_DIR
|
||||
NAMES hamlib/rig.h
|
||||
PATHS
|
||||
/usr/include
|
||||
/usr/local/include
|
||||
/opt/local/include
|
||||
HINTS
|
||||
${PC_HAMLIB_INCLUDEDIR}
|
||||
${HAMLIB_ROOT_DIR}
|
||||
)
|
||||
|
||||
find_library(HAMLIB_LIBRARY
|
||||
NAMES hamlib
|
||||
PATHS
|
||||
/usr/lib64/hamlib
|
||||
/usr/lib/hamlib
|
||||
/usr/lib64
|
||||
/usr/lib
|
||||
/usr/local/lib64/hamlib
|
||||
/usr/local/lib/hamlib
|
||||
/usr/local/lib64
|
||||
/usr/local/lib
|
||||
/opt/local/lib
|
||||
/opt/local/lib/hamlib
|
||||
HINTS
|
||||
${PC_HAMLIB_LIBDIR}
|
||||
${HAMLIB_ROOT_DIR}
|
||||
|
||||
)
|
||||
|
||||
include(FindPackageHandleStandardArgs)
|
||||
find_package_handle_standard_args(hamlib
|
||||
DEFAULT_MSG
|
||||
HAMLIB_LIBRARY
|
||||
HAMLIB_INCLUDE_DIR
|
||||
)
|
||||
|
||||
if(HAMLIB_FOUND)
|
||||
list(APPEND HAMLIB_LIBRARIES ${HAMLIB_LIBRARY})
|
||||
list(APPEND HAMLIB_INCLUDE_DIRS ${HAMLIB_INCLUDE_DIR})
|
||||
mark_as_advanced(HAMLIB_ROOT_DIR)
|
||||
endif()
|
||||
|
||||
mark_as_advanced(HAMLIB_INCLUDE_DIR HAMLIB_LIBRARY)
|
|
@ -0,0 +1,42 @@
|
|||
# - Try to find sndio
|
||||
#
|
||||
# SNDIO_FOUND - system has sndio
|
||||
# SNDIO_LIBRARIES - location of the library for sndio
|
||||
# SNDIO_INCLUDE_DIRS - location of the include files for sndio
|
||||
|
||||
set(SNDIO_ROOT_DIR
|
||||
"${SNDIO_ROOT_DIR}"
|
||||
CACHE
|
||||
PATH
|
||||
"Directory to search for sndio")
|
||||
|
||||
# no need to check pkg-config
|
||||
|
||||
find_path(SNDIO_INCLUDE_DIRS
|
||||
NAMES
|
||||
sndio.h
|
||||
PATHS
|
||||
/usr/local/include
|
||||
/usr/include
|
||||
/opt/local/include
|
||||
HINTS
|
||||
${SNDIO_ROOT_DIR}
|
||||
)
|
||||
|
||||
find_library(SNDIO_LIBRARIES
|
||||
NAMES
|
||||
sndio
|
||||
PATHS
|
||||
/usr/local/lib
|
||||
/usr/lib
|
||||
/usr/lib64
|
||||
/opt/local/lib
|
||||
HINTS
|
||||
${SNDIIO_ROOT_DIR}
|
||||
)
|
||||
|
||||
|
||||
include(FindPackageHandleStandardArgs)
|
||||
find_package_handle_standard_args(SNDIO DEFAULT_MSG SNDIO_INCLUDE_DIRS SNDIO_LIBRARIES)
|
||||
|
||||
mark_as_advanced(SNDIO_INCLUDE_DIRS SNDIO_LIBRARIES)
|
|
@ -0,0 +1,85 @@
|
|||
# - try to find the udev library
|
||||
#
|
||||
# Cache Variables: (probably not for direct use in your scripts)
|
||||
# UDEV_INCLUDE_DIR
|
||||
# UDEV_SOURCE_DIR
|
||||
# UDEV_LIBRARY
|
||||
#
|
||||
# Non-cache variables you might use in your CMakeLists.txt:
|
||||
# UDEV_FOUND
|
||||
# UDEV_INCLUDE_DIRS
|
||||
# UDEV_LIBRARIES
|
||||
#
|
||||
# Requires these CMake modules:
|
||||
# FindPackageHandleStandardArgs (known included with CMake >=2.6.2)
|
||||
#
|
||||
# Original Author:
|
||||
# 2014 Kevin M. Godby <kevin@godby.org>
|
||||
#
|
||||
# Distributed under the Boost Software License, Version 1.0.
|
||||
# (See accompanying file LICENSE_1_0.txt or copy at
|
||||
# http://www.boost.org/LICENSE_1_0.txt)
|
||||
|
||||
set(UDEV_ROOT_DIR
|
||||
"${UDEV_ROOT_DIR}"
|
||||
CACHE
|
||||
PATH
|
||||
"Directory to search for udev")
|
||||
|
||||
find_package(PkgConfig QUIET)
|
||||
if(PKG_CONFIG_FOUND)
|
||||
pkg_check_modules(PC_LIBUDEV libudev)
|
||||
endif()
|
||||
|
||||
find_library(UDEV_LIBRARY
|
||||
NAMES
|
||||
udev
|
||||
PATHS
|
||||
${PC_LIBUDEV_LIBRARY_DIRS}
|
||||
${PC_LIBUDEV_LIBDIR}
|
||||
/usr/lib64
|
||||
/usr/lib
|
||||
/usr/local/lib
|
||||
HINTS
|
||||
"${UDEV_ROOT_DIR}"
|
||||
PATH_SUFFIXES
|
||||
lib
|
||||
)
|
||||
|
||||
get_filename_component(_libdir "${UDEV_LIBRARY}" PATH)
|
||||
|
||||
find_path(UDEV_INCLUDE_DIR
|
||||
NAMES
|
||||
libudev.h
|
||||
PATHS
|
||||
/usr/include
|
||||
/usr/local/include
|
||||
${PC_LIBUDEV_INCLUDE_DIRS}
|
||||
${PC_LIBUDEV_INCLUDEDIR}
|
||||
HINTS
|
||||
"${_libdir}"
|
||||
"${_libdir}/.."
|
||||
"${UDEV_ROOT_DIR}"
|
||||
PATH_SUFFIXES
|
||||
include
|
||||
)
|
||||
|
||||
include(FindPackageHandleStandardArgs)
|
||||
find_package_handle_standard_args(udev
|
||||
DEFAULT_MSG
|
||||
UDEV_LIBRARY
|
||||
UDEV_INCLUDE_DIR
|
||||
)
|
||||
|
||||
if (UDEV_INCLUDE_DIR AND UDEV_LIBRARY)
|
||||
set(UDEV_FOUND TRUE)
|
||||
endif (UDEV_INCLUDE_DIR AND UDEV_LIBRARY)
|
||||
|
||||
if(UDEV_FOUND)
|
||||
list(APPEND UDEV_LIBRARIES ${UDEV_LIBRARY})
|
||||
list(APPEND UDEV_INCLUDE_DIRS ${UDEV_INCLUDE_DIR})
|
||||
mark_as_advanced(UDEV_ROOT_DIR)
|
||||
endif()
|
||||
|
||||
mark_as_advanced(UDEV_INCLUDE_DIR
|
||||
UDEV_LIBRARY)
|
|
@ -0,0 +1,36 @@
|
|||
# Normally, all of /dev/hidraw* are accessible only by root.
|
||||
#
|
||||
# $ ls -l /dev/hidraw*
|
||||
# crw------- 1 root root 247, 0 Sep 24 09:40 /dev/hidraw0
|
||||
#
|
||||
# An ordinary user, trying to access it will be denied.
|
||||
#
|
||||
# Unnecessarily running applications as root is generally a bad idea because it makes it too easy
|
||||
# to accidentally trash your system. We need to relax the restrictions so ordinary users can use these devices.
|
||||
#
|
||||
# If all went well with installation, the /etc/udev/rules.d directory should contain a file called
|
||||
# 99-direwolf-cmedia.rules containing:
|
||||
#
|
||||
|
||||
SUBSYSTEM=="hidraw", ATTRS{idVendor}=="0d8c", GROUP="audio", MODE="0660"
|
||||
|
||||
#
|
||||
# I used the "audio" group, mimicking the permissions on the sound side of the device.
|
||||
#
|
||||
# $ ls -l /dev/snd/pcm*
|
||||
# crw-rw----+ 1 root audio 116, 16 Sep 24 09:40 /dev/snd/pcmC0D0p
|
||||
# crw-rw----+ 1 root audio 116, 17 Sep 24 09:40 /dev/snd/pcmC0D1p
|
||||
#
|
||||
# You should see something similar to this where someone in the "audio" group has read-write access.
|
||||
#
|
||||
# $ ls -l /dev/hidraw*
|
||||
# crw-rw---- 1 root audio 247, 0 Oct 6 19:24 /dev/hidraw0
|
||||
#
|
||||
# Read the User Guide and run the "cm108" application for more information.
|
||||
#
|
||||
|
||||
#
|
||||
# Same thing for the "All In One Cable."
|
||||
#
|
||||
|
||||
SUBSYSTEM=="hidraw", ATTRS{idVendor}=="1209", ATTRS{idProduct}=="7388", GROUP="audio", MODE="0660"
|
|
@ -0,0 +1,48 @@
|
|||
# generate conf per platform
|
||||
file(READ "${CUSTOM_CONF_DIR}/generic.conf" file_content)
|
||||
|
||||
if(LINUX)
|
||||
string(REGEX REPLACE "\n%W%[^\n]*" "" file_content "${file_content}")
|
||||
string(REGEX REPLACE "\n%M%[^\n]*" "" file_content "${file_content}")
|
||||
string(REGEX REPLACE "\n%L%([^\n]*)" "\n\\1" file_content "${file_content}")
|
||||
elseif(WIN32 OR CYGWIN)
|
||||
string(REGEX REPLACE "\n%M%[^\n]*" "" file_content "${file_content}")
|
||||
string(REGEX REPLACE "\n%L%[^\n]*" "" file_content "${file_content}")
|
||||
string(REGEX REPLACE "\n%W%([^\n]*)" "\n\\1" file_content "${file_content}")
|
||||
else() # macOS FreeBSD OpenBSD
|
||||
string(REGEX REPLACE "\n%W%[^\n]*" "" file_content "${file_content}")
|
||||
string(REGEX REPLACE "\n%L%[^\n]*" "" file_content "${file_content}")
|
||||
string(REGEX REPLACE "\n%M%([^\n]*)" "\n\\1" file_content "${file_content}")
|
||||
endif()
|
||||
|
||||
# remove remark
|
||||
string(REGEX REPLACE "\n%R%[^\n]*" "" file_content "${file_content}")
|
||||
|
||||
# clear common lines
|
||||
string(REGEX REPLACE "\n%C%([^\n]*)" "\n\\1" file_content "${file_content}")
|
||||
string(REGEX REPLACE "^%C%([^\n]*)" "\\1" file_content "${file_content}")
|
||||
|
||||
file(WRITE "${CMAKE_BINARY_DIR}/direwolf.conf" "${file_content}")
|
||||
|
||||
# install udev rules for CM108
|
||||
if(LINUX)
|
||||
install(FILES "${CUSTOM_CONF_DIR}/99-direwolf-cmedia.rules" DESTINATION /etc/udev/rules.d/)
|
||||
endif()
|
||||
|
||||
install(FILES "${CMAKE_BINARY_DIR}/direwolf.conf" DESTINATION ${INSTALL_CONF_DIR})
|
||||
install(FILES "${CUSTOM_CONF_DIR}/sdr.conf" DESTINATION ${INSTALL_CONF_DIR})
|
||||
|
||||
# Put sample configuration & startup files in home directory.
|
||||
# This step would be done as ordinary user.
|
||||
# Some people like to put the direwolf config file in /etc/ax25.
|
||||
# Note that all of these are also in $(DESTDIR)/share/doc/direwolf/examples/.
|
||||
if(NOT (WIN32 OR CYGWIN))
|
||||
add_custom_target(install-conf
|
||||
COMMAND ${CMAKE_COMMAND}
|
||||
-DCUSTOM_BINARY_DIR="${CMAKE_BINARY_DIR}"
|
||||
-DCUSTOM_CONF_DIR="${CUSTOM_CONF_DIR}"
|
||||
-DCUSTOM_SCRIPTS_DIR="${CUSTOM_SCRIPTS_DIR}"
|
||||
-DCUSTOM_TELEMETRY_DIR="${CUSTOM_TELEMETRY_DIR}"
|
||||
-P "${CMAKE_SOURCE_DIR}/conf/install_conf.cmake"
|
||||
)
|
||||
endif()
|
|
@ -0,0 +1,537 @@
|
|||
%C%#############################################################
|
||||
%C%# #
|
||||
%C%# Configuration file for Dire Wolf #
|
||||
%C%# #
|
||||
%L%# Linux version #
|
||||
%W%# Windows version #
|
||||
%M%# Macintosh version #
|
||||
%C%# #
|
||||
%C%#############################################################
|
||||
%R%
|
||||
%R%
|
||||
%R% The sample config file was getting pretty messy
|
||||
%R% with the Windows and Linux differences.
|
||||
%R% It would be a maintenance burden to keep most of
|
||||
%R% two different versions in sync.
|
||||
%R% This common source is now used to generate the
|
||||
%R% two different variations while having only a single
|
||||
%R% copy of the common parts.
|
||||
%R%
|
||||
%R% The first column contains one of the following:
|
||||
%R%
|
||||
%R% R remark which is discarded.
|
||||
%R% C common to both versions.
|
||||
%R% W Windows version only.
|
||||
%R% L Linux version only.
|
||||
%R% M Macintosh version and possibly others (portaudio used).
|
||||
%R%
|
||||
%C%#
|
||||
%C%# Extensive documentation can be found here:
|
||||
%C%# Stable release - https://github.com/wb2osz/direwolf/tree/master/doc
|
||||
%C%# Latest development - https://github.com/wb2osz/direwolf/tree/dev/doc
|
||||
%C%# Additional topics - https://github.com/wb2osz/direwolf-doc
|
||||
%C%#
|
||||
%W%# The basic documentation set can also be found in the doc folder.
|
||||
%L%# The basic documentation set can also be found in
|
||||
%L%# /usr/local/share/doc/direwolf/ or /usr/share/doc/direwolf/
|
||||
%L%# Concise "man" pages are also available for Linux.
|
||||
%M%# /usr/local/share/doc/direwolf/ or /usr/share/doc/direwolf/
|
||||
%M%# Concise "man" pages are also available for Mac OSX.
|
||||
%C%#
|
||||
%C%# Questions??? Join the discussion forum: https://groups.io/g/direwolf
|
||||
%C%#
|
||||
%C%#
|
||||
%C%# This sample file does not have examples for all of the possibilities.
|
||||
%C%# Consult the User Guide for more details on configuration options
|
||||
%C%# and other documents for more details for different uses.
|
||||
%C%#
|
||||
%C%# These are the most likely settings you might change:
|
||||
%C%#
|
||||
%C%# (1) MYCALL - call sign and SSID for your station.
|
||||
%C%#
|
||||
%C%# Look for lines starting with MYCALL and
|
||||
%C%# change NOCALL to your own.
|
||||
%C%#
|
||||
%C%# (2) PBEACON - enable position beaconing.
|
||||
%C%#
|
||||
%C%# Look for lines starting with PBEACON and
|
||||
%C%# modify for your call, location, etc.
|
||||
%C%#
|
||||
%C%# (3) DIGIPEATER - configure digipeating rules.
|
||||
%C%#
|
||||
%C%# Look for lines starting with DIGIPEATER.
|
||||
%C%# Most people will probably use the given example.
|
||||
%C%# Just remove the "#" from the start of the line
|
||||
%C%# to enable it.
|
||||
%C%#
|
||||
%C%# (4) IGSERVER, IGLOGIN - IGate server and login
|
||||
%C%#
|
||||
%C%# Configure an IGate client to relay messages between
|
||||
%C%# radio and internet servers.
|
||||
%C%#
|
||||
%C%#
|
||||
%C%# The default location is "direwolf.conf" in the current working directory.
|
||||
%L%# On Linux, the user's home directory will also be searched.
|
||||
%C%# An alternate configuration file location can be specified with the "-c" command line option.
|
||||
%C%#
|
||||
%C%# As you probably guessed by now, # indicates a comment line.
|
||||
%C%#
|
||||
%C%# Remove the # at the beginning of a line if you want to use a sample
|
||||
%C%# configuration that is currently commented out.
|
||||
%C%#
|
||||
%C%# Commands are a keyword followed by parameters.
|
||||
%C%#
|
||||
%C%# Command key words are case insensitive. i.e. upper and lower case are equivalent.
|
||||
%C%#
|
||||
%C%# Command parameters are generally case sensitive. i.e. upper and lower case are different.
|
||||
%C%#
|
||||
%C%
|
||||
%C%
|
||||
%C%#############################################################
|
||||
%C%# #
|
||||
%C%# FIRST AUDIO DEVICE PROPERTIES #
|
||||
%C%# (Channel 0 + 1 if in stereo) #
|
||||
%C%# #
|
||||
%C%#############################################################
|
||||
%C%
|
||||
%C%#
|
||||
%C%# Many people will simply use the default sound device.
|
||||
%C%# Some might want to use an alternative device by choosing it here.
|
||||
%C%#
|
||||
%C%#
|
||||
%C%# Many examples of radio interfaces and PTT options can be found in:
|
||||
%C%# https://github.com/wb2osz/direwolf-doc/blob/main/Radio-Interface-Guide.pdf
|
||||
%C%#
|
||||
%C%#
|
||||
%R% ---------- Windows ----------
|
||||
%R%
|
||||
%W%# When the Windows version starts up, it displays something like
|
||||
%W%# this with the available sound devices and capabilities:
|
||||
%W%#
|
||||
%W%# Available audio input devices for receive (*=selected):
|
||||
%W%# * 0: Microphone (C-Media USB Headpho (channel 2)
|
||||
%W%# 1: Microphone (Bluetooth SCO Audio
|
||||
%W%# 2: Microphone (Bluetooth AV Audio)
|
||||
%W%# * 3: Microphone (Realtek High Defini (channels 0 & 1)
|
||||
%W%# Available audio output devices for transmit (*=selected):
|
||||
%W%# * 0: Speakers (C-Media USB Headphone (channel 2)
|
||||
%W%# 1: Speakers (Bluetooth SCO Audio)
|
||||
%W%# 2: Realtek Digital Output(Optical)
|
||||
%W%# 3: Speakers (Bluetooth AV Audio)
|
||||
%W%# * 4: Speakers (Realtek High Definiti (channels 0 & 1)
|
||||
%W%# 5: Realtek Digital Output (Realtek
|
||||
%W%#
|
||||
%W%# Example: To use the microphone and speaker connections on the
|
||||
%W%# system board, either of these forms can be used:
|
||||
%W%
|
||||
%W%#ADEVICE High
|
||||
%W%#ADEVICE 3 4
|
||||
%W%
|
||||
%W%
|
||||
%W%# Example: To use the USB Audio, use a command like this with
|
||||
%W%# the input and output device numbers. (Remove the # comment character.)
|
||||
%W%#ADEVICE USB
|
||||
%W%
|
||||
%W%# You can also use "-" or "stdin" to pipe stdout from
|
||||
%W%# some other application such as a software defined radio.
|
||||
%W%# "stdin" is not an audio device. Don't use this unless you
|
||||
%W%# understand what this means. Read the User Guide.
|
||||
%W%# You can also specify "UDP:" and an optional port for input.
|
||||
%W%# Something different must be specified for output.
|
||||
%W%
|
||||
%W%# ADEVICE stdin 0
|
||||
%W%# ADEVICE UDP:7355 0
|
||||
%W%
|
||||
%W%# The position in the list can change when devices (e.g. USB) are added and removed.
|
||||
%W%# You can also specify devices by using part of the name.
|
||||
%W%# Here is an example of specifying the USB Audio device.
|
||||
%W%# This is case-sensitive. Upper and lower case are not treated the same.
|
||||
%W%
|
||||
%W%#ADEVICE USB
|
||||
%W%
|
||||
%W%
|
||||
%R% ---------- Linux ----------
|
||||
%R%
|
||||
%L%# Linux ALSA is complicated. See User Guide for discussion.
|
||||
%L%# To use something other than the default, generally use plughw
|
||||
%L%# and a card number reported by "arecord -l" command. Example:
|
||||
%L%
|
||||
%L%# ADEVICE plughw:1,0
|
||||
%L%
|
||||
%L%# You can also use "-" or "stdin" to pipe stdout from
|
||||
%L%# some other application such as a software defined radio.
|
||||
%L%# "stdin" is not an audio device. Don't use this unless you
|
||||
%L%# understand what this means. Read the User Guide.
|
||||
%L%# You can also specify "UDP:" and an optional port for input.
|
||||
%L%# Something different must be specified for output.
|
||||
%L%
|
||||
%L%# ADEVICE stdin plughw:1,0
|
||||
%L%# ADEVICE UDP:7355 default
|
||||
%L%
|
||||
%R% ---------- Mac ----------
|
||||
%R%
|
||||
%M%# Macintosh Operating System uses portaudio driver for audio
|
||||
%M%# input/output. Default device selection not available. User/OP
|
||||
%M%# must configure the sound input/output option. Note that
|
||||
%M%# the device names can contain spaces. In this case, the names
|
||||
%M%# must be enclosed by quotes.
|
||||
%M%#
|
||||
%M%# Examples:
|
||||
%M%#
|
||||
%M%ADEVICE "Built-in Input" "Built-in Output"
|
||||
%M%
|
||||
%M%# ADEVICE "USB Audio Codec:6" "USB Audio Codec:5"
|
||||
%M%#
|
||||
%M%#
|
||||
%M%# You can also use "-" or "stdin" to pipe stdout from
|
||||
%M%# some other application such as a software defined radio.
|
||||
%M%# "stdin" is not an audio device. Don't use this unless you
|
||||
%M%# understand what this means. Read the User Guide.
|
||||
%M%# You can also specify "UDP:" and an optional port for input.
|
||||
%M%# Something different must be specified for output.
|
||||
%M%
|
||||
%M%# ADEVICE UDP:7355 default
|
||||
%M%#
|
||||
%C%
|
||||
%C%#
|
||||
%C%# Number of audio channels for this souncard: 1 (mono) or 2 (stereo).
|
||||
%C%# 1 is the default so there is no need to specify it.
|
||||
%C%#
|
||||
%C%
|
||||
%C%#ACHANNELS 2
|
||||
%C%
|
||||
%C%
|
||||
%C%#############################################################
|
||||
%C%# #
|
||||
%C%# SECOND AUDIO DEVICE PROPERTIES #
|
||||
%C%# (Channel 2 + 3 if in stereo) #
|
||||
%C%# #
|
||||
%C%#############################################################
|
||||
%C%
|
||||
%C%#ADEVICE1 ...
|
||||
%C%
|
||||
%C%
|
||||
%C%#############################################################
|
||||
%C%# #
|
||||
%C%# THIRD AUDIO DEVICE PROPERTIES #
|
||||
%C%# (Channel 4 + 5 if in stereo) #
|
||||
%C%# #
|
||||
%C%#############################################################
|
||||
%C%
|
||||
%C%#ADEVICE2 ...
|
||||
%C%
|
||||
%C%
|
||||
%C%#############################################################
|
||||
%C%# #
|
||||
%C%# CHANNEL 0 PROPERTIES #
|
||||
%C%# #
|
||||
%C%#############################################################
|
||||
%C%
|
||||
%C%CHANNEL 0
|
||||
%C%
|
||||
%C%#
|
||||
%C%# The following MYCALL, MODEM, PTT, etc. configuration items
|
||||
%C%# apply to the most recent CHANNEL.
|
||||
%C%#
|
||||
%C%
|
||||
%C%#
|
||||
%C%# Station identifier for this channel.
|
||||
%C%# Multiple channels can have the same or different names.
|
||||
%C%#
|
||||
%C%# It can be up to 6 letters and digits with an optional ssid.
|
||||
%C%# The APRS specification requires that it be upper case.
|
||||
%C%#
|
||||
%C%# Example (don't use this unless you are me): MYCALL WB2OSZ-5
|
||||
%C%#
|
||||
%C%
|
||||
%C%MYCALL N0CALL
|
||||
%C%
|
||||
%C%#
|
||||
%C%# Pick a suitable modem speed based on your situation.
|
||||
%C%# 1200 Most common for VHF/UHF. This is the default if not specified.
|
||||
%C%# 2400 QPSK compatible with MFJ-2400, and probably PK232-2400 & KPC-2400.
|
||||
%C%# 300 Low speed for HF SSB. Default tones 1600 & 1800.
|
||||
%C%# EAS Emergency Alert System (EAS) Specific Area Message Encoding (SAME).
|
||||
%C%# 9600 G3RUH style - Can't use Microphone and Speaker connections.
|
||||
%C%# AIS International system for tracking ships on VHF.
|
||||
%C%# Also uses 9600 bps so Speaker connection won't work.
|
||||
%C%#
|
||||
%C%# In most cases you can just specify the speed. Examples:
|
||||
%C%#
|
||||
%C%
|
||||
%C%MODEM 1200
|
||||
%C%#MODEM 9600
|
||||
%C%
|
||||
%C%#
|
||||
%C%# Many options are available for great flexibility.
|
||||
%C%# See User Guide for details.
|
||||
%C%#
|
||||
%C%
|
||||
%C%#
|
||||
%C%# Uncomment line below to enable the DTMF decoder for this channel.
|
||||
%C%#
|
||||
%C%
|
||||
%C%#DTMF
|
||||
%C%
|
||||
%C%# Push to Talk (PTT) can be confusing because there are so many different cases.
|
||||
%C%# Radio-Interface-Guide.pdf in https://github.com/wb2osz/direwolf-doc
|
||||
%C%# goes into detail about the various options.
|
||||
%C%
|
||||
%L%# If using a C-Media CM108/CM119 or similar USB Audio Adapter,
|
||||
%L%# you can use a GPIO pin for PTT control. This is very convenient
|
||||
%L%# because a single USB connection is used for both audio and PTT.
|
||||
%L%# Example:
|
||||
%L%
|
||||
%L%#PTT CM108
|
||||
%L%
|
||||
%W%# If using a C-Media CM108/CM119 or similar USB Audio Adapter,
|
||||
%W%# you can use a GPIO pin for PTT control. This is very convenient
|
||||
%W%# because a single USB connection is used for both audio and PTT.
|
||||
%W%# Example:
|
||||
%W%
|
||||
%W%#PTT CM108
|
||||
%W%%C%#
|
||||
%C%# The transmitter Push to Talk (PTT) control can be wired to a serial port
|
||||
%C%# with a suitable interface circuit. DON'T connect it directly!
|
||||
%C%#
|
||||
%C%# For the PTT command, specify the device and either RTS or DTR.
|
||||
%C%# RTS or DTR may be preceded by "-" to invert the signal.
|
||||
%C%# Both can be used for interfaces that want them driven with opposite polarity.
|
||||
%C%#
|
||||
%L%# COM1 can be used instead of /dev/ttyS0, COM2 for /dev/ttyS1, and so on.
|
||||
%L%#
|
||||
%C%
|
||||
%C%#PTT COM1 RTS
|
||||
%C%#PTT COM1 RTS -DTR
|
||||
%L%#PTT /dev/ttyUSB0 RTS
|
||||
%L%#PTT /dev/ttyUSB0 RTS -DTR
|
||||
%C%
|
||||
%L%#
|
||||
%L%# On Linux, you can also use general purpose I/O pins if
|
||||
%L%# your system is configured for user access to them.
|
||||
%L%# This would apply mostly to microprocessor boards, not a regular PC.
|
||||
%L%# See separate Raspberry Pi document for more details.
|
||||
%L%# The number may be preceded by "-" to invert the signal.
|
||||
%L%#
|
||||
%L%
|
||||
%L%#PTT GPIO 25
|
||||
%L%
|
||||
%C%# The Data Carrier Detect (DCD) signal can be sent to most of the same places
|
||||
%C%# as the PTT signal. This could be used to light up an LED like a normal TNC.
|
||||
%C%
|
||||
%C%#DCD COM1 -DTR
|
||||
%L%#DCD GPIO 24
|
||||
%C%
|
||||
%C%
|
||||
%C%#############################################################
|
||||
%C%# #
|
||||
%C%# CHANNEL 1 PROPERTIES #
|
||||
%C%# #
|
||||
%C%#############################################################
|
||||
%C%
|
||||
%C%#CHANNEL 1
|
||||
%C%
|
||||
%C%#
|
||||
%C%# Specify MYCALL, MODEM, PTT, etc. configuration items for
|
||||
%C%# CHANNEL 1. Repeat for any other channels.
|
||||
%C%
|
||||
%C%
|
||||
%C%#############################################################
|
||||
%C%# #
|
||||
%C%# TEXT TO SPEECH COMMAND FILE #
|
||||
%C%# #
|
||||
%C%#############################################################
|
||||
%C%
|
||||
%W%#SPEECH dwespeak.bat
|
||||
%L%#SPEECH dwespeak.sh
|
||||
%C%
|
||||
%C%
|
||||
%C%#############################################################
|
||||
%C%# #
|
||||
%C%# VIRTUAL TNC SERVER PROPERTIES #
|
||||
%C%# #
|
||||
%C%#############################################################
|
||||
%C%
|
||||
%C%#
|
||||
%C%# Dire Wolf acts as a virtual TNC and can communicate with
|
||||
%C%# client applications by different protocols:
|
||||
%C%#
|
||||
%C%# - the "AGW TCPIP Socket Interface" - default port 8000
|
||||
%C%# - KISS protocol over TCP socket - default port 8001
|
||||
%W%# - KISS TNC via serial port
|
||||
%L%# - KISS TNC via pseudo terminal (-p command line option)
|
||||
%C%#
|
||||
%C%
|
||||
%C%AGWPORT 8000
|
||||
%C%KISSPORT 8001
|
||||
%C%
|
||||
%W%#
|
||||
%W%# Some applications are designed to operate with only a physical
|
||||
%W%# TNC attached to a serial port. For these, we provide a virtual serial
|
||||
%W%# port that appears to be connected to a TNC.
|
||||
%W%#
|
||||
%W%# Take a look at the User Guide for instructions to set up
|
||||
%W%# two virtual serial ports named COM3 and COM4 connected by
|
||||
%W%# a null modem.
|
||||
%W%#
|
||||
%W%# Using the configuration described, Dire Wolf will connect to
|
||||
%W%# COM3 and the client application will use COM4.
|
||||
%W%#
|
||||
%W%# Uncomment following line to use this feature.
|
||||
%W%
|
||||
%W%#NULLMODEM COM3
|
||||
%W%
|
||||
%W%
|
||||
%C%#
|
||||
%C%# It is sometimes possible to recover frames with a bad FCS.
|
||||
%C%# This is not a global setting.
|
||||
%C%# It applies only the the most recent CHANNEL specified.
|
||||
%C%#
|
||||
%C%# 0 - Don't try to repair. (default)
|
||||
%C%# 1 - Attempt to fix single bit error.
|
||||
%C%#
|
||||
%C%
|
||||
%C%#FIX_BITS 0
|
||||
%C%
|
||||
%C%#
|
||||
%C%#############################################################
|
||||
%C%# #
|
||||
%C%# FIXED POSIION BEACONING PROPERTIES #
|
||||
%C%# #
|
||||
%C%#############################################################
|
||||
%C%
|
||||
%C%
|
||||
%C%#
|
||||
%C%# Beaconing is configured with these two commands:
|
||||
%C%#
|
||||
%C%# PBEACON - for a position report (usually yourself)
|
||||
%C%# OBEACON - for an object report (usually some other entity)
|
||||
%C%#
|
||||
%C%# Each has a series of keywords and values for options.
|
||||
%C%# See User Guide for details.
|
||||
%C%#
|
||||
%C%# Example:
|
||||
%C%#
|
||||
%C%# This results in a broadcast once every 10 minutes.
|
||||
%C%# Every half hour, it can travel via one digipeater hop.
|
||||
%C%# The others are kept local.
|
||||
%C%#
|
||||
%C%
|
||||
%C%#PBEACON delay=1 every=30 overlay=S symbol="digi" lat=42^37.14N long=071^20.83W power=50 height=20 gain=4 comment="Chelmsford MA" via=WIDE1-1
|
||||
%C%#PBEACON delay=11 every=30 overlay=S symbol="digi" lat=42^37.14N long=071^20.83W power=50 height=20 gain=4 comment="Chelmsford MA"
|
||||
%C%#PBEACON delay=21 every=30 overlay=S symbol="digi" lat=42^37.14N long=071^20.83W power=50 height=20 gain=4 comment="Chelmsford MA"
|
||||
%C%
|
||||
%C%#
|
||||
%C%# Did you know that APRS comments and messages can contain UTF-8 characters, not only plain ASCII?
|
||||
%C%#
|
||||
%C%#PBEACON delay=1 every=30 overlay=S symbol="digi" lat=42^37.14N long=071^20.83W comment=" Did you know that APRS comments and messages can contain UTF-8 characters? \xe0\xb8\xa7\xe0\xb8\xb4\xe0\xb8\x97\xe0\xb8\xa2\xe0\xb8\xb8\xe0\xb8\xaa\xe0\xb8\xa1\xe0\xb8\xb1\xe0\xb8\x84\xe0\xb8\xa3\xe0\xb9\x80\xe0\xb8\xa5\xe0\xb9\x88\xe0\xb8\x99"
|
||||
%C%#PBEACON delay=11 every=30 overlay=S symbol="digi" lat=42^37.14N long=071^20.83W comment=" Did you know that APRS comments and messages can contain UTF-8 characters? \xce\xa1\xce\xb1\xce\xb4\xce\xb9\xce\xbf\xce\xb5\xcf\x81\xce\xb1\xcf\x83\xce\xb9\xcf\x84\xce\xb5\xcf\x87\xce\xbd\xce\xb9\xcf\x83\xce\xbc\xcf\x8c\xcf\x82"
|
||||
%C%#PBEACON delay=21 every=30 overlay=S symbol="digi" lat=42^37.14N long=071^20.83W comment=" Did you know that APRS comments and messages can contain UTF-8 characters? \xe3\x82\xa2\xe3\x83\x9e\xe3\x83\x81\xe3\x83\xa5\xe3\x82\xa2\xe7\x84\xa1\xe7\xb7\x9a"
|
||||
%C%#
|
||||
%C%# With UTM coordinates instead of latitude and longitude.
|
||||
%C%
|
||||
%C%#PBEACON delay=1 every=10 overlay=S symbol="digi" zone=19T easting=307477 northing=4720178
|
||||
%C%
|
||||
%C%
|
||||
%C%#
|
||||
%C%# When the destination field is set to "SPEECH" the information part is
|
||||
%C%# converted to speech rather than transmitted as a data frame.
|
||||
%C%#
|
||||
%C%
|
||||
%C%#CBEACON dest="SPEECH" info="Club meeting tonight at 7 pm."
|
||||
%C%
|
||||
%C%# Similar for Morse code. If SSID is specified, it is multiplied
|
||||
%C%# by 2 to get speed in words per minute (WPM).
|
||||
%C%
|
||||
%C%#CBEACON dest="MORSE-6" info="de MYCALL"
|
||||
%C%
|
||||
%C%
|
||||
%C%#
|
||||
%C%# Modify for your particular situation before removing
|
||||
%C%# the # comment character from the beginning of appropriate lines above.
|
||||
%C%#
|
||||
%C%
|
||||
%C%
|
||||
%C%#############################################################
|
||||
%C%# #
|
||||
%C%# APRS DIGIPEATER PROPERTIES #
|
||||
%C%# #
|
||||
%C%#############################################################
|
||||
%C%
|
||||
%C%#
|
||||
%C%# For most common situations, use something like this by removing
|
||||
%C%# the "#" from the beginning of the line below.
|
||||
%C%#
|
||||
%C%
|
||||
%C%#DIGIPEAT 0 0 ^WIDE[3-7]-[1-7]$|^TEST$ ^WIDE[12]-[12]$
|
||||
%C%
|
||||
%C%# See User Guide and "APRS-Digipeaters.pdf" for more explanation of what
|
||||
%C%# this means and how it can be customized for your particular needs.
|
||||
%C%
|
||||
%C%
|
||||
%C%# Traditional connected mode packet radio uses a different
|
||||
%C%# type of digipeating. See User Guide for details.
|
||||
%C%
|
||||
%C%#############################################################
|
||||
%C%# #
|
||||
%C%# INTERNET GATEWAY #
|
||||
%C%# #
|
||||
%C%#############################################################
|
||||
%C%
|
||||
%C%# First you need to specify the name of a Tier 2 server.
|
||||
%C%# The current preferred way is to use one of these regional rotate addresses:
|
||||
%C%
|
||||
%C%# noam.aprs2.net - for North America
|
||||
%C%# soam.aprs2.net - for South America
|
||||
%C%# euro.aprs2.net - for Europe and Africa
|
||||
%C%# asia.aprs2.net - for Asia
|
||||
%C%# aunz.aprs2.net - for Oceania
|
||||
%C%
|
||||
%C%#IGSERVER noam.aprs2.net
|
||||
%C%
|
||||
%C%# You also need to specify your login name and passcode.
|
||||
%C%# Contact the author if you can't figure out how to generate the passcode.
|
||||
%C%
|
||||
%C%#IGLOGIN WB2OSZ-5 123456
|
||||
%C%
|
||||
%C%# That's all you need for a receive only IGate which relays
|
||||
%C%# messages from the local radio channel to the global servers.
|
||||
%C%
|
||||
%C%# Some might want to send an IGate client position directly to a server
|
||||
%C%# without sending it over the air and relying on someone else to
|
||||
%C%# forward it to an IGate server. This is done by using sendto=IG rather
|
||||
%C%# than a radio channel number. Overlay R for receive only, T for two way.
|
||||
%C%# There is no need to send it as often as you would over the radio.
|
||||
%C%
|
||||
%C%#PBEACON sendto=IG delay=0:30 every=60:00 symbol="igate" overlay=R lat=42^37.14N long=071^20.83W
|
||||
%C%#PBEACON sendto=IG delay=0:30 every=60:00 symbol="igate" overlay=T lat=42^37.14N long=071^20.83W
|
||||
%C%
|
||||
%C%
|
||||
%C%# To relay messages from the Internet to radio, you need to add
|
||||
%C%# one more option with the transmit channel number and a VIA path.
|
||||
%C%
|
||||
%C%#IGTXVIA 0 WIDE1-1,WIDE2-1
|
||||
%C%
|
||||
%C%
|
||||
%C%# Finally, we don't want to flood the radio channel.
|
||||
%C%# The IGate function will limit the number of packets transmitted
|
||||
%C%# during 1 minute and 5 minute intervals. If a limit would
|
||||
%C%# be exceeded, the packet is dropped and message is displayed in red.
|
||||
%C%# This might be low for APRS Thursday when there is abnormally high activity.
|
||||
%C%
|
||||
%C%IGTXLIMIT 6 10
|
||||
%C%
|
||||
%C%
|
||||
%C%#############################################################
|
||||
%C%# #
|
||||
%C%# APRStt GATEWAY #
|
||||
%C%# #
|
||||
%C%#############################################################
|
||||
%C%
|
||||
%C%#
|
||||
%C%# Dire Wolf can receive DTMF (commonly known as Touch Tone)
|
||||
%C%# messages and convert them to packet objects.
|
||||
%C%#
|
||||
%C%# See separate "APRStt-Implementation-Notes" document for details.
|
||||
%C%#
|
||||
|
|
@ -0,0 +1,23 @@
|
|||
if(NOT EXISTS $ENV{HOME}/direwolf.conf)
|
||||
configure_file("${CUSTOM_BINARY_DIR}/direwolf.conf" $ENV{HOME})
|
||||
endif()
|
||||
|
||||
if(NOT EXISTS $ENV{HOME}/sdr.conf)
|
||||
configure_file("${CUSTOM_CONF_DIR}/sdr.conf" $ENV{HOME})
|
||||
endif()
|
||||
|
||||
if(NOT EXISTS $ENV{HOME}/dw-start.sh)
|
||||
configure_file("${CUSTOM_SCRIPTS_DIR}/dw-start.sh" $ENV{HOME})
|
||||
endif()
|
||||
|
||||
if(NOT EXISTS $ENV{HOME}/telem-m0xer-3.txt)
|
||||
configure_file("${CUSTOM_TELEMETRY_DIR}/telem-m0xer-3.txt" $ENV{HOME})
|
||||
endif()
|
||||
|
||||
if(NOT EXISTS $ENV{HOME}/telem-balloon.conf)
|
||||
configure_file("${CUSTOM_TELEMETRY_DIR}/telem-balloon.conf" $ENV{HOME})
|
||||
endif()
|
||||
|
||||
if(NOT EXISTS $ENV{HOME}/telem-volts.conf)
|
||||
configure_file("${CUSTOM_TELEMETRY_DIR}/telem-volts.conf" $ENV{HOME})
|
||||
endif()
|
|
@ -0,0 +1,30 @@
|
|||
#
|
||||
# Sample configuration for SDR read-only IGate.
|
||||
#
|
||||
|
||||
# We might not have an audio output device so set to null.
|
||||
# We will override the input half on the command line.
|
||||
ADEVICE null null
|
||||
CHANNEL 0
|
||||
MYCALL xxx
|
||||
|
||||
# First you need to specify the name of a Tier 2 server.
|
||||
# The current preferred way is to use one of these regional rotate addresses:
|
||||
|
||||
# noam.aprs2.net - for North America
|
||||
# soam.aprs2.net - for South America
|
||||
# euro.aprs2.net - for Europe and Africa
|
||||
# asia.aprs2.net - for Asia
|
||||
# aunz.aprs2.net - for Oceania
|
||||
|
||||
IGSERVER noam.aprs2.net
|
||||
|
||||
# You also need to specify your login name and passcode.
|
||||
# Contact the author if you can't figure out how to generate the passcode.
|
||||
|
||||
IGLOGIN xxx 123456
|
||||
|
||||
# That's all you need for a receive only IGate which relays
|
||||
# messages from the local radio channel to the global servers.
|
||||
|
||||
|
130
config.h
130
config.h
|
@ -1,130 +0,0 @@
|
|||
|
||||
/*----------------------------------------------------------------------------
|
||||
*
|
||||
* Name: config.h
|
||||
*
|
||||
* Purpose:
|
||||
*
|
||||
* Description:
|
||||
*
|
||||
*-----------------------------------------------------------------------------*/
|
||||
|
||||
|
||||
#ifndef CONFIG_H
|
||||
#define CONFIG_H 1
|
||||
|
||||
#include "audio.h" /* for struct audio_s */
|
||||
#include "digipeater.h" /* for struct digi_config_s */
|
||||
#include "aprs_tt.h" /* for struct tt_config_s */
|
||||
#include "igate.h" /* for struct igate_config_s */
|
||||
|
||||
/*
|
||||
* All the leftovers.
|
||||
* This wasn't thought out. It just happened.
|
||||
*/
|
||||
|
||||
enum beacon_type_e { BEACON_IGNORE, BEACON_POSITION, BEACON_OBJECT, BEACON_TRACKER, BEACON_CUSTOM };
|
||||
|
||||
#define MAX_BEACONS 30
|
||||
|
||||
struct misc_config_s {
|
||||
|
||||
int num_channels; /* Number of radio channels. */
|
||||
|
||||
int agwpe_port; /* Port number for the “AGW TCPIP Socket Interface” */
|
||||
int kiss_port; /* Port number for the “KISS” protocol. */
|
||||
int enable_kiss_pt; /* Enable pseudo terminal for KISS. */
|
||||
/* Want this to be off by default because it hangs */
|
||||
/* after a while if nothing is reading from other end. */
|
||||
|
||||
char nullmodem[40]; /* Serial port name for our end of the */
|
||||
/* virtual null modem for native Windows apps. */
|
||||
|
||||
int sb_configured; /* TRUE if SmartBeaconing is configured. */
|
||||
int sb_fast_speed; /* MPH */
|
||||
int sb_fast_rate; /* seconds */
|
||||
int sb_slow_speed; /* MPH */
|
||||
int sb_slow_rate; /* seconds */
|
||||
int sb_turn_time; /* seconds */
|
||||
int sb_turn_angle; /* degrees */
|
||||
int sb_turn_slope; /* degrees * MPH */
|
||||
|
||||
|
||||
int num_beacons; /* Number of beacons defined. */
|
||||
|
||||
struct beacon_s {
|
||||
|
||||
enum beacon_type_e btype; /* Position or object. */
|
||||
|
||||
int lineno; /* Line number from config file for later error messages. */
|
||||
|
||||
int chan; /* Send to Channel for transmission. -1 for IGate. */
|
||||
|
||||
int delay; /* Seconds to delay before first transmission. */
|
||||
|
||||
int every; /* Time between transmissions, seconds. */
|
||||
/* Remains fixed for PBEACON and OBEACON. */
|
||||
/* Dynamically adjusted for TBEACON. */
|
||||
|
||||
time_t next; /* Unix time to transmit next one. */
|
||||
|
||||
int compress; /* Use more compact form? */
|
||||
|
||||
char objname[10]; /* Object name. Any printable characters. */
|
||||
|
||||
char *via; /* Path, e.g. "WIDE1-1,WIDE2-1" or NULL. */
|
||||
|
||||
char *custom_info; /* Info part for handcrafted custom beacon. */
|
||||
/* Ignore the rest below if this is set. */
|
||||
|
||||
double lat; /* Latitude and longitude. */
|
||||
double lon;
|
||||
|
||||
char symtab; /* Symbol table: / or \ or overlay character. */
|
||||
char symbol; /* Symbol code. */
|
||||
|
||||
float power; /* For PHG. */
|
||||
float height;
|
||||
float gain; /* Original protocol spec was unclear. */
|
||||
/* Addendum 1.1 clarifies it is dBi not dBd. */
|
||||
|
||||
char dir[3]; /* 1 or 2 of N,E,W,S, or empty for omni. */
|
||||
|
||||
float freq; /* MHz. */
|
||||
float tone; /* Hz. */
|
||||
float offset; /* MHz. */
|
||||
|
||||
char *comment; /* Comment or NULL. */
|
||||
|
||||
|
||||
} beacon[MAX_BEACONS];
|
||||
|
||||
};
|
||||
|
||||
|
||||
#define MIN_IP_PORT_NUMBER 1024
|
||||
#define MAX_IP_PORT_NUMBER 49151
|
||||
|
||||
|
||||
#define DEFAULT_AGWPE_PORT 8000 /* Like everyone else. */
|
||||
#define DEFAULT_KISS_PORT 8001 /* Above plus 1. */
|
||||
|
||||
|
||||
#define DEFAULT_NULLMODEM "COM3" /* should be equiv. to /dev/ttyS2 on Cygwin */
|
||||
|
||||
|
||||
|
||||
|
||||
extern void config_init (char *fname, struct audio_s *p_modem,
|
||||
struct digi_config_s *digi_config,
|
||||
struct tt_config_s *p_tt_config,
|
||||
struct igate_config_s *p_igate_config,
|
||||
struct misc_config_s *misc_config);
|
||||
|
||||
|
||||
|
||||
#endif /* CONFIG_H */
|
||||
|
||||
/* end config.h */
|
||||
|
||||
|
|
@ -0,0 +1,41 @@
|
|||
#
|
||||
# Update: 1 May 2023 (still 1.7 dev version)
|
||||
#
|
||||
# The original intention was to allow an easy way to download the most
|
||||
# recent versions of some files.
|
||||
#
|
||||
# "update-data" would only work once.
|
||||
#
|
||||
# These locations are no longer being maintained:
|
||||
# http://www.aprs.org/aprs11/tocalls.txt -- 14 Dec 2021
|
||||
# http://www.aprs.org/symbols/symbols-new.txt -- 17 Mar 2021
|
||||
# http://www.aprs.org/symbols/symbolsX.txt -- 25 Nov 2015
|
||||
# so there is no reason to provide a capability grab the latest version.
|
||||
#
|
||||
# Rather than fixing an obsolete capability, it will just be removed.
|
||||
#
|
||||
# The destination field is often used to identify the manufacturer/model.
|
||||
# These are not hardcoded into Dire Wolf. Instead they are read from
|
||||
# a file called tocalls.txt at application start up time.
|
||||
#
|
||||
# The original permanent symbols are built in but the "new" symbols,
|
||||
# using overlays, are often updated. These are also read from files.
|
||||
#
|
||||
|
||||
|
||||
include(ExternalProject)
|
||||
|
||||
set(TOCALLS_TXT "tocalls.txt")
|
||||
set(SYMBOLS-NEW_TXT "symbols-new.txt")
|
||||
set(SYMBOLSX_TXT "symbolsX.txt")
|
||||
set(CUSTOM_BINARY_DATA_DIR "${CMAKE_BINARY_DIR}/data")
|
||||
|
||||
# we can also move to a separate cmake file and use file(download)
|
||||
# see conf/install_conf.cmake as example
|
||||
file(COPY "${CUSTOM_DATA_DIR}/${TOCALLS_TXT}" DESTINATION "${CUSTOM_BINARY_DATA_DIR}")
|
||||
file(COPY "${CUSTOM_DATA_DIR}/${SYMBOLS-NEW_TXT}" DESTINATION "${CUSTOM_BINARY_DATA_DIR}")
|
||||
file(COPY "${CUSTOM_DATA_DIR}/${SYMBOLSX_TXT}" DESTINATION "${CUSTOM_BINARY_DATA_DIR}")
|
||||
|
||||
install(FILES "${CUSTOM_BINARY_DATA_DIR}/${TOCALLS_TXT}" DESTINATION ${INSTALL_DATA_DIR})
|
||||
install(FILES "${CUSTOM_BINARY_DATA_DIR}/${SYMBOLS-NEW_TXT}" DESTINATION ${INSTALL_DATA_DIR})
|
||||
install(FILES "${CUSTOM_BINARY_DATA_DIR}/${SYMBOLSX_TXT}" DESTINATION ${INSTALL_DATA_DIR})
|
|
@ -1,36 +1,55 @@
|
|||
APRS SYMBOL OVERLAY and EXTENSION TABLES in APRS 1.2 20 May 2014
|
||||
---------------------------------------------------------------------
|
||||
APRS SYMBOL OVERLAY and EXTENSION TABLES in APRS 1.2 17 Mar 2021
|
||||
------------------------------------------------------------------------
|
||||
|
||||
BACKGROUND: This file addresses new additions proposals (OVERLAYS)
|
||||
to the APRS symbol set after 1 October 2007. The master symbol
|
||||
document remains on the www.aprs.org/symbols/symbolsX.txt page.
|
||||
BACKGROUND: Since October 2007, overlay characters (36/symbol) are
|
||||
allowed on all symbols. This allows thousands of uniquely specified
|
||||
symbols instead of the original 188 (94 primary and 94 alternate).
|
||||
But the master symbol document, http://aprs.org/symbols/symbolsX.txt,
|
||||
only has one line per symbol. So this added overlay list below gives
|
||||
us thousands of new symbol codes.
|
||||
|
||||
17 Mar 21 Added L& for LORA Igate
|
||||
24 Jun18: Updated CAR symbols
|
||||
17 Jun18: Added several overlays for RAIL symbol
|
||||
03 Apr17: Added Methane Hazard symbol "MH"
|
||||
13 Feb17: Added Ez = Emergency Power (shelter), Cars: P> = Plugin
|
||||
S> = Solar powered. Moved Ham club C- to Buildings Ch.
|
||||
Added C- to house for combined renewables and added R%
|
||||
Renewable to power plants
|
||||
|
||||
NOTE: There was confusion with different copies of this file on
|
||||
different web pages and links. THIS file is now assumed to be the
|
||||
CORRECT one.
|
||||
18 Oct16: Added G,Y,R for Flood gauges + N for Normal.(on H2O symbol)
|
||||
Added DIGIPEATERS
|
||||
22 Mar16: Added A0 overlay circle for ALSTAR nodes and V0 for VOIP.
|
||||
Combined echolink and IRLP. P& for PSKmail node. W& for
|
||||
Wires-X (was W0 for WiresII). Ya for Yaesu C4FM repeaters
|
||||
|
||||
Update 29 Oct 2015: Reorgainized list to Alphabetical Order.
|
||||
+ Added many new Balloons (due to lost DoD radar Blimp yesterday)
|
||||
+ Confirmed D^ for Drones was already in there since 2014
|
||||
+ Added R^ type aircraft for remotely piloted
|
||||
+ Added S^ Solar Powered Aircraft
|
||||
+ Noticed all new category \= is availalbe. Had been shown ast
|
||||
APRStt, but that was changed in 2009 to overlay BOX symbols.
|
||||
|
||||
UPDATES/REVISIONS/CORRECTIONS:
|
||||
|
||||
20 May 14 Changed Da to DSTAR (2700 of them) from Dutch Ares
|
||||
19 May 14 Added Submarine&torpedo to ships and lots of Aircraft
|
||||
search for "(new may 2014)"
|
||||
07 Oct 13 Added new overlays to ships such as Jet Ski, Js
|
||||
Added Ham Club symbol as a C overlay on House, C-
|
||||
19 Sep 11 Added T and 2 overlays for TX 1 and 2 hop IGates
|
||||
Added overlays to (;) portable, to show event types
|
||||
23 Mar 11 Added Radiation Detector (RH)
|
||||
20 Apr 10 Byonics requested (BY)
|
||||
04 Jan 10 added #A to the table (correcting earlier omission)
|
||||
12 Oct 09 Added W0 for Yaesu WIRES nodes
|
||||
09 Apr 09 Changed APRStt symbol to overlayed BOX (#A)
|
||||
21 Aug 08 Added RFID R=, Stroller B], Radios#Y, & skull&Xbones (XH)
|
||||
27 Apr 08 Added some definitions of the numbered circle #0.
|
||||
25 Mar 08 Added these new definitions of overlays:
|
||||
2014 Added numerous OpenAPRS symbol. Changed Da to DSTAR from Dutch
|
||||
ARES. Added Subs to ships and lots of Aircraft overlays.
|
||||
2013 Added ship overlay Jet Ski. Ham Club as C overlay on House, C-
|
||||
2011 Added T and 2 overlays for TX 1 and 2 hop IGates
|
||||
Added overlays to (;) Portables Added Radiation Detector (RH)
|
||||
2010 Byonics requested (BY) and added #A to the table
|
||||
2009 Added W0 for Yaesu WIRES and APRStt symbol to overlayed BOX (#A)
|
||||
2008 Added RFID R=, Babystroller B], Radio#Y, skull&Xbones XH
|
||||
|
||||
Original Alternate Symbol codes being modified for new Overlay Use:
|
||||
|
||||
DEPRICATION AND MAJOR REVISION: 25 Mar 08 Modified several Alternate
|
||||
Symbol codes for expanded Overlays. The following alternate base
|
||||
symbols were redefined so that the basic symbol could take on dozens
|
||||
of unique overlay definitions:
|
||||
|
||||
\= - Had been undefined
|
||||
\0 - Several overlays for the numbered Circle
|
||||
\A - (BOX symbol) APRStt(DTMF), RFID users, XO (OLPC)
|
||||
\' - Was Crash Site. Now expanded to be INCIDENT sites
|
||||
\% - is an overlayed Powerplant. See definitions below
|
||||
|
@ -40,16 +59,17 @@ Original Alternate Symbol codes being modified for new Overlay Use:
|
|||
\u - Overlay Trucks. "Tu" is a tanker. "Gu" is a gas truck, etc
|
||||
\< - Advisories may now have overlays
|
||||
\8 - Nodes with overlays. "G8" would be 802.11G
|
||||
\[ - \[ is wall cloud, but overlays are humans. S[ is a skier.
|
||||
\h - Buildings. \h is a Ham store, "Hh" is Home Depot, etc.
|
||||
\[ - \[ was wall cloud, but overlays are humans. S[ is a skier.
|
||||
\h - Was Ham store, Now Overlays are buildings "Hh" Home Depot, etc.
|
||||
|
||||
Previous edition was 4 Oct 2007.
|
||||
|
||||
4 Oct 2007. ORIGINAL EXPANSION to OVERLAYS ON ALL SYMBOLS
|
||||
|
||||
In April 2007, a proposal to expand the use of overlay bytes for
|
||||
the extension of the APRS symbol set was added to the draft APRS1.2
|
||||
addendum web page. The following document addresses that proposal:
|
||||
|
||||
www.aprs.org/symbols/symbols-overlays.txt
|
||||
http://aprs.org/symbols/symbols-overlays.txt
|
||||
|
||||
For details on Upgrading your symbol set, please see the background
|
||||
information on Symbols prepared by Stephen Smith, WA8LMF:
|
||||
|
@ -79,8 +99,9 @@ small subset of alternate symbols. Those original overlayable
|
|||
alternate symbols were labeled with a "#" and called "numbered"
|
||||
symbols. (UIview requires "No." in the symbols.ini file)
|
||||
|
||||
STATUS OF OVERLAYS 1 OCTOBER 2007: the APRS symbol set only had a
|
||||
few remaining unused symbol codes that had not yet been defined:
|
||||
STATUS OF OVERLAYS 1 OCTOBER 2007: the APRS symbol set was limited
|
||||
to about 94 symbols and only had a few remaining unused symbol
|
||||
codes that had not yet been defined:
|
||||
|
||||
OF THE 94 Primary Symbols. The following were available:
|
||||
10 symbols (/0 - /9) that mostly look like billiard balls now
|
||||
|
@ -92,7 +113,7 @@ OF THE 94 Alternate Symbols. The following were available:
|
|||
8 series \1 through \8 that can support 36 overlays each
|
||||
3 reserved series.
|
||||
|
||||
ADDITIONAL OVERLAY PROPOSAL: But any of the other 79 alternate
|
||||
BASIS FOR OVERLAY EXPANSION: But any of the other 79 alternate
|
||||
symbols could all have multiple (36) overlays if they can make sense
|
||||
with the existing underlying basic symbol that we have been using for
|
||||
that basic alternate symbol. That is, any new definition of a
|
||||
|
@ -113,15 +134,30 @@ letting that define a new graphic just for that combination.
|
|||
The following tables will attempt to keep track of these and
|
||||
any other useful generic applications of overlay characters.
|
||||
|
||||
AMPLIFIED some existing ALTERNATE SYMBOL Overlays: (Aug 2014)
|
||||
change Flooding #W to include Avalanche, Mudslide/Landslide
|
||||
Update #' name to crash & incident sites
|
||||
Update \D (was available) to DEPOT family
|
||||
change overlayed car to generic Vehicle with (1-9 overlays)
|
||||
|
||||
ADVISORIES: #< (new expansion possibilities)
|
||||
/< = motorcycle
|
||||
\< = Advisory (single gale flag)
|
||||
|
||||
AIRCRAFT
|
||||
/^ = LARGE Aircraft
|
||||
\^ = top-view originally intended to point in direction of flight
|
||||
A^ = Autonomous (2015)
|
||||
D^ = Drone (new may 2014)
|
||||
E^ = Enemy aircraft (too bad I cant use the original Hostile)
|
||||
E^ = Electric aircraft (2015)
|
||||
H^ = Hovercraft (new may 2014)
|
||||
J^ = JET (new may 2014)
|
||||
M^ = Missle (new may 2014)
|
||||
P^ = Prop (new Aug 2014)
|
||||
R^ = Remotely Piloted (new 2015)
|
||||
S^ = Solar Powered (new 2015)
|
||||
V^ = Vertical takeoff (new may 2014)
|
||||
X^ = Experimental (new Aug 2014)
|
||||
|
||||
ATM Machine or CURRENCY: #$
|
||||
/$ = original primary Phone
|
||||
|
@ -130,82 +166,25 @@ U$ = US dollars
|
|||
L$ = Brittish Pound
|
||||
Y$ = Japanese Yen
|
||||
|
||||
POWER PLANT: #%
|
||||
/% = DX cluster <= the original primary table definition
|
||||
C% = Coal
|
||||
G% = Geothermal
|
||||
H% = Hydroelectric
|
||||
N% = Nuclear
|
||||
S% = Solar
|
||||
T% = Turbine
|
||||
W% = Wind
|
||||
ARRL or DIAMOND: #a
|
||||
/a = Ambulance
|
||||
Aa = ARES
|
||||
Da = DSTAR (had been ARES Dutch)
|
||||
Ga = RSGB Radio Society of Great Brittan
|
||||
Ra = RACES
|
||||
Sa = SATERN Salvation Army
|
||||
Wa = WinLink
|
||||
Ya = C4FM Yaesu repeaters
|
||||
|
||||
GATEWAYS: #&
|
||||
/& = HF Gateway <= the original primary table definition
|
||||
I& = Igate Generic (please use more specific overlay)
|
||||
R& = Receive only IGate (do not send msgs back to RF)
|
||||
T& = TX igate with path set to 1 hop only)
|
||||
2& = TX igate with path set to 2 hops (not generally good idea)
|
||||
|
||||
INCIDENT SITES: #'
|
||||
\' = Airplane Crash Site <= the original primary deifinition
|
||||
A' = Automobile crash site
|
||||
H' = Hazardous incident
|
||||
M' = Multi-Vehicle crash site
|
||||
P' = Pileup
|
||||
T' = Truck wreck
|
||||
|
||||
HUMAN SYMBOL: #[
|
||||
/[ = Human
|
||||
\[ = Wall Cloud (the original definition)
|
||||
B[ = Baby on board (stroller, pram etc)
|
||||
S[ = Skier * <= Recommend Special Symbol
|
||||
R[ = Runner
|
||||
H[ = Hiker
|
||||
|
||||
HOUSE: #-
|
||||
/- = House
|
||||
\- = (was HF)
|
||||
5- = 50 Hz mains power
|
||||
6- = 60 Hz mains power
|
||||
B- = Backup Battery Power
|
||||
C- = Club, as in Ham club
|
||||
E- = Emergency power
|
||||
G- = Geothermal
|
||||
H- = Hydro powered
|
||||
O- = Operator Present
|
||||
S- = Solar Powered
|
||||
W- = Wind powered
|
||||
|
||||
NUMBERED CIRCLES: #0
|
||||
E0 = Echolink Node (E0)
|
||||
I0 = IRLP repeater (I0)
|
||||
S0 = Staging Area (S0)
|
||||
W0 = WIRES (Yaesu VOIP)
|
||||
|
||||
NETWORK NODES: #8
|
||||
88 = 802.11 network node (88)
|
||||
G8 = 802.11G (G8)
|
||||
|
||||
PORTABLE SYMBOL: #;
|
||||
/; = Portable operation (tent)
|
||||
\; = Park or Picnic
|
||||
F; = Field Day
|
||||
I; = Islands on the air
|
||||
S; = Summits on the air
|
||||
W; = WOTA
|
||||
|
||||
ADVISORIES: #< (new expansion possibilities)
|
||||
/< = motorcycle
|
||||
\< = Advisory (single gale flag)
|
||||
|
||||
CARS: #>
|
||||
/> = normal car (side view)
|
||||
\> = Top view and symbol POINTS in direction of travel
|
||||
E> = Electric
|
||||
H> = Hybrid
|
||||
S> = Solar powered
|
||||
V> = GM Volt
|
||||
BALLOONS and lighter than air #O (All new Oct 2015)
|
||||
/O = Original Balloon (think Ham balloon)
|
||||
\O = ROCKET (amateur)(2007)
|
||||
BO = Blimp (2015)
|
||||
MO = Manned Balloon (2015)
|
||||
TO = Teathered (2015)
|
||||
CO = Constant Pressure - Long duration (2015)
|
||||
RO = Rocket bearing Balloon (Rockoon) (2015)
|
||||
WO = World-round balloon (2018)
|
||||
|
||||
BOX SYMBOL: #A (and other system inputted symbols)
|
||||
/A = Aid station
|
||||
|
@ -221,7 +200,69 @@ DA = D-Star report
|
|||
XA = OLPC Laptop XO
|
||||
etc
|
||||
|
||||
EYEBALL and VISIBILITY #E
|
||||
BUILDINGS: #h
|
||||
/h = Hospital
|
||||
\h = Ham Store ** <= now used for HAMFESTS
|
||||
Ch = Club (ham radio)
|
||||
Eh = Electronics Store
|
||||
Fh = HamFest (new Aug 2014)
|
||||
Hh = Hardware Store etc..
|
||||
|
||||
CARS: #> (Vehicles)
|
||||
/> = normal car (side view)
|
||||
\> = Top view and symbol POINTS in direction of travel
|
||||
#> = Reserve overlays 1-9 for numbered cars (new Aug 2014)
|
||||
3> = Model 3 (Tesla)
|
||||
B> = BEV - Battery EV(was E for electric)
|
||||
D> = DIY - Do it yourself
|
||||
E> = Ethanol (was electric)
|
||||
F> = Fuelcell or hydrogen
|
||||
H> = Hybrid
|
||||
L> = Leaf
|
||||
P> = PHEV - Plugin-hybrid
|
||||
S> = Solar powered
|
||||
T> = Tesla (temporary)
|
||||
V> = Volt (temporary)
|
||||
X> = Model X
|
||||
|
||||
CIVIL DEFENSE or TRIANGLE: #c
|
||||
/c = Incident Command Post
|
||||
\c = Civil Defense
|
||||
Dc = Decontamination (new Aug 2014)
|
||||
Rc = RACES
|
||||
Sc = SATERN mobile canteen
|
||||
|
||||
DEPOT
|
||||
/D = was originally undefined
|
||||
\D = was drizzle (moved to ' ovlyD)
|
||||
AD = Airport (new Aug 2014)
|
||||
FD = Ferry Landing (new Aug 2014)
|
||||
HD = Heloport (new Aug 2014)
|
||||
RD = Rail Depot (new Aug 2014)
|
||||
BD = Bus Depot (new Aug 2014)
|
||||
LD = LIght Rail or Subway (new Aug 2014)
|
||||
SD = Seaport Depot (new Aug 2014)
|
||||
|
||||
DIGIPEATERS
|
||||
/# - Generic digipeater
|
||||
1# - WIDE1-1 digipeater
|
||||
A# - Alternate input (i.e. 144.990MHz) digipeater
|
||||
E# - Emergency powered (assumed full normal digi)
|
||||
I# - I-gate equipped digipeater
|
||||
L# - WIDEn-N with path length trapping
|
||||
P# - PacComm
|
||||
S# - SSn-N digipeater (includes WIDEn-N)
|
||||
X# - eXperimental digipeater
|
||||
V# - Viscous https://github.com/PhirePhly/aprx/blob/master/ViscousDigipeater.README
|
||||
W# - WIDEn-N, SSn-N and Trapping
|
||||
|
||||
EMERGENCY: #!
|
||||
/! = Police/Sheriff, etc
|
||||
\! = Emergency!
|
||||
E! = ELT or EPIRB (new Aug 2014)
|
||||
V! = Volcanic Eruption or Lava (new Aug 2014)
|
||||
|
||||
EYEBALL (EVENT) and VISIBILITY #E
|
||||
/E = Eyeball for special live events
|
||||
\E = (existing smoke) the symbol with no overlay
|
||||
HE = (H overlay) Haze
|
||||
|
@ -230,13 +271,113 @@ BE = (B overlay) Blowing Snow was \B
|
|||
DE = (D overlay) blowing Dust or sand was \b
|
||||
FE = (F overlay) Fog was \{
|
||||
|
||||
GATEWAYS: #&
|
||||
/& = HF Gateway <= the original primary table definition
|
||||
I& = Igate Generic (please use more specific overlay)
|
||||
L& - Lora Igate
|
||||
R& = Receive only IGate (do not send msgs back to RF)
|
||||
P& = PSKmail node
|
||||
T& = TX igate with path set to 1 hop only)
|
||||
W& = WIRES-X as opposed to W0 for WiresII
|
||||
2& = TX igate with path set to 2 hops (not generally good idea)
|
||||
|
||||
GPS devices: #\
|
||||
/\ = Triangle DF primary symbol
|
||||
\\ = was undefined alternate symbol
|
||||
A\ = Avmap G5 * <= Recommend special symbol
|
||||
|
||||
HAZARDS: #H
|
||||
/H = hotel
|
||||
\H = Haze
|
||||
MH = Methane Hazard (new Apr 2017)
|
||||
RH = Radiation detector (new mar 2011)
|
||||
WH = Hazardous Waste
|
||||
XH = Skull&Crossbones
|
||||
|
||||
HUMAN SYMBOL: #[
|
||||
/[ = Human
|
||||
\[ = Wall Cloud (the original definition)
|
||||
B[ = Baby on board (stroller, pram etc)
|
||||
S[ = Skier * <= Recommend Special Symbol
|
||||
R[ = Runner
|
||||
H[ = Hiker
|
||||
|
||||
HOUSE: #-
|
||||
/- = House
|
||||
\- = (was HF)
|
||||
5- = 50 Hz if non standard
|
||||
6- = 60 Hz if non standard
|
||||
B- = Battery or off grid
|
||||
C- = Combined alternatives
|
||||
E- = Emergency power (grid down)
|
||||
G- = Geothermal
|
||||
H- = Hydro powered
|
||||
O- = Operator Present
|
||||
S- = Solar Power
|
||||
W- = Wind power
|
||||
|
||||
INCIDENT SITES: #'
|
||||
/' = Small Aircraft (original primary symbol)
|
||||
\' = Airplane Crash Site <= the original alternate deifinition
|
||||
A' = Automobile crash site
|
||||
H' = Hazardous incident
|
||||
M' = Multi-Vehicle crash site
|
||||
P' = Pileup
|
||||
T' = Truck wreck
|
||||
|
||||
NUMBERED CIRCLES: #0
|
||||
A0 = Allstar Node (A0)
|
||||
E0 = Echolink Node (E0)
|
||||
I0 = IRLP repeater (I0)
|
||||
S0 = Staging Area (S0)
|
||||
V0 = Echolink and IRLP (VOIP)
|
||||
W0 = WIRES (Yaesu VOIP)
|
||||
|
||||
NETWORK NODES: #8
|
||||
88 = 802.11 network node (88)
|
||||
G8 = 802.11G (G8)
|
||||
|
||||
PORTABLE SYMBOL: #;
|
||||
/; = Portable operation (tent)
|
||||
\; = Park or Picnic
|
||||
F; = Field Day
|
||||
I; = Islands on the air
|
||||
S; = Summits on the air
|
||||
W; = WOTA
|
||||
|
||||
POWER and ENERGY: #%
|
||||
/% = DX cluster <= the original primary table definition
|
||||
C% = Coal
|
||||
E% = Emergency (new Aug 2014)
|
||||
G% = Gas Turbine
|
||||
H% = Hydroelectric
|
||||
N% = Nuclear
|
||||
P% = Portable (new Aug 2014)
|
||||
R% = Renewable (hydrogen etc fuels)
|
||||
S% = Solar
|
||||
T% = Thermal (geo)
|
||||
W% = Wind
|
||||
|
||||
RAIL Symbols: #=
|
||||
/= = generic train (use steam engine shape for quick recognition)
|
||||
\= = tbd (use same symbol for now)
|
||||
B= = Bus-rail/trolley/streetcar/guiderail
|
||||
C= = Commuter
|
||||
D= = Diesel
|
||||
E= = Electric
|
||||
F= = Freight
|
||||
G= = Gondola
|
||||
H= = High Speed Rail (& Hyperloop?)
|
||||
I= = Inclined Rail
|
||||
L= = eLevated
|
||||
M= = Monorail
|
||||
P= = Passenger
|
||||
S= = Steam
|
||||
T= = Terminal (station)
|
||||
U= = sUbway (& Hyperloop?)
|
||||
X= = eXcursion
|
||||
|
||||
|
||||
RESTAURANTS: #R
|
||||
\R = Restaurant (generic)
|
||||
7R = 7/11
|
||||
|
@ -253,30 +394,6 @@ IY = Icom
|
|||
KY = Kenwood * <= Recommend special symbol
|
||||
YY = Yaesu/Standard* <= Recommend special symbol
|
||||
|
||||
GPS devices: #\
|
||||
/\ = Triangle DF primary symbol
|
||||
\\ = was undefined alternate symbol
|
||||
A\ = Avmap G5 * <= Recommend special symbol
|
||||
|
||||
ARRL or DIAMOND: #a
|
||||
/a = Ambulance
|
||||
Aa = ARES
|
||||
Da = DSTAR (had been ARES Dutch)
|
||||
Ga = RSGB Radio Society of Great Brittan
|
||||
Ra = RACES
|
||||
Sa = SATERN Salvation Army
|
||||
Wa = WinLink
|
||||
|
||||
CIVIL DEFENSE or TRIANGLE: #c
|
||||
/c = Incident Command Post
|
||||
\c = Civil Defense
|
||||
Rc = RACES
|
||||
Sc = SATERN mobile canteen
|
||||
|
||||
BUILDINGS: #h
|
||||
/h = Hospital
|
||||
\h = Ham Store ** <= now used for HAMFESTS
|
||||
Hh = Home Dept etc..
|
||||
|
||||
SPECIAL VEHICLES: #k
|
||||
/k = truck
|
||||
|
@ -284,24 +401,60 @@ SPECIAL VEHICLES: #k
|
|||
4k = 4x4
|
||||
Ak = ATV (all terrain vehicle)
|
||||
|
||||
SHIPS: #s
|
||||
SHELTERS: #z
|
||||
/z = was available
|
||||
\z = overlayed shelter
|
||||
Cz = Clinic (new Aug 2014)
|
||||
Ez = Emergency Power
|
||||
Gz = Government building (new Aug 2014)
|
||||
Mz = Morgue (new Aug 2014)
|
||||
Tz = Triage (new Aug 2014)
|
||||
|
||||
SHIPS: #s
|
||||
/s = Power boat (ship) side view
|
||||
\s = Overlay Boat (Top view)
|
||||
Cs = receive as Canoe but still transmit canoe as /C
|
||||
6s = Shipwreck ("deep6") (new Aug 2014)
|
||||
Bs = Pleasure Boat
|
||||
Cs = Cargo
|
||||
Ds = Diving
|
||||
Es = Emergency or Medical transport
|
||||
Fs = Fishing
|
||||
Hs = High-speed Craft
|
||||
Js = Jet Ski
|
||||
Ks = Kayak
|
||||
Hs = Hovercraft (new may 2014)
|
||||
Ts = Torpedo (new may 2014)
|
||||
Us = sUbmarine U-boat (new may 2014)
|
||||
Ls = Law enforcement
|
||||
Ms = Miltary
|
||||
Os = Oil Rig
|
||||
Ps = Pilot Boat (new Aug 2014)
|
||||
Qs = Torpedo
|
||||
Ss = Search and Rescue
|
||||
Ts = Tug (new Aug 2014)
|
||||
Us = Underwater ops or submarine
|
||||
Ws = Wing-in-Ground effect (or Hovercraft)
|
||||
Xs = Passenger (paX)(ferry)
|
||||
Ys = Sailing (large ship)
|
||||
|
||||
TRUCKS: #u
|
||||
/u = Truck (18 wheeler)
|
||||
\u = truck with overlay
|
||||
Bu = Buldozer/construction/Backhoe (new Aug 2014)
|
||||
Gu = Gas
|
||||
Pu = Plow or SnowPlow (new Aug 2014)
|
||||
Tu = Tanker
|
||||
Cu = Chlorine Tanker
|
||||
Hu = Hazardous
|
||||
|
||||
WATER #w
|
||||
/w = Water Station or other H2O
|
||||
\w = flooding (or Avalanche/slides)
|
||||
Aw = Avalanche
|
||||
Gw = Green Flood Gauge
|
||||
Mw = Mud slide
|
||||
Nw = Normal flood gauge (blue)
|
||||
Rw = Red flood gauge
|
||||
Sw = Snow Blockage
|
||||
Yw = Yellow flood gauge
|
||||
|
||||
|
||||
|
||||
Anyone can use any overlay on any of the overlayable symbols for any
|
||||
special purpose. We are not trying to document all possible such
|
|
@ -1,20 +1,21 @@
|
|||
APRS SYMBOLS (Icons) 07 Oct 2013
|
||||
APRS SYMBOLS (Icons) 25 Nov 2015
|
||||
-----------------------------------------------------------------------
|
||||
WB4APR
|
||||
|
||||
This original APRS symbol specification is updated periodically with
|
||||
new symbols as they are defined. This is THE master list for APRS. But
|
||||
almost all new symbols will be formed as Overlays to the basic set. So
|
||||
be sure to check the symbols-new.txt file noted below!
|
||||
almost all new symbols since 2007 will be formed as Overlays to the
|
||||
basic set. So be sure to check the symbols-new.txt file noted below!
|
||||
|
||||
http://aprs.org/symbols/symbols-new.txt
|
||||
|
||||
NEW OVERLAYS ON ALL ALTERNATE SYMBOLS: As of 1 October 2007, the use of
|
||||
overlay characters on all alternate symbols was allowed as needed in
|
||||
order to further expand the APRS symbol set. These overlay expansions
|
||||
of up to 36 different usages for each of the 94 alternate symbols adds
|
||||
hundreds of potential new symbols. Since this overlay info will no
|
||||
longer fit in this original document it is found in a new document:
|
||||
|
||||
http://aprs.org/symbols/symbols-new.txt
|
||||
hundreds of potential new symbols. Since each of the original 94
|
||||
symbols can now have up to 36 other definitions, this new overlay info
|
||||
is now found in the above file.
|
||||
|
||||
If an alternate symbol from the table below, contains significant
|
||||
definitions of its overlay characters, then the entry will have an "O"
|
||||
|
@ -23,10 +24,20 @@ document. The # symbol indicates the original Overlay subset.
|
|||
|
||||
For details on Upgrading your symbol set, please see the background
|
||||
information on Symbols prepared by Stephen Smith, WA8LMF:
|
||||
http://www.ew.usna.edu/~bruninga/aprs/symbols-background.txt
|
||||
http://aprs.org/symbols/symbols-background.txt
|
||||
|
||||
UPDATE CHRONOLOGY:
|
||||
|
||||
25 Nov 15: Found APRStt symbol poorly documented Was shown as "\=".
|
||||
But has been \A BOX symbol with variety of overlays
|
||||
23 Jun 15: Changed Aircraft to SSID-11 and Human to SSID-7
|
||||
28 Aug 14: Added notation on newly availble BASE codes (begun in 2007)
|
||||
Old WX versions of these: Bb{*:DFegJp were moved to ovlays
|
||||
Expanded #w Flooding to include Avalanches, Mud/Landslides
|
||||
Changed #D from "avail" to new family called Depots
|
||||
Changed name of overlay Car to generic Vehicles w overlays
|
||||
Edited name of /E Eyeball to include "Events"
|
||||
19 May 14: Added many new Aircraft and Ship symbols see symbols-new.txt
|
||||
07 Oct 13: Added JetSki [Js] & Ham Club [C-] ovrlys to symbols-new.txt
|
||||
19 Sep 11: Added T & 2 overlay for 1 & 2 hop Message TX Igates
|
||||
Updated overlay "portable" (;) overlays for events
|
||||
|
@ -100,7 +111,9 @@ Alt: >KOSY[^ksuv\ <==[removed /0An]
|
|||
|
||||
SYMBOLS.TXT APRS DISPLAY SYMBOLS APRSdos ORIGINAL
|
||||
======================================================================
|
||||
Document dated: 28 Apr 99 FInal APRSdos symbol spec (still updated!)
|
||||
Document dated: 28 Apr 99 FInal APRSdos symbol spec
|
||||
**************: This file Remains CUrrent and is Updated Frequently
|
||||
**************: See date and updates at the top of this file.
|
||||
Author(s): Bob Bruninga, WB4APR <bruninga@usna.edu>
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
|
||||
|
@ -113,8 +126,8 @@ tables or may be used as an alphanumeric overlay over some symbols:
|
|||
& RESERVED for possible AUXILLIARY tables (Aug 09)
|
||||
/ Primary symbol Table (Mostly stations)
|
||||
\ Alternate symbol table (Mostly Objects)
|
||||
0-9 Alternate OVERLAY symbol with 0-9 overlayed
|
||||
A-Z Alternate OVERLAY symbol with A-Z overlayed
|
||||
0-9 Alternate OVERLAY symbols with 0-9 overlayed
|
||||
A-Z Alternate OVERLAY symbols with A-Z overlayed
|
||||
|
||||
For ease of reference we refer to these as the SYMBOL CHARACTERS and
|
||||
often abbreviate them as "/$" which refers to the Table character "/"
|
||||
|
@ -128,8 +141,8 @@ symbols through Oct 2007 were:
|
|||
CIRCLE, SQUARE, CAR, TRUCK, VAN, DIGIS, GATES
|
||||
Civil-Defense(RACES), NWS sites, WX stations, Triangle
|
||||
|
||||
After that, provisions should be made in all software to allow for
|
||||
overlays on any alternate symbol as they may be used in the future.
|
||||
After 2007, provisions should be made in all software to allow for
|
||||
overlays on *any/all* alternate symbols for use in the future.
|
||||
|
||||
SYMBOLS WITH STAND-ALONE GPS TRACKERS: Stand-alone devices that
|
||||
transmit raw GPS have no method to convey their symbol. For this
|
||||
|
@ -162,16 +175,16 @@ for the stand-alone trackers described above.
|
|||
|
||||
/$ XYZ BASIC SYMBOL TABLE \$ XYZ OTHER SYMBOL TABLE (\)
|
||||
-- --- ------------------------ -- --- ----------------------
|
||||
/! BB Police, Sheriff \! OB EMERGENCY (!)
|
||||
/! BB Police, Sheriff \! OBO EMERGENCY (and overlays)
|
||||
/" BC reserved (was rain) \" OC reserved
|
||||
/# BD DIGI (white center) \# OD# OVERLAY DIGI (green star)
|
||||
/$ BE PHONE \$ OEO Bank or ATM (green box)
|
||||
/% BF DX CLUSTER \% OFO Power Plant with overlay
|
||||
/& BG HF GATEway \& OG# I=Igte R=RX T=1hopTX 2=2hopTX
|
||||
/' BH Small AIRCRAFT (SSID = 7) \' OHO Crash (& now Incident sites)
|
||||
/( BI Mobile Satellite Station \( OI CLOUDY (other clouds w ovrly)
|
||||
/' BH Small AIRCRAFT (SSID-11) \' OHO Crash (& now Incident sites)
|
||||
/( BI Mobile Satellite Station \( OIO CLOUDY (other clouds w ovrly)
|
||||
/) BJ Wheelchair (handicapped) \) OJO Firenet MEO, MODIS Earth Obs.
|
||||
/* BK SnowMobile \* OK SNOW (& future ovrly codes)
|
||||
/* BK SnowMobile \* OK AVAIL (SNOW moved to ` ovly S)
|
||||
/+ BL Red Cross \+ OL Church
|
||||
/, BM Boy Scouts \, OM Girl Scouts
|
||||
/- BN House QTH (VHF) \- ONO House (H=HF) (O = Op Present)
|
||||
|
@ -181,94 +194,95 @@ for the stand-alone trackers described above.
|
|||
|
||||
/$ XYZ PRIMARY SYMBOL TABLE \$ XYZ ALTERNATE SYMBOL TABLE (\)
|
||||
-- --- ------------------------ -- --- --------------------------
|
||||
/0 P0 # circle (obsolete) \0 A0# CIRCLE (E/I/W=IRLP/Echolink/WIRES)
|
||||
/1 P1 TBD (these were numbered) \1 A1
|
||||
/2 P2 TBD (circles like pool) \2 A2
|
||||
/3 P3 TBD (balls. But with) \3 A3
|
||||
/4 P4 TBD (overlays, we can) \4 A4
|
||||
/5 P5 TBD (put all #'s on one) \5 A5
|
||||
/6 P6 TBD (So 1-9 are available)\6 A6
|
||||
/7 P7 TBD (for new uses?) \7 A7
|
||||
/0 P0 # circle (obsolete) \0 A0# CIRCLE (IRLP/Echolink/WIRES)
|
||||
/1 P1 TBD (these were numbered) \1 A1 AVAIL
|
||||
/2 P2 TBD (circles like pool) \2 A2 AVAIL
|
||||
/3 P3 TBD (balls. But with) \3 A3 AVAIL
|
||||
/4 P4 TBD (overlays, we can) \4 A4 AVAIL
|
||||
/5 P5 TBD (put all #'s on one) \5 A5 AVAIL
|
||||
/6 P6 TBD (So 1-9 are available)\6 A6 AVAIL
|
||||
/7 P7 TBD (for new uses?) \7 A7 AVAIL
|
||||
/8 P8 TBD (They are often used) \8 A8O 802.11 or other network node
|
||||
/9 P9 TBD (as mobiles at events)\9 A9 Gas Station (blue pump)
|
||||
/: MR FIRE \: NR Hail (& future ovrly codes)
|
||||
/; MS Campground (Portable ops) \; NSO Park/Picnic + overlay events
|
||||
/< MT Motorcycle (SSID =10) \< NTO ADVISORY (one WX flag)
|
||||
/= MU RAILROAD ENGINE \= NUO APRStt Touchtone (DTMF users)
|
||||
/> MV CAR (SSID = 9) \> NV# OVERLAYED CAR
|
||||
/: MR FIRE \: NR AVAIL (Hail ==> ` ovly H)
|
||||
/; MS Campground (Portable ops) \; NSO Park/Picnic + overlay events
|
||||
/< MT Motorcycle (SSID-10) \< NTO ADVISORY (one WX flag)
|
||||
/= MU RAILROAD ENGINE \= NUO avail. symbol overlay group
|
||||
/> MV CAR (SSID-9) \> NV# OVERLAYED CARs & Vehicles
|
||||
/? MW SERVER for Files \? NW INFO Kiosk (Blue box with ?)
|
||||
/@ MX HC FUTURE predict (dot) \@ NX HURICANE/Trop-Storm
|
||||
/A PA Aid Station \A AA# overlayBOX DTMF & RFID & XO
|
||||
/B PB BBS or PBBS \B AB Blwng Snow (& future codes)
|
||||
/B PB BBS or PBBS \B AB AVAIL (BlwngSnow ==> E ovly B
|
||||
/C PC Canoe \C AC Coast Guard
|
||||
/D PD \D AD Drizzle (proposed APRStt)
|
||||
/E PE EYEBALL (Eye catcher!) \E AE Smoke (& other vis codes)
|
||||
/F PF Farm Vehicle (tractor) \F AF Freezng rain (&future codes)
|
||||
/G PG Grid Square (6 digit) \G AG Snow Shwr (& future ovrlys)
|
||||
/D PD \D ADO DEPOTS (Drizzle ==> ' ovly D)
|
||||
/E PE EYEBALL (Events, etc!) \E AE Smoke (& other vis codes)
|
||||
/F PF Farm Vehicle (tractor) \F AF AVAIL (FrzngRain ==> `F)
|
||||
/G PG Grid Square (6 digit) \G AG AVAIL (Snow Shwr ==> I ovly S)
|
||||
/H PH HOTEL (blue bed symbol) \H AHO \Haze (& Overlay Hazards)
|
||||
/I PI TcpIp on air network stn \I AI Rain Shower
|
||||
/J PJ \J AJ Lightening (& future ovrlys)
|
||||
/J PJ \J AJ AVAIL (Lightening ==> I ovly L)
|
||||
/K PK School \K AK Kenwood HT (W)
|
||||
/L PL PC user (Jan 03) \L AL Lighthouse
|
||||
/M PM MacAPRS \M AMO MARS (A=Army,N=Navy,F=AF)
|
||||
/N PN NTS Station \N AN Navigation Buoy
|
||||
/O PO BALLOON (SSID =11) \O AO Rocket (new June 2004)
|
||||
/O PO BALLOON (SSID-11) \O AO Overlay Balloon (Rocket = \O)
|
||||
/P PP Police \P AP Parking
|
||||
/Q PQ TBD \Q AQ QUAKE
|
||||
/R PR REC. VEHICLE (SSID =13) \R ARO Restaurant
|
||||
/R PR REC. VEHICLE (SSID-13) \R ARO Restaurant
|
||||
/S PS SHUTTLE \S AS Satellite/Pacsat
|
||||
/T PT SSTV \T AT Thunderstorm
|
||||
/U PU BUS (SSID = 2) \U AU SUNNY
|
||||
/U PU BUS (SSID-2) \U AU SUNNY
|
||||
/V PV ATV \V AV VORTAC Nav Aid
|
||||
/W PW National WX Service Site \W AW# # NWS site (NWS options)
|
||||
/X PX HELO (SSID = 6) \X AX Pharmacy Rx (Apothicary)
|
||||
/Y PY YACHT (sail) (SSID = 5) \Y AYO Radios and devices
|
||||
/Z PZ WinAPRS \Z AZ
|
||||
/[ HS Human/Person (HT) \[ DSO W.Cloud (& humans w Ovrly)
|
||||
/X PX HELO (SSID-6) \X AX Pharmacy Rx (Apothicary)
|
||||
/Y PY YACHT (sail) (SSID-5) \Y AYO Radios and devices
|
||||
/Z PZ WinAPRS \Z AZ AVAIL
|
||||
/[ HS Human/Person (SSID-7) \[ DSO W.Cloud (& humans w Ovrly)
|
||||
/\ HT TRIANGLE(DF station) \\ DTO New overlayable GPS symbol
|
||||
/] HU MAIL/PostOffice(was PBBS) \] DU
|
||||
/^ HV LARGE AIRCRAFT \^ DV# # Aircraft (shows heading)
|
||||
/] HU MAIL/PostOffice(was PBBS) \] DU AVAIL
|
||||
/^ HV LARGE AIRCRAFT \^ DV# other Aircraft ovrlys (2014)
|
||||
/_ HW WEATHER Station (blue) \_ DW# # WX site (green digi)
|
||||
/` HX Dish Antenna \` DX Rain (all types w ovrly)
|
||||
|
||||
/$ XYZ LOWER CASE SYMBOL TABLE \$ XYZ SECONDARY SYMBOL TABLE (\)
|
||||
-- --- ------------------------ -- --- --------------------------
|
||||
/a LA AMBULANCE (SSID = 1) \a SA#O ARRL, ARES, WinLINK
|
||||
/b LB BIKE (SSID = 4) \b SB Blwng Dst/Snd (& others)
|
||||
/a LA AMBULANCE (SSID-1) \a SA#O ARRL,ARES,WinLINK,Dstar, etc
|
||||
/b LB BIKE (SSID-4) \b SB AVAIL(Blwng Dst/Snd => E ovly)
|
||||
/c LC Incident Command Post \c SC#O CD triangle RACES/SATERN/etc
|
||||
/d LD Fire dept \d SD DX spot by callsign
|
||||
/e LE HORSE (equestrian) \e SE Sleet (& future ovrly codes)
|
||||
/f LF FIRE TRUCK (SSID = 3) \f SF Funnel Cloud
|
||||
/f LF FIRE TRUCK (SSID-3) \f SF Funnel Cloud
|
||||
/g LG Glider \g SG Gale Flags
|
||||
/h LH HOSPITAL \h SHO Store. or HAMFST Hh=HAM store
|
||||
/i LI IOTA (islands on the air) \i SI# BOX or points of Interest
|
||||
/j LJ JEEP (SSID-12) \j SJ WorkZone (Steam Shovel)
|
||||
/k LK TRUCK (SSID = 14) \k SKO Special Vehicle SUV,ATV,4x4
|
||||
/k LK TRUCK (SSID-14) \k SKO Special Vehicle SUV,ATV,4x4
|
||||
/l LL Laptop (Jan 03) (Feb 07) \l SL Areas (box,circles,etc)
|
||||
/m LM Mic-E Repeater \m SM Value Sign (3 digit display)
|
||||
/n LN Node (black bulls-eye) \n SN# OVERLAY TRIANGLE
|
||||
/o LO EOC \o SO small circle
|
||||
/p LP ROVER (puppy, or dog) \p SP Prtly Cldy (& future ovrlys)
|
||||
/q LQ GRID SQ shown above 128 m \q SQ
|
||||
/p LP ROVER (puppy, or dog) \p SP AVAIL (PrtlyCldy => ( ovly P
|
||||
/q LQ GRID SQ shown above 128 m \q SQ AVAIL
|
||||
/r LR Repeater (Feb 07) \r SR Restrooms
|
||||
/s LS SHIP (pwr boat) (SSID-8) \s SS# OVERLAY SHIP/boat (top view)
|
||||
/s LS SHIP (pwr boat) (SSID-8) \s SS# OVERLAY SHIP/boats
|
||||
/t LT TRUCK STOP \t ST Tornado
|
||||
/u LU TRUCK (18 wheeler) \u SU# OVERLAYED TRUCK
|
||||
/v LV VAN (SSID = 15) \v SV# OVERLAYED Van
|
||||
/w LW WATER station \w SW Flooding
|
||||
/x LX xAPRS (Unix) \x SX Wreck or Obstruction ->X<-
|
||||
/v LV VAN (SSID-15) \v SV# OVERLAYED Van
|
||||
/w LW WATER station \w SWO Flooding (Avalanches/Slides)
|
||||
/x LX xAPRS (Unix) \x SX Wreck or Obstruction ->X<-
|
||||
/y LY YAGI @ QTH \y SY Skywarn
|
||||
/z LZ TBD \z SZ# OVERLAYED Shelter
|
||||
/{ J1 \{ Q1 Fog (& future ovrly codes)
|
||||
/{ J1 \{ Q1 AVAIL? (Fog ==> E ovly F)
|
||||
/| J2 TNC Stream Switch \| Q2 TNC Stream Switch
|
||||
/} J3 \} Q3
|
||||
/} J3 \} Q3 AVAIL? (maybe)
|
||||
/~ J4 TNC Stream Switch \~ Q4 TNC Stream Switch
|
||||
|
||||
HEADING SYMBOLS: Although all symbols are supposed to have a heading
|
||||
line showing the direction of movement with a length proportional to
|
||||
the log of speed, some symbols were desiged as top-down views so that
|
||||
they could be displayed actually always POINTING in the direction of
|
||||
movement. These special symbols are:
|
||||
movement. Now All symbols should be oriented (if practical). These
|
||||
original special symbols were:
|
||||
|
||||
\> OVERLAYED CAR
|
||||
\s Overlayed Ship
|
||||
|
@ -277,10 +291,14 @@ movement. These special symbols are:
|
|||
/g Glider
|
||||
\n Overlayed Triangle
|
||||
|
||||
AREA SYMBOLS! You can define BOX/CIRCLE/LINE or TRIANGLE areas in all
|
||||
colors, either open or filled in, any size from 60 feet to 100 miles.
|
||||
Simply move the cursor to the location, press HOME, move the cursor to
|
||||
the lower right corner of the AREA and hit INPUT-ADD-OBJECTS-AREA.
|
||||
AREA SYMBOLS! The special symbol \l (lower case L) was special. It
|
||||
indicates an area definition. You can define these as a BOX, CIRCLE,
|
||||
LINE or TRIANGLE area in all colors, either open or filled in, any
|
||||
size from 60 feet to 100 miles. In APRSdos they were generated auto-
|
||||
matically by simply moving the cursor to the location, press HOME,
|
||||
move the cursor to the lower right corner of the AREA and hit INPUT-
|
||||
ADD-OBJECTS-AREA.
|
||||
|
||||
Enter the type of area, and color. NOTE that AREA shapes can only be
|
||||
defined by selecting the upper left corner first, then the lower right
|
||||
second. The line is an exception. It is still top to bottom, but the
|
||||
|
@ -294,10 +312,12 @@ cautious in using the color fill option, since all other objects in
|
|||
that area that occur earlier in your PLIST will be obscured. AND you
|
||||
do NOT know the order of other stations P-lists.
|
||||
|
||||
AREAS FORMAT: The new format for specifying special areas uses the
|
||||
CSE/SPD field to provide the additional information as follows:
|
||||
AREAS FORMAT: Use of the special AREAS symbol (/l) triggers special
|
||||
processing of the next 7 bytes normally used for CSE and SPD. In
|
||||
this special case the processing is as follows:
|
||||
|
||||
$CSE/SPD... Normal Field description
|
||||
|
||||
lTyy/Cxx... Where: l (lower case L) is symbol for "LOCATION SHAPES"
|
||||
T is Type of shape: 0=circle, 1=line, 2=elipse
|
||||
3=triangle 4=box
|
||||
|
@ -314,7 +334,7 @@ Type of 6 and are drawn down and to the left.
|
|||
HURRICANES, TROPICAL STORMS and DEPRESSIONS: These symbols will be
|
||||
differentiated by colors red, yellos, and blue. Additionally a radius
|
||||
of Huricane and also Tropical storm winds will also be shown if the
|
||||
format detailed in WX.txt is used.
|
||||
special format detailed in WX.txt is used.
|
||||
|
||||
SYMBOLS ON MAPS! APRS can also be permanently embedded in maps. To
|
||||
embed a symbol in a map, simply make the first four characters of the
|
||||
|
@ -325,9 +345,12 @@ same location. An example are the VORTAC nav-aids in Alaska. The
|
|||
Anchorage VORTAC appears as ANC on all maps below 128 miles. The label
|
||||
entry is #\VFANC,LAT,LONG,128.
|
||||
|
||||
VALUE SIGNPOSTS: Signposts display as a yellow box with a 1-3 letter
|
||||
overlay on them. You specify the 1-3 letter overlay by enclosing them
|
||||
in braces in the comment field. Thus a VALUE Signpost with {55} would
|
||||
VALUE SIGNPOSTS: This is another special handling Symbol. Signposts
|
||||
trigger a display as a yellow box with a 1-3 letter overlay on them.
|
||||
The use of this symbol (\m) triggers a search for a 1-3 letter
|
||||
string of characters encolsed in braces in the comment field.
|
||||
|
||||
Thus a VALUE Signpost with {55} in the comment field would
|
||||
appear as a sign with 55 on it, designed for posting the speed
|
||||
of traffic past speed measuring devices. APRSdos has a version named
|
||||
APRStfc.EXE that monitors traffic speed and posts these speed signs
|
||||
|
@ -336,21 +359,21 @@ map, they ONLY appear at 8 miles and below AND they do not show any
|
|||
callsign or name. Only the yellow box and the 3 letters or numbers.
|
||||
Select them from the OBJECT menu under VALUE...
|
||||
|
||||
APRS 1.2 OVERLAY TYPE SYMBOLS [April 2007]:
|
||||
-------------------------------------------
|
||||
APRS 1.2 OVERLAY TYPE SYMBOLS EXPANSION! [April 2007]:
|
||||
-------------------------------------------------------
|
||||
|
||||
All alternate symbols have the potential to be overlayed. This was
|
||||
the original intent and was only limited to a few due to limitations
|
||||
in Mac and WinAPRS. Those original "numbered" symbols are marked
|
||||
with a # in the table above. But by 2007, it was time to move on.
|
||||
In APRS 1.2 it is proposed that any ALTENATE symbol can have overlays.
|
||||
In APRS 1.2 it was proposed that any ALTENATE symbol can have overlays.
|
||||
Kenwood has already responded with the new D710 that can now display
|
||||
these overlays on all symbols.
|
||||
|
||||
To help define these hundreds of new symbol combinations, we have
|
||||
added a new file called:
|
||||
|
||||
http://www.ew.usna.edu/~bruninga/aprs/symbols-new.txt
|
||||
http:aprs.org/symbols/symbols-new.txt
|
||||
|
||||
The overlay symbols may be used in two ways. First, simply as an
|
||||
overlay on a basic symbol type. Most uses of these symbols will be
|
|
@ -0,0 +1,326 @@
|
|||
<title>
|
||||
APRS TO-CALL VERSION NUMBERS 14 Dec 2021
|
||||
---------------------------------------------------------------------
|
||||
WB4APR
|
||||
</title>
|
||||
<version_notes>
|
||||
07 Jun 23 Added APK005 for Kenwood TH-D75
|
||||
14 Dec 21 Added APATAR ATA-R APRS Digipeater by TA7W/OH2UDS and TA6AEU
|
||||
26 Sep 21 Added APRRDZ EPS32 https://github.com/dl9rdz/rdz_ttgo_sonde
|
||||
18 Sep 21 Added APCSS for AMSAT Cubesat Simulator https://cubesatsim.org
|
||||
16 Sep 21 Added APY05D for Yaesu FT5D series
|
||||
04 Sep 21 APLOxx LoRa KISS TNC/Tracker https://github.com/SQ9MDD/TTGO-T-Beam-LoRa-APRS
|
||||
24 Aug 21 Added APLSxx SARIMESH http://www.sarimesh.net
|
||||
22 Aug 21 Added APE2Ax for VA3NNW's Email-2-APRS ap
|
||||
30 Jun 21 Added APCNxx for carNET by DG5OAW
|
||||
14 Jun 21 Added APN2xx for NOSaprs JNOS 2.0 - VE4KLM
|
||||
24 Apr 21 Added APMPAD for DF1JSL's WXBot clone and extension
|
||||
20 Apr 21 Added APLCxx for APRScube by DL3DCW
|
||||
19 Apr 21 Added APVMxx for DRCC-DVM Voice (Digital Radio China Club)
|
||||
13 Apr 21 Added APIxxx for all Dstar ICOMS (APRS via DPRS)
|
||||
23 MAr 20 Added APW9xx For 9A9Y Weather Tracker
|
||||
16 Feb 21 Added API970 for I com 9700
|
||||
|
||||
2020 Added APHBLx,APIZCI,APLGxx,APLTxx,APNVxx,APY300,APESPG,APESPW
|
||||
APGDTx,APOSWx,APOSBx,APBT62,APCLUB,APMQxx
|
||||
2019 Added APTPNx,APJ8xx,APBSDx,APNKMX,APAT51,APMGxx,APTCMA,
|
||||
APATxx,APQTHx,APLIGx
|
||||
2018 added APRARX,APELKx,APGBLN,APBKxx,APERSx,APTCHE
|
||||
2017 Added APHWxx,APDVxx,APPICO,APBMxx,APP6xx,APTAxx,APOCSG,APCSMS,
|
||||
APPMxx,APOFF,APDTMF,APRSON,APDIGI,APSAT,APTBxx,APIExx,
|
||||
APSFxx
|
||||
2016 added APYSxx,APINxx,APNICx,APTKPT,APK004,APFPRS,APCDS0,APDNOx
|
||||
2015 Added APSTPO,APAND1,APDRxx,APZ247,APHTxx,APMTxx,APZMAJ
|
||||
APB2MF,APR2MF,APAVT5
|
||||
|
||||
</version_notes>
|
||||
<description>
|
||||
|
||||
In APRS, the AX.25 Destination address is not used for packet
|
||||
routing as is normally done in AX.25. So APRS uses it for two
|
||||
things. The initial APxxxx is used as a group identifier to make
|
||||
APRS packets instanantly recognizable on shared channels. Most
|
||||
applicaitons ignore all non APRS packets. The remaining 4 xxxx
|
||||
bytes of the field are available to indicate the software version
|
||||
number or application. The following applications have requested
|
||||
a TOCALL number series:
|
||||
|
||||
Authors with similar alphabetic requirements are encouraged to share
|
||||
their address space with other software. Work out agreements amongst
|
||||
yourselves and keep me informed.
|
||||
|
||||
</description>
|
||||
<tocalls>
|
||||
|
||||
APn 3rd digit is a number
|
||||
AP1WWX TAPR T-238+ WX station
|
||||
AP1MAJ Martyn M1MAJ DeLorme inReach Tracker
|
||||
AP4Rxy APRS4R software interface
|
||||
APnnnD Painter Engineering uSmartDigi D-Gate DSTAR Gateway
|
||||
APnnnU Painter Engineering uSmartDigi Digipeater
|
||||
APA APAFxx AFilter.
|
||||
APAGxx AGATE
|
||||
APAGWx SV2AGW's AGWtracker
|
||||
APALxx Alinco DR-620/635 internal TNC digis. "Hachi" ,JF1AJE
|
||||
APAXxx AFilterX.
|
||||
APAHxx AHub
|
||||
APAND1 APRSdroid (pre-release) http://aprsdroid.org/
|
||||
APAMxx Altus Metrum GPS trackers
|
||||
APATAR ATA-R APRS Digipeater by TA7W/OH2UDS and TA6AEU
|
||||
APAT8x for Anytone. 81 for 878 HT
|
||||
APAT51 for Anytone AT-D578UV APRS mobile radio
|
||||
APAVT5 SainSonic AP510 which is a 1watt tracker
|
||||
APAWxx AGWPE
|
||||
APB APBxxx Beacons or Rabbit TCPIP micros?
|
||||
APB2MF DL2MF - MF2APRS Radiosonde for balloons
|
||||
APBLxx BigRedBee BeeLine
|
||||
APBLO MOdel Rocketry K7RKT
|
||||
APBKxx PY5BK Bravo Tracker in Brazil
|
||||
APBPQx John G8BPQ Digipeater/IGate
|
||||
APBMxx BrandMeister DMR Server for R3ABM
|
||||
APBSDx HamBSD https://hambsd.org/
|
||||
APBT62 BTech DMR 6x2
|
||||
APC APCxxx Cellular applications
|
||||
APCBBx VE7UDP Blackberry Applications
|
||||
APCDS0 Leon Lessing ZS6LMG's cell tracker
|
||||
APCLEY EYTraker GPRS/GSM tracker by ZS6EY
|
||||
APCLEZ Telit EZ10 GSM application ZS6CEY
|
||||
APCLUB Brazil APRS network
|
||||
APCLWX EYWeather GPRS/GSM WX station by ZS6EY
|
||||
APCNxx for carNET by DG5OAW
|
||||
APCSMS for Cosmos (used for sending commands @USNA)
|
||||
APCSS for AMSAT cubesats https://cubesatsim.org
|
||||
APCWP8 John GM7HHB, WinphoneAPRS
|
||||
APCYxx Cybiko applications
|
||||
APD APD4xx UP4DAR platform
|
||||
APDDxx DV-RPTR Modem and Control Center Software
|
||||
APDFxx Automatic DF units
|
||||
APDGxx D-Star Gateways by G4KLX ircDDB
|
||||
APDHxx WinDV (DUTCH*Star DV Node for Windows)
|
||||
APDInn DIXPRS - Bela, HA5DI
|
||||
APDIGI Used by PSAT2 to indicate the digi is ON
|
||||
APDIGI digi ON for PSAT2 and QIKCOM-2
|
||||
APDKxx KI4LKF g2_ircddb Dstar gateway software
|
||||
APDNOx APRSduino by DO3SWW
|
||||
APDOxx ON8JL Standalone DStar Node
|
||||
APDPRS D-Star originated posits
|
||||
APDRxx APRSdroid Android App http://aprsdroid.org/
|
||||
APDSXX SP9UOB for dsDigi and ds-tracker
|
||||
APDTxx APRStouch Tone (DTMF)
|
||||
APDTMF digi off mode on QIKCOM2 and DTMF ON
|
||||
APDUxx U2APRS by JA7UDE
|
||||
APDVxx OE6PLD's SSTV with APRS status exchange
|
||||
APDWxx DireWolf, WB2OSZ
|
||||
APE APExxx Telemetry devices
|
||||
APE2Ax VA3NNW's Email-2-APRS ap
|
||||
APECAN Pecan Pico APRS Balloon Tracker
|
||||
APELKx WB8ELK balloons
|
||||
APERXQ Experimental tracker by PE1RXQ
|
||||
APERSx Runner tracking by Jason,KG7YKZ
|
||||
APESPG ESP SmartBeacon APRS-IS Client
|
||||
APESPW ESP Weather Station APRS-IS Client
|
||||
APF APFxxx Firenet
|
||||
APFGxx Flood Gage (KP4DJT)
|
||||
APFIxx for APRS.FI OH7LZB, Hessu
|
||||
APFPRS for FreeDV by Jeroen PE1RXQ
|
||||
APG APGxxx Gates, etc
|
||||
APGOxx for AA3NJ PDA application
|
||||
APGBLN for NW5W's GoBalloon
|
||||
APGDTx for VK4FAST's Graphic Data Terminal
|
||||
APH APHKxx for LA1BR tracker/digipeater
|
||||
APHAXn SM2APRS by PY2UEP
|
||||
APHBLx for DMR Gateway by Eric - KF7EEL
|
||||
APHTxx HMTracker by IU0AAC
|
||||
APHWxx for use in "HamWAN
|
||||
API API282 for ICOM IC-2820
|
||||
API31 for ICOM ID-31
|
||||
API410 for ICOM ID-4100
|
||||
API51 for ICOM ID-51
|
||||
API510 for ICOM ID-5100
|
||||
API710 for ICOM IC-7100
|
||||
API80 for ICOM IC-80
|
||||
API880 for ICOM ID-880
|
||||
API910 for ICOM IC-9100
|
||||
API92 for ICOM IC-92
|
||||
API970 for ICOM 9700
|
||||
APICQx for ICQ
|
||||
APICxx HA9MCQ's Pic IGate
|
||||
APIExx W7KMV's PiAPRS system
|
||||
APINxx PinPoint by AB0WV
|
||||
APIZCI hymTR IZCI Tracker by TA7W/OH2UDS and TA6AEU
|
||||
APJ APJ8xx Jordan / KN4CRD JS8Call application
|
||||
APJAxx JavAPRS
|
||||
APJExx JeAPRS
|
||||
APJIxx jAPRSIgate
|
||||
APJSxx javAPRSSrvr
|
||||
APJYnn KA2DDO Yet another APRS system
|
||||
APK APK0xx Kenwood TH-D7's
|
||||
APK003 Kenwood TH-D72
|
||||
APK004 Kenwood TH-D74
|
||||
APK005 Kenwood TH-D75
|
||||
APK1xx Kenwood D700's
|
||||
APK102 Kenwood D710
|
||||
APKRAM KRAMstuff.com - Mark. G7LEU
|
||||
APL APLCxx APRScube by DL3DCW
|
||||
APLGxx LoRa Gateway/Digipeater OE5BPA
|
||||
APLIGx LightAPRS - TA2MUN and TA9OHC
|
||||
APLOxx LoRa KISS TNC/Tracker
|
||||
APLQRU Charlie - QRU Server
|
||||
APLMxx WA0TQG transceiver controller
|
||||
APLSxx SARIMESH ( http://www.sarimesh.net )
|
||||
APLTxx LoRa Tracker - OE5BPA
|
||||
APM APMxxx MacAPRS,
|
||||
APMGxx PiCrumbs and MiniGate - Alex, AB0TJ
|
||||
APMIxx SQ3PLX http://microsat.com.pl/
|
||||
APMPAD DF1JSL's WXBot clone and extension
|
||||
APMQxx Ham Radio of Things WB2OSZ
|
||||
APMTxx LZ1PPL for tracker
|
||||
APN APNxxx Network nodes, digis, etc
|
||||
APN2xx NOSaprs for JNOS 2.0 - VE4KLM
|
||||
APN3xx Kantronics KPC-3 rom versions
|
||||
APN9xx Kantronics KPC-9612 Roms
|
||||
APNAxx WB6ZSU's APRServe
|
||||
APNDxx DIGI_NED
|
||||
APNICx SQ5EKU http://sq5eku.blogspot.com/
|
||||
APNK01 Kenwood D700 (APK101) type
|
||||
APNK80 KAM version 8.0
|
||||
APNKMP KAM+
|
||||
APNKMX KAM-XL
|
||||
APNMxx MJF TNC roms
|
||||
APNPxx Paccom TNC roms
|
||||
APNTxx SV2AGW's TNT tnc as a digi
|
||||
APNUxx UIdigi
|
||||
APNVxx SQ8L's VP digi and Nodes
|
||||
APNXxx TNC-X (K6DBG)
|
||||
APNWxx SQ3FYK.com WX/Digi and SQ3PLX http://microsat.com.pl/
|
||||
APO APRSpoint
|
||||
APOFF Used by PSAT and PSAT2 to indicate the digi is OFF
|
||||
APOLUx for OSCAR satellites for AMSAT-LU by LU9DO
|
||||
APOAxx OpenAPRS - Greg Carter
|
||||
APOCSG For N0AGI's APRS to POCSAG project
|
||||
APOD1w Open Track with 1 wire WX
|
||||
APOSBx openSPOT3 by HA2NON at sharkrf.com
|
||||
APOSWx openSPOT2
|
||||
APOTxx Open Track
|
||||
APOU2k Open Track for Ultimeter
|
||||
APOZxx www.KissOZ.dk Tracker. OZ1EKD and OZ7HVO
|
||||
APP APP6xx for APRSlib
|
||||
APPICx DB1NTO' PicoAPRS
|
||||
APPMxx DL1MX's RTL-SDR pytohon Igate
|
||||
APPTxx KetaiTracker by JF6LZE, Takeki (msg capable)
|
||||
APQ APQxxx Earthquake data
|
||||
APQTHx W8WJB's QTH.app
|
||||
APR APR8xx APRSdos versions 800+
|
||||
APR2MF DL2MF - MF2APRS Radiosonde WX reporting
|
||||
APRARX VK5QI's radiosonde tracking
|
||||
APRDxx APRSdata, APRSdr
|
||||
APRGxx aprsg igate software, OH2GVE
|
||||
APRHH2 HamHud 2
|
||||
APRKxx APRStk
|
||||
APRNOW W5GGW ipad application
|
||||
APRRTx RPC electronics
|
||||
APRS Generic, (obsolete. Digis should use APNxxx instead)
|
||||
APRSON Used by PSAT to indicate the DIGI is ON
|
||||
APRXxx >40 APRSmax
|
||||
APRXxx <39 for OH2MQK's igate
|
||||
APRTLM used in MIM's and Mic-lites, etc
|
||||
APRtfc APRStraffic
|
||||
APRSTx APRStt (Touch tone)
|
||||
APS APSxxx APRS+SA, etc
|
||||
APSARx ZL4FOX's SARTRACK
|
||||
APSAT digi ON for QIKCOM-1
|
||||
APSCxx aprsc APRS-IS core server (OH7LZB, OH2MQK)
|
||||
APSFxx F5OPV embedded devices - was APZ40
|
||||
APSK63 APRS Messenger -over-PSK63
|
||||
APSK25 APRS Messenger GMSK-250
|
||||
APSMSx Paul Dufresne's SMSGTE - SMS Gateway
|
||||
APSTMx for W7QO's Balloon trackers
|
||||
APSTPO for N0AGI Satellite Tracking and Operations
|
||||
APT APT2xx Tiny Track II
|
||||
APT3xx Tiny Track III
|
||||
APTAxx K4ATM's tiny track
|
||||
APTBxx TinyAPRS by BG5HHP Was APTAxx till Sep 2017
|
||||
APTCHE PU3IKE in Brazil TcheTracker/Tcheduino
|
||||
APTCMA CAPI tracker - PU1CMA Brazil
|
||||
APTIGR TigerTrack
|
||||
APTKPT TrackPoint N0LP
|
||||
APTPNx TARPN Packet Node Tracker by KN4ORB http://tarpn.net/
|
||||
APTTxx Tiny Track
|
||||
APTWxx Byons WXTrac
|
||||
APTVxx for ATV/APRN and SSTV applications
|
||||
APU APU1xx UIview 16 bit applications
|
||||
APU2xx UIview 32 bit apps
|
||||
APU3xx UIview terminal program
|
||||
APUDRx NW Digital Radio's UDR (APRS/Dstar)
|
||||
APV APVxxx Voice over Internet applications
|
||||
APVMxx DRCC-DVM Digital Voice (Digital Radio China Club)
|
||||
APVRxx for IRLP
|
||||
APVLxx for I-LINK
|
||||
APVExx for ECHO link
|
||||
APW APWxxx WinAPRS, etc
|
||||
APW9xx 9A9Y Weather Tracker
|
||||
APWAxx APRSISCE Android version
|
||||
APWSxx DF4IAN's WS2300 WX station
|
||||
APWMxx APRSISCE KJ4ERJ
|
||||
APWWxx APRSISCE win32 version
|
||||
APX APXnnn Xastir
|
||||
APXRnn Xrouter
|
||||
APY APYxxx Yaesu Radios
|
||||
APY008 Yaesu VX-8 series
|
||||
APY01D Yaesu FT1D series
|
||||
APY02D Yaesu FT2D series
|
||||
APY03D Yaesu FT3D series
|
||||
APY05D Yaesu FT5D series
|
||||
APY100 Yaesu FTM-100D series
|
||||
APY300 Yaesu FTM-300D series
|
||||
APY350 Yaesu FTM-350 series
|
||||
APY400 Yaesu FTM-400D series
|
||||
APZ APZxxx Experimental
|
||||
APZ200 old versions of JNOS
|
||||
APZ247 for UPRS NR0Q
|
||||
APZ0xx Xastir (old versions. See APX)
|
||||
APZMAJ Martyn M1MAJ DeLorme inReach Tracker
|
||||
APZMDM github/codec2_talkie - product code not registered
|
||||
APZMDR for HaMDR trackers - hessu * hes.iki.fi]
|
||||
APZPAD Smart Palm
|
||||
APZTKP TrackPoint, Nick N0LP (Balloon tracking)(depricated)
|
||||
APZWIT MAP27 radio (Mountain Rescue) EI7IG
|
||||
APZWKR GM1WKR NetSked application
|
||||
</tocalls>
|
||||
<notes>
|
||||
|
||||
</notes>
|
||||
<altnets>
|
||||
|
||||
REGISTERED TOCALL ALTNETS:
|
||||
--------------------------
|
||||
|
||||
ALTNETS are uses of the AX-25 tocall to distinguish specialized
|
||||
traffic that may be flowing on the APRS-IS, but that are not intended
|
||||
to be part of normal APRS distribution to all normal APRS software
|
||||
operating in normal (default) modes. Proper APRS software that
|
||||
honors this design are supposed to IGNORE all ALTNETS unless the
|
||||
particular operator has selected an ALTNET to monitor for.
|
||||
|
||||
An example is when testing; an author may want to transmit objects
|
||||
all over his map for on-air testing, but does not want these to
|
||||
clutter everyone's maps or databases. He could use the ALTNET of
|
||||
"TEST" and client APRS software that respects the ALTNET concept
|
||||
should ignore these packets.
|
||||
|
||||
An ALTNET is defined to be ANY AX.25 TOCALL that is NOT one of the
|
||||
normal APRS TOCALL's. The normal TOCALL's that APRS is supposed to
|
||||
process are: ALL, BEACON, CQ, QST, GPSxxx and of course APxxxx.
|
||||
|
||||
The following is a list of ALTNETS that may be of interest to other
|
||||
users. This list is by no means complete, since ANY combination of
|
||||
characters other than APxxxx are considered an ALTNET. But this list
|
||||
can give consisntecy to ALTNETS that may be using the global APRS-IS
|
||||
and need some special recognition. Here are some ideas:
|
||||
</altnets>
|
||||
<altnet_list>
|
||||
|
||||
SATERN - Salvation Army Altnet
|
||||
AFMARS - Airforce Mars
|
||||
AMARS - Army Mars
|
||||
</altnet_list>
|
|
@ -0,0 +1,5 @@
|
|||
In order to start direwolf as a service the configuration file
|
||||
/etc/direwolf.conf needs to exist. Otherwise attempting to start the service
|
||||
returns an 'Assertion failed' error. An example configuration file which may be
|
||||
used as a model can be found in
|
||||
/usr/share/doc/direwolf/examples/direwolf.conf.gz
|
|
@ -0,0 +1 @@
|
|||
../CHANGES.md
|
|
@ -0,0 +1 @@
|
|||
10
|
|
@ -0,0 +1,30 @@
|
|||
Source: direwolf
|
||||
Maintainer: Debian Hamradio Maintainers <debian-hams@lists.debian.org>
|
||||
Uploaders: Iain R. Learmonth <irl@debian.org>
|
||||
Section: hamradio
|
||||
Priority: optional
|
||||
Build-Depends: debhelper (>= 9),
|
||||
libasound2-dev,
|
||||
libgps-dev,
|
||||
libhamlib-dev,
|
||||
dh-systemd
|
||||
Standards-Version: 4.1.0
|
||||
Vcs-Browser: https://anonscm.debian.org/cgit/pkg-hamradio/direwolf.git/
|
||||
Vcs-Git: https://anonscm.debian.org/git/pkg-hamradio/direwolf.git
|
||||
Homepage: https://github.com/wb2osz/direwolf
|
||||
|
||||
Package: direwolf
|
||||
Architecture: alpha amd64 arm64 armel armhf i386 mipsel ppc64el sh4 x32
|
||||
Depends: ${shlibs:Depends},
|
||||
${misc:Depends},
|
||||
adduser,
|
||||
libhamlib2
|
||||
Suggests: gpsd, libhamlib-utils
|
||||
Breaks: direwolf-docs (<< 1.1-1)
|
||||
Replaces: direwolf-docs (<< 1.1-1)
|
||||
Description: Soundcard TNC for APRS
|
||||
Dire Wolf is a software "soundcard" modem/TNC and APRS encoder/decoder. It can
|
||||
be used stand-alone to receive APRS messages, as a digipeater, APRStt gateway,
|
||||
or Internet Gateway (IGate). It can also be used as a virtual TNC for other
|
||||
applications such as APRSIS32, UI-View32, Xastir, APRS-TW, YAAC, UISS, Linux
|
||||
AX25, SARTrack, and many others.
|
|
@ -0,0 +1,176 @@
|
|||
Format: http://www.debian.org/doc/packaging-manuals/copyright-format/1.0/
|
||||
Upstream-Name: direwolf
|
||||
Files-Excluded: doc/*.pdf
|
||||
Source: https://github.com/wb2osz/direwolf
|
||||
Comment:
|
||||
The files in misc/ are copied directly from the Cygwin source code. These are
|
||||
listed here as dual licensed as they are both part of the Cygwin distribution
|
||||
and originally part of BSD. See misc/README-dire-wolf.txt for more information.
|
||||
.
|
||||
Please see ftp-master's comments on this here:
|
||||
https://lists.debian.org/debian-hams/2014/09/msg00063.html
|
||||
https://lists.debian.org/debian-hams/2014/10/msg00003.html
|
||||
|
||||
Files: *
|
||||
Copyright: (C) 2011-2014 John Langner WB2OSZ
|
||||
License: GPL-2+
|
||||
|
||||
Files: geotranz/*
|
||||
Copyright: National Geospatial-Intelligence Agency
|
||||
License: Permissive-NGA
|
||||
|
||||
Files: regex/*
|
||||
Copyright: (C) 2002, 2003, 2005 Free Software Foundation, Inc.
|
||||
License: LGPL-2.1+
|
||||
|
||||
Files: misc/strcasestr.c
|
||||
Copyright:
|
||||
(C) 1990, 1993 The Regents of the University of California
|
||||
(C) RedHat
|
||||
License: BSD-4-clause or GPL-2+
|
||||
|
||||
Files: misc/strtok_r.c misc/strsep.c
|
||||
Copyright:
|
||||
(C) 1988 Regents of the University of California
|
||||
(C) RedHat
|
||||
License: BSD-3-clause or GPL-2+
|
||||
|
||||
Files: debian/*
|
||||
Copyright: (C) 2014 Iain R. Learmonth <irl@fsfe.org>
|
||||
License: GPL-2+
|
||||
|
||||
License: BSD-3-clause
|
||||
Redistribution and use in source and binary forms, with or without
|
||||
modification, are permitted provided that the following conditions
|
||||
are met:
|
||||
.
|
||||
1. Redistributions of source code must retain the above copyright
|
||||
notice, this list of conditions and the following disclaimer.
|
||||
.
|
||||
2. Redistributions in binary form must reproduce the above copyright
|
||||
notice, this list of conditions and the following disclaimer in the
|
||||
documentation and/or other materials provided with the distribution.
|
||||
.
|
||||
3. Neither the name of the University nor the names of its contributors
|
||||
may be used to endorse or promote products derived from this software
|
||||
without specific prior written permission.
|
||||
.
|
||||
THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
|
||||
ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
||||
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
||||
ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
|
||||
FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
|
||||
DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
|
||||
OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
|
||||
HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
|
||||
LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
|
||||
OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
||||
SUCH DAMAGE.
|
||||
|
||||
License: BSD-4-clause
|
||||
Redistribution and use in source and binary forms, with or without
|
||||
modification, are permitted provided that the following conditions
|
||||
are met:
|
||||
.
|
||||
1. Redistributions of source code must retain the above copyright
|
||||
notice, this list of conditions and the following disclaimer.
|
||||
.
|
||||
2. Redistributions in binary form must reproduce the above copyright
|
||||
notice, this list of conditions and the following disclaimer in the
|
||||
documentation and/or other materials provided with the distribution.
|
||||
.
|
||||
3. All advertising materials mentioning features or use of this software
|
||||
must display the following acknowledgement:
|
||||
This product includes software developed by the University of
|
||||
California, Berkeley and its contributors.
|
||||
.
|
||||
4. Neither the name of the University nor the names of its contributors
|
||||
may be used to endorse or promote products derived from this software
|
||||
without specific prior written permission.
|
||||
.
|
||||
THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
|
||||
ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
||||
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
||||
ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
|
||||
FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
|
||||
DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
|
||||
OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
|
||||
HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
|
||||
LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
|
||||
OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
||||
SUCH DAMAGE.
|
||||
|
||||
License: GPL-2+
|
||||
This program is free software: you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation, either version 2 of the License, or
|
||||
(at your option) any later version.
|
||||
.
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
.
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
.
|
||||
On Debian systems, a copy of the full license text is available in
|
||||
/usr/share/common-licenses/GPL-2.
|
||||
|
||||
License: LGPL-2.1+
|
||||
This library is free software; you can redistribute it and/or
|
||||
modify it under the terms of the GNU Lesser General Public
|
||||
License as published by the Free Software Foundation; either
|
||||
version 2.1 of the License, or (at your option) any later version.
|
||||
.
|
||||
This library is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
Lesser General Public License for more details.
|
||||
.
|
||||
You should have received a copy of the GNU Lesser General Public
|
||||
License along with this library; if not, write to the Free Software
|
||||
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
.
|
||||
On Debian systems, a copy of the full license text is available in
|
||||
/usr/share/common-licenses/LGPL-2.1.
|
||||
|
||||
License: Permissive-NGA
|
||||
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.
|
||||
.
|
||||
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.
|
||||
.
|
||||
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.
|
||||
.
|
||||
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.
|
||||
.
|
||||
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.
|
||||
.
|
||||
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.
|
|
@ -0,0 +1,33 @@
|
|||
#!/bin/sh
|
||||
|
||||
set -e
|
||||
|
||||
. /usr/share/debconf/confmodule
|
||||
|
||||
add_group_if_missing() {
|
||||
if ! getent group direwolf >/dev/null; then
|
||||
addgroup --system --force-badname direwolf || true
|
||||
fi
|
||||
}
|
||||
|
||||
add_user_if_missing() {
|
||||
if ! id -u direwolf > /dev/null 2>&1; then
|
||||
mkdir -m 02750 -p /var/lib/direwolf
|
||||
adduser --system --home /var/lib/direwolf \
|
||||
--disabled-password \
|
||||
--force-badname direwolf \
|
||||
--ingroup direwolf
|
||||
adduser direwolf dialout
|
||||
chown direwolf:direwolf /var/lib/direwolf
|
||||
fi
|
||||
}
|
||||
|
||||
add_group_if_missing
|
||||
add_user_if_missing
|
||||
|
||||
db_stop
|
||||
|
||||
#DEBHELPER#
|
||||
|
||||
exit 0
|
||||
|
|
@ -0,0 +1,19 @@
|
|||
#!/bin/sh
|
||||
|
||||
set -e
|
||||
|
||||
case "$1" in
|
||||
purge)
|
||||
rm -rf /var/lib/direwolf/
|
||||
;;
|
||||
remove|upgrade|failed-upgrade|abort-install|abort-upgrade|disappear)
|
||||
;;
|
||||
*)
|
||||
echo "postrm called with unknown argument \`$1'" >&2
|
||||
exit 1
|
||||
esac
|
||||
|
||||
#DEBHELPER#
|
||||
|
||||
exit 0
|
||||
|
|
@ -0,0 +1,7 @@
|
|||
#!/usr/bin/make -f
|
||||
|
||||
%:
|
||||
dh $@ --parallel
|
||||
|
||||
override_dh_auto_configure:
|
||||
dh_auto_configure -- -DFORCE_SSE=1
|
|
@ -0,0 +1 @@
|
|||
3.0 (quilt)
|
3948
decode_aprs.c
3948
decode_aprs.c
File diff suppressed because it is too large
Load Diff
|
@ -1,5 +0,0 @@
|
|||
|
||||
/* decode_aprs.h */
|
||||
|
||||
extern void decode_aprs (packet_t pp);
|
||||
|
570
demod.c
570
demod.c
|
@ -1,570 +0,0 @@
|
|||
//
|
||||
// This file is part of Dire Wolf, an amateur radio packet TNC.
|
||||
//
|
||||
// Copyright (C) 2011,2012,2013 John Langner, WB2OSZ
|
||||
//
|
||||
// This program is free software: you can redistribute it and/or modify
|
||||
// it under the terms of the GNU General Public License as published by
|
||||
// the Free Software Foundation, either version 2 of the License, or
|
||||
// (at your option) any later version.
|
||||
//
|
||||
// This program is distributed in the hope that it will be useful,
|
||||
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
// GNU General Public License for more details.
|
||||
//
|
||||
// You should have received a copy of the GNU General Public License
|
||||
// along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
//
|
||||
|
||||
|
||||
// #define DEBUG1 1 /* display debugging info */
|
||||
|
||||
// #define DEBUG3 1 /* print carrier detect changes. */
|
||||
|
||||
// #define DEBUG4 1 /* capture AFSK demodulator output to log files */
|
||||
|
||||
// #define DEBUG5 1 /* capture 9600 output to log files */
|
||||
|
||||
|
||||
/*------------------------------------------------------------------
|
||||
*
|
||||
* Module: demod.c
|
||||
*
|
||||
* Purpose: Common entry point for multiple types of demodulators.
|
||||
*
|
||||
* Input: Audio samples from either a file or the "sound card."
|
||||
*
|
||||
* Outputs: Calls hdlc_rec_bit() for each bit demodulated.
|
||||
*
|
||||
*---------------------------------------------------------------*/
|
||||
|
||||
|
||||
#include <stdlib.h>
|
||||
#include <stdio.h>
|
||||
#include <math.h>
|
||||
#include <unistd.h>
|
||||
#include <sys/stat.h>
|
||||
#include <string.h>
|
||||
#include <assert.h>
|
||||
#include <ctype.h>
|
||||
|
||||
#include "direwolf.h"
|
||||
#include "audio.h"
|
||||
#include "demod.h"
|
||||
#include "tune.h"
|
||||
#include "fsk_demod_state.h"
|
||||
#include "fsk_gen_filter.h"
|
||||
#include "fsk_fast_filter.h"
|
||||
#include "hdlc_rec.h"
|
||||
#include "textcolor.h"
|
||||
#include "demod_9600.h"
|
||||
#include "demod_afsk.h"
|
||||
|
||||
|
||||
|
||||
// Properties of the radio channels.
|
||||
|
||||
static struct audio_s modem;
|
||||
|
||||
// Current state of all the decoders.
|
||||
|
||||
static struct demodulator_state_s demodulator_state[MAX_CHANS][MAX_SUBCHANS];
|
||||
|
||||
|
||||
#define UPSAMPLE 2
|
||||
|
||||
static int sample_sum[MAX_CHANS][MAX_SUBCHANS];
|
||||
static int sample_count[MAX_CHANS][MAX_SUBCHANS];
|
||||
|
||||
|
||||
/*------------------------------------------------------------------
|
||||
*
|
||||
* Name: demod_init
|
||||
*
|
||||
* Purpose: Initialize the demodulator(s) used for reception.
|
||||
*
|
||||
* Inputs: pa - Pointer to modem_s structure with
|
||||
* various parameters for the modem(s).
|
||||
*
|
||||
* Returns: 0 for success, -1 for failure.
|
||||
*
|
||||
*
|
||||
* Bugs: This doesn't do much error checking so don't give it
|
||||
* anything crazy.
|
||||
*
|
||||
*----------------------------------------------------------------*/
|
||||
|
||||
int demod_init (struct audio_s *pa)
|
||||
{
|
||||
int j;
|
||||
int chan; /* Loop index over number of radio channels. */
|
||||
int subchan; /* for each modem for channel. */
|
||||
char profile;
|
||||
//float fc;
|
||||
|
||||
struct demodulator_state_s *D;
|
||||
|
||||
|
||||
/*
|
||||
* Save parameters for later use.
|
||||
*/
|
||||
memcpy (&modem, pa, sizeof(modem));
|
||||
|
||||
for (chan = 0; chan < modem.num_channels; chan++) {
|
||||
|
||||
assert (chan >= 0 && chan < MAX_CHANS);
|
||||
|
||||
switch (modem.modem_type[chan]) {
|
||||
|
||||
case AFSK:
|
||||
/*
|
||||
* Pick a good default demodulator if none specified.
|
||||
*/
|
||||
if (strlen(modem.profiles[chan]) == 0) {
|
||||
|
||||
if (modem.baud[chan] < 600) {
|
||||
|
||||
/* This has been optimized for 300 baud. */
|
||||
|
||||
strcpy (modem.profiles[chan], "D");
|
||||
if (modem.samples_per_sec > 40000) {
|
||||
modem.decimate[chan] = 3;
|
||||
}
|
||||
}
|
||||
else {
|
||||
#if __arm__
|
||||
/* We probably don't have a lot of CPU power available. */
|
||||
|
||||
if (modem.baud[chan] == FFF_BAUD &&
|
||||
modem.mark_freq[chan] == FFF_MARK_FREQ &&
|
||||
modem.space_freq[chan] == FFF_SPACE_FREQ &&
|
||||
modem.samples_per_sec == FFF_SAMPLES_PER_SEC) {
|
||||
|
||||
modem.profiles[chan][0] = FFF_PROFILE;
|
||||
modem.profiles[chan][1] = '\0';
|
||||
}
|
||||
else {
|
||||
strcpy (modem.profiles[chan], "A");
|
||||
}
|
||||
#else
|
||||
strcpy (modem.profiles[chan], "C");
|
||||
#endif
|
||||
}
|
||||
}
|
||||
|
||||
if (modem.decimate[chan] == 0) modem.decimate[chan] = 1;
|
||||
|
||||
text_color_set(DW_COLOR_DEBUG);
|
||||
dw_printf ("Channel %d: %d baud, AFSK %d & %d Hz, %s, %d sample rate",
|
||||
chan, modem.baud[chan],
|
||||
modem.mark_freq[chan], modem.space_freq[chan],
|
||||
modem.profiles[chan],
|
||||
modem.samples_per_sec);
|
||||
if (modem.decimate[chan] != 1)
|
||||
dw_printf (" / %d", modem.decimate[chan]);
|
||||
dw_printf (".\n");
|
||||
|
||||
if (strlen(modem.profiles[chan]) > 1) {
|
||||
|
||||
/*
|
||||
* Multiple profiles, usually for 1200 baud.
|
||||
*/
|
||||
assert (modem.num_subchan[chan] == strlen(modem.profiles[chan]));
|
||||
|
||||
for (subchan = 0; subchan < modem.num_subchan[chan]; subchan++) {
|
||||
|
||||
int mark, space;
|
||||
assert (subchan >= 0 && subchan < MAX_SUBCHANS);
|
||||
D = &demodulator_state[chan][subchan];
|
||||
|
||||
profile = modem.profiles[chan][subchan];
|
||||
mark = modem.mark_freq[chan];
|
||||
space = modem.space_freq[chan];
|
||||
|
||||
if (modem.num_subchan[chan] != 1) {
|
||||
text_color_set(DW_COLOR_DEBUG);
|
||||
dw_printf (" %d.%d: %c %d & %d\n", chan, subchan, profile, mark, space);
|
||||
}
|
||||
|
||||
demod_afsk_init (modem.samples_per_sec / modem.decimate[chan], modem.baud[chan],
|
||||
mark, space,
|
||||
profile,
|
||||
D);
|
||||
}
|
||||
}
|
||||
else {
|
||||
/*
|
||||
* Possibly multiple frequency pairs.
|
||||
*/
|
||||
|
||||
assert (modem.num_freq[chan] == modem.num_subchan[chan]);
|
||||
assert (strlen(modem.profiles[chan]) == 1);
|
||||
|
||||
for (subchan = 0; subchan < modem.num_freq[chan]; subchan++) {
|
||||
|
||||
int mark, space, k;
|
||||
assert (subchan >= 0 && subchan < MAX_SUBCHANS);
|
||||
D = &demodulator_state[chan][subchan];
|
||||
|
||||
profile = modem.profiles[chan][0];
|
||||
|
||||
k = subchan * modem.offset[chan] - ((modem.num_subchan[chan] - 1) * modem.offset[chan]) / 2;
|
||||
mark = modem.mark_freq[chan] + k;
|
||||
space = modem.space_freq[chan] + k;
|
||||
|
||||
if (modem.num_subchan[chan] != 1) {
|
||||
text_color_set(DW_COLOR_DEBUG);
|
||||
dw_printf (" %d.%d: %c %d & %d\n", chan, subchan, profile, mark, space);
|
||||
}
|
||||
|
||||
demod_afsk_init (modem.samples_per_sec / modem.decimate[chan], modem.baud[chan],
|
||||
mark, space,
|
||||
profile,
|
||||
D);
|
||||
|
||||
} /* for subchan */
|
||||
}
|
||||
break;
|
||||
|
||||
default:
|
||||
|
||||
text_color_set(DW_COLOR_DEBUG);
|
||||
dw_printf ("Channel %d: %d baud, %d sample rate x %d.\n",
|
||||
chan, modem.baud[chan],
|
||||
modem.samples_per_sec, UPSAMPLE);
|
||||
|
||||
subchan = 0;
|
||||
D = &demodulator_state[chan][subchan];
|
||||
|
||||
demod_9600_init (UPSAMPLE * modem.samples_per_sec, modem.baud[chan], D);
|
||||
|
||||
break;
|
||||
|
||||
} /* switch on modulation type. */
|
||||
|
||||
} /* for chan ... */
|
||||
|
||||
|
||||
|
||||
for (chan=0; chan<MAX_CHANS; chan++)
|
||||
{
|
||||
for (subchan = 0; subchan < modem.num_subchan[chan]; subchan++) {
|
||||
struct demodulator_state_s *D;
|
||||
|
||||
assert (subchan >= 0 && subchan < MAX_SUBCHANS);
|
||||
|
||||
sample_sum[chan][subchan] = 0;
|
||||
sample_count[chan][subchan] = subchan; /* stagger */
|
||||
|
||||
D = &demodulator_state[chan][subchan];
|
||||
|
||||
/* For collecting input signal level. */
|
||||
|
||||
D->lev_period = modem.samples_per_sec * 0.100; // Samples in 0.100 seconds.
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
return (0);
|
||||
|
||||
} /* end demod_init */
|
||||
|
||||
|
||||
|
||||
/*------------------------------------------------------------------
|
||||
*
|
||||
* Name: demod_get_sample
|
||||
*
|
||||
* Purpose: Get one audio sample fromt the sound input source.
|
||||
*
|
||||
* Returns: -32768 .. 32767 for a valid audio sample.
|
||||
* 256*256 for end of file or other error.
|
||||
*
|
||||
* Global In: modem.bits_per_sample - So we know whether to
|
||||
* read 1 or 2 bytes from audio stream.
|
||||
*
|
||||
* Description: Grab 1 or two btyes depending on data source.
|
||||
*
|
||||
* When processing stereo, the caller will call this
|
||||
* at twice the normal rate to obtain alternating left
|
||||
* and right samples.
|
||||
*
|
||||
*----------------------------------------------------------------*/
|
||||
|
||||
#define FSK_READ_ERR (256*256)
|
||||
|
||||
|
||||
__attribute__((hot))
|
||||
int demod_get_sample (void)
|
||||
{
|
||||
int x1, x2;
|
||||
signed short sam; /* short to force sign extention. */
|
||||
|
||||
|
||||
assert (modem.bits_per_sample == 8 || modem.bits_per_sample == 16);
|
||||
|
||||
|
||||
if (modem.bits_per_sample == 8) {
|
||||
|
||||
x1 = audio_get();
|
||||
if (x1 < 0) return(FSK_READ_ERR);
|
||||
|
||||
assert (x1 >= 0 && x1 <= 255);
|
||||
|
||||
/* Scale 0..255 into -32k..+32k */
|
||||
|
||||
sam = (x1 - 128) * 256;
|
||||
|
||||
}
|
||||
else {
|
||||
x1 = audio_get(); /* lower byte first */
|
||||
if (x1 < 0) return(FSK_READ_ERR);
|
||||
|
||||
x2 = audio_get();
|
||||
if (x2 < 0) return(FSK_READ_ERR);
|
||||
|
||||
assert (x1 >= 0 && x1 <= 255);
|
||||
assert (x2 >= 0 && x2 <= 255);
|
||||
|
||||
sam = ( x2 << 8 ) | x1;
|
||||
}
|
||||
|
||||
return (sam);
|
||||
}
|
||||
|
||||
|
||||
/*-------------------------------------------------------------------
|
||||
*
|
||||
* Name: demod_process_sample
|
||||
*
|
||||
* Purpose: (1) Demodulate the AFSK signal.
|
||||
* (2) Recover clock and data.
|
||||
*
|
||||
* Inputs: chan - Audio channel. 0 for left, 1 for right.
|
||||
* subchan - modem of the channel.
|
||||
* sam - One sample of audio.
|
||||
* Should be in range of -32768 .. 32767.
|
||||
*
|
||||
* Returns: None
|
||||
*
|
||||
* Descripion: We start off with two bandpass filters tuned to
|
||||
* the given frequencies. In the case of VHF packet
|
||||
* radio, this would be 1200 and 2200 Hz.
|
||||
*
|
||||
* The bandpass filter amplitudes are compared to
|
||||
* obtain the demodulated signal.
|
||||
*
|
||||
* We also have a digital phase locked loop (PLL)
|
||||
* to recover the clock and pick out data bits at
|
||||
* the proper rate.
|
||||
*
|
||||
* For each recovered data bit, we call:
|
||||
*
|
||||
* hdlc_rec (channel, demodulated_bit);
|
||||
*
|
||||
* to decode HDLC frames from the stream of bits.
|
||||
*
|
||||
* Future: This could be generalized by passing in the name
|
||||
* of the function to be called for each bit recovered
|
||||
* from the demodulator. For now, it's simply hard-coded.
|
||||
*
|
||||
*--------------------------------------------------------------------*/
|
||||
|
||||
|
||||
__attribute__((hot))
|
||||
void demod_process_sample (int chan, int subchan, int sam)
|
||||
{
|
||||
float fsam, abs_fsam;
|
||||
int k;
|
||||
|
||||
|
||||
#if DEBUG4
|
||||
static FILE *demod_log_fp = NULL;
|
||||
static int seq = 0; /* for log file name */
|
||||
#endif
|
||||
|
||||
int j;
|
||||
int demod_data;
|
||||
struct demodulator_state_s *D;
|
||||
|
||||
assert (chan >= 0 && chan < MAX_CHANS);
|
||||
assert (subchan >= 0 && subchan < MAX_SUBCHANS);
|
||||
|
||||
D = &demodulator_state[chan][subchan];
|
||||
|
||||
|
||||
#if 1 /* TODO: common level detection. */
|
||||
|
||||
/* Scale to nice number, TODO: range -1.0 to +1.0, not 2. */
|
||||
|
||||
fsam = sam / 16384.0;
|
||||
|
||||
/*
|
||||
* Accumulate measure of the input signal level.
|
||||
*/
|
||||
abs_fsam = fsam >= 0 ? fsam : -fsam;
|
||||
|
||||
if (abs_fsam > D->lev_peak_acc) {
|
||||
D->lev_peak_acc = abs_fsam;
|
||||
}
|
||||
D->lev_sum_acc += abs_fsam;
|
||||
|
||||
D->lev_count++;
|
||||
if (D->lev_count >= D->lev_period) {
|
||||
D->lev_prev_peak = D->lev_last_peak;
|
||||
D->lev_last_peak = D->lev_peak_acc;
|
||||
D->lev_peak_acc = 0;
|
||||
|
||||
D->lev_prev_ave = D->lev_last_ave;
|
||||
D->lev_last_ave = D->lev_sum_acc / D->lev_count;
|
||||
D->lev_sum_acc = 0;
|
||||
|
||||
D->lev_count = 0;
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
/*
|
||||
* Select decoder based on modulation type.
|
||||
*/
|
||||
|
||||
switch (modem.modem_type[chan]) {
|
||||
|
||||
case AFSK:
|
||||
|
||||
if (modem.decimate[chan] > 1) {
|
||||
|
||||
sample_sum[chan][subchan] += sam;
|
||||
sample_count[chan][subchan]++;
|
||||
if (sample_count[chan][subchan] >= modem.decimate[chan]) {
|
||||
demod_afsk_process_sample (chan, subchan, sample_sum[chan][subchan] / modem.decimate[chan], D);
|
||||
sample_sum[chan][subchan] = 0;
|
||||
sample_count[chan][subchan] = 0;
|
||||
}
|
||||
}
|
||||
else {
|
||||
demod_afsk_process_sample (chan, subchan, sam, D);
|
||||
}
|
||||
break;
|
||||
|
||||
default:
|
||||
|
||||
#define ZEROSTUFF 1
|
||||
|
||||
|
||||
#if ZEROSTUFF
|
||||
/* Literature says this is better if followed */
|
||||
/* by appropriate low pass filter. */
|
||||
/* So far, both are same in tests with different */
|
||||
/* optimal low pass filter parameters. */
|
||||
|
||||
for (k=1; k<UPSAMPLE; k++) {
|
||||
demod_9600_process_sample (chan, 0, D);
|
||||
}
|
||||
demod_9600_process_sample (chan, sam*UPSAMPLE, D);
|
||||
#else
|
||||
/* Linear interpolation. */
|
||||
static int prev_sam;
|
||||
switch (UPSAMPLE) {
|
||||
case 1:
|
||||
demod_9600_process_sample (chan, sam);
|
||||
|
||||
break;
|
||||
case 2:
|
||||
demod_9600_process_sample (chan, (prev_sam + sam) / 2, D);
|
||||
demod_9600_process_sample (chan, sam, D);
|
||||
break;
|
||||
case 3:
|
||||
demod_9600_process_sample (chan, (2 * prev_sam + sam) / 3, D);
|
||||
demod_9600_process_sample (chan, (prev_sam + 2 * sam) / 3, D);
|
||||
demod_9600_process_sample (chan, sam, D);
|
||||
break;
|
||||
case 4:
|
||||
demod_9600_process_sample (chan, (3 * prev_sam + sam) / 4, D);
|
||||
demod_9600_process_sample (chan, (prev_sam + sam) / 2, D);
|
||||
demod_9600_process_sample (chan, (prev_sam + 3 * sam) / 4, D);
|
||||
demod_9600_process_sample (chan, sam, D);
|
||||
break;
|
||||
default:
|
||||
assert (0);
|
||||
break;
|
||||
}
|
||||
prev_sam = sam;
|
||||
#endif
|
||||
break;
|
||||
}
|
||||
return;
|
||||
|
||||
} /* end demod_process_sample */
|
||||
|
||||
|
||||
|
||||
|
||||
/*-------------------------------------------------------------------
|
||||
*
|
||||
* Name: fsk_demod_print_agc
|
||||
*
|
||||
* Purpose: Print information about input signal amplitude.
|
||||
* This will be useful for adjusting transmitter audio levels.
|
||||
* We also want to avoid having an input level so high
|
||||
* that the A/D converter "clips" the signal.
|
||||
*
|
||||
*
|
||||
* Inputs: chan - Audio channel. 0 for left, 1 for right.
|
||||
*
|
||||
* Returns: None
|
||||
*
|
||||
* Descripion: Not sure what to use for final form.
|
||||
* For now display the AGC peaks for both tones.
|
||||
* This will be called at the end of a frame.
|
||||
*
|
||||
* Future: Come up with a sensible scale and add command line option.
|
||||
* Probably makes more sense to return a single number
|
||||
* and let the caller print it.
|
||||
* Just an experiment for now.
|
||||
*
|
||||
*--------------------------------------------------------------------*/
|
||||
|
||||
#if 0
|
||||
void demod_print_agc (int chan, int subchan)
|
||||
{
|
||||
|
||||
struct demodulator_state_s *D;
|
||||
|
||||
|
||||
assert (chan >= 0 && chan < MAX_CHANS);
|
||||
assert (subchan >= 0 && subchan < MAX_SUBCHANS);
|
||||
|
||||
D = &demodulator_state[chan][subchan];
|
||||
|
||||
dw_printf ("%d\n", (int)((D->lev_last_peak + D->lev_prev_peak)*50));
|
||||
|
||||
|
||||
|
||||
//dw_printf ("Peak= %.2f, %.2f Ave= %.2f, %.2f AGC M= %.2f / %.2f S= %.2f / %.2f\n",
|
||||
// D->lev_last_peak, D->lev_prev_peak, D->lev_last_ave, D->lev_prev_ave,
|
||||
// D->m_peak, D->m_valley, D->s_peak, D->s_valley);
|
||||
|
||||
}
|
||||
#endif
|
||||
|
||||
/* Resulting scale is 0 to almost 100. */
|
||||
/* Cranking up the input level produces no more than 97 or 98. */
|
||||
/* We currently produce a message when this goes over 90. */
|
||||
|
||||
int demod_get_audio_level (int chan, int subchan)
|
||||
{
|
||||
struct demodulator_state_s *D;
|
||||
|
||||
|
||||
assert (chan >= 0 && chan < MAX_CHANS);
|
||||
assert (subchan >= 0 && subchan < MAX_SUBCHANS);
|
||||
|
||||
D = &demodulator_state[chan][subchan];
|
||||
|
||||
return ( (int) ((D->lev_last_peak + D->lev_prev_peak) * 50 ) );
|
||||
}
|
||||
|
||||
|
||||
/* end demod.c */
|
463
demod_9600.c
463
demod_9600.c
|
@ -1,463 +0,0 @@
|
|||
//
|
||||
// This file is part of Dire Wolf, an amateur radio packet TNC.
|
||||
//
|
||||
// Copyright (C) 2011,2012,2013 John Langner, WB2OSZ
|
||||
//
|
||||
// This program is free software: you can redistribute it and/or modify
|
||||
// it under the terms of the GNU General Public License as published by
|
||||
// the Free Software Foundation, either version 2 of the License, or
|
||||
// (at your option) any later version.
|
||||
//
|
||||
// This program is distributed in the hope that it will be useful,
|
||||
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
// GNU General Public License for more details.
|
||||
//
|
||||
// You should have received a copy of the GNU General Public License
|
||||
// along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
//
|
||||
|
||||
|
||||
// #define DEBUG5 1 /* capture 9600 output to log files */
|
||||
|
||||
|
||||
/*------------------------------------------------------------------
|
||||
*
|
||||
* Module: demod_9600.c
|
||||
*
|
||||
* Purpose: Demodulator for scrambled baseband encoding.
|
||||
*
|
||||
* Input: Audio samples from either a file or the "sound card."
|
||||
*
|
||||
* Outputs: Calls hdlc_rec_bit() for each bit demodulated.
|
||||
*
|
||||
*---------------------------------------------------------------*/
|
||||
|
||||
#include <stdlib.h>
|
||||
#include <stdio.h>
|
||||
#include <math.h>
|
||||
#include <unistd.h>
|
||||
#include <sys/stat.h>
|
||||
#include <string.h>
|
||||
#include <assert.h>
|
||||
#include <ctype.h>
|
||||
|
||||
#include "direwolf.h"
|
||||
#include "tune.h"
|
||||
#include "fsk_demod_state.h"
|
||||
#include "hdlc_rec.h"
|
||||
#include "demod_9600.h"
|
||||
#include "textcolor.h"
|
||||
#include "dsp.h"
|
||||
|
||||
|
||||
/* Add sample to buffer and shift the rest down. */
|
||||
|
||||
__attribute__((hot))
|
||||
static inline void push_sample (float val, float *buff, int size)
|
||||
{
|
||||
int j;
|
||||
|
||||
// TODO: memmove any faster?
|
||||
for (j = size - 1; j >= 1; j--) {
|
||||
buff[j] = buff[j-1];
|
||||
}
|
||||
buff[0] = val;
|
||||
}
|
||||
|
||||
|
||||
/* FIR filter kernel. */
|
||||
|
||||
__attribute__((hot))
|
||||
static inline float convolve (const float *data, const float *filter, int filter_size)
|
||||
{
|
||||
float sum = 0;
|
||||
int j;
|
||||
|
||||
for (j=0; j<filter_size; j++) {
|
||||
sum += filter[j] * data[j];
|
||||
}
|
||||
return (sum);
|
||||
}
|
||||
|
||||
/* Automatic gain control. */
|
||||
/* Result should settle down to 1 unit peak to peak. i.e. -0.5 to +0.5 */
|
||||
|
||||
__attribute__((hot))
|
||||
static inline float agc (float in, float fast_attack, float slow_decay, float *ppeak, float *pvalley)
|
||||
{
|
||||
if (in >= *ppeak) {
|
||||
*ppeak = in * fast_attack + *ppeak * (1. - fast_attack);
|
||||
}
|
||||
else {
|
||||
*ppeak = in * slow_decay + *ppeak * (1. - slow_decay);
|
||||
}
|
||||
|
||||
if (in <= *pvalley) {
|
||||
*pvalley = in * fast_attack + *pvalley * (1. - fast_attack);
|
||||
}
|
||||
else {
|
||||
*pvalley = in * slow_decay + *pvalley * (1. - slow_decay);
|
||||
}
|
||||
|
||||
if (*ppeak > *pvalley) {
|
||||
return ((in - 0.5 * (*ppeak + *pvalley)) / (*ppeak - *pvalley));
|
||||
}
|
||||
return (0.0);
|
||||
}
|
||||
|
||||
|
||||
/*------------------------------------------------------------------
|
||||
*
|
||||
* Name: demod_9600_init
|
||||
*
|
||||
* Purpose: Initialize the 9600 baud demodulator.
|
||||
*
|
||||
* Inputs: samples_per_sec - Number of samples per second.
|
||||
* Might be upsampled in hopes of
|
||||
* reducing the PLL jitter.
|
||||
*
|
||||
* baud - Data rate in bits per second.
|
||||
*
|
||||
* D - Address of demodulator state.
|
||||
*
|
||||
* Returns: None
|
||||
*
|
||||
*----------------------------------------------------------------*/
|
||||
|
||||
void demod_9600_init (int samples_per_sec, int baud, struct demodulator_state_s *D)
|
||||
{
|
||||
float fc;
|
||||
|
||||
memset (D, 0, sizeof(struct demodulator_state_s));
|
||||
|
||||
//dw_printf ("demod_9600_init(rate=%d, baud=%d, D ptr)\n", samples_per_sec, baud);
|
||||
|
||||
D->pll_step_per_sample =
|
||||
(int) round(TICKS_PER_PLL_CYCLE * (double) baud / (double)samples_per_sec);
|
||||
|
||||
D->filter_len_bits = 72 * 9600.0 / (44100.0 * 2.0);
|
||||
D->lp_filter_size = (int) (( D->filter_len_bits * (float)samples_per_sec / baud) + 0.5);
|
||||
#if TUNE_LP_FILTER_SIZE
|
||||
D->lp_filter_size = TUNE_LP_FILTER_SIZE;
|
||||
#endif
|
||||
|
||||
D->lpf_baud = 0.59;
|
||||
#ifdef TUNE_LPF_BAUD
|
||||
D->lpf_baud = TUNE_LPF_BAUD;
|
||||
#endif
|
||||
|
||||
D->agc_fast_attack = 0.080;
|
||||
#ifdef TUNE_AGC_FAST
|
||||
D->agc_fast_attack = TUNE_AGC_FAST;
|
||||
#endif
|
||||
|
||||
D->agc_slow_decay = 0.00012;
|
||||
#ifdef TUNE_AGC_SLOW
|
||||
D->agc_slow_decay = TUNE_AGC_SLOW;
|
||||
#endif
|
||||
|
||||
D->pll_locked_inertia = 0.88;
|
||||
D->pll_searching_inertia = 0.67;
|
||||
|
||||
#if defined(TUNE_PLL_LOCKED) && defined(TUNE_PLL_SEARCHING)
|
||||
D->pll_locked_inertia = TUNE_PLL_LOCKED;
|
||||
D->pll_searching_inertia = TUNE_PLL_SEARCHING;
|
||||
#endif
|
||||
|
||||
fc = (float)baud * D->lpf_baud / (float)samples_per_sec;
|
||||
|
||||
//dw_printf ("demod_9600_init: call gen_lowpass(fc=%.2f, , size=%d, )\n", fc, D->lp_filter_size);
|
||||
|
||||
gen_lowpass (fc, D->lp_filter, D->lp_filter_size, BP_WINDOW_HAMMING);
|
||||
|
||||
} /* end fsk_demod_init */
|
||||
|
||||
|
||||
|
||||
/*-------------------------------------------------------------------
|
||||
*
|
||||
* Name: demod_9600_process_sample
|
||||
*
|
||||
* Purpose: (1) Filter & slice the signal.
|
||||
* (2) Descramble it.
|
||||
* (2) Recover clock and data.
|
||||
*
|
||||
* Inputs: chan - Audio channel. 0 for left, 1 for right.
|
||||
*
|
||||
* sam - One sample of audio.
|
||||
* Should be in range of -32768 .. 32767.
|
||||
*
|
||||
* Returns: None
|
||||
*
|
||||
* Descripion: "9600 baud" packet is FSK for an FM voice transceiver.
|
||||
* By the time it gets here, it's really a baseband signal.
|
||||
* At one extreme, we could have a 4800 Hz square wave.
|
||||
* A the other extreme, we could go a considerable number
|
||||
* of bit times without any transitions.
|
||||
*
|
||||
* The trick is to extract the digital data which has
|
||||
* been distorted by going thru voice transceivers not
|
||||
* intended to pass this sort of "audio" signal.
|
||||
*
|
||||
* Data is "scrambled" to reduce the amount of DC bias.
|
||||
* The data stream must be unscrambled at the receiving end.
|
||||
*
|
||||
* We also have a digital phase locked loop (PLL)
|
||||
* to recover the clock and pick out data bits at
|
||||
* the proper rate.
|
||||
*
|
||||
* For each recovered data bit, we call:
|
||||
*
|
||||
* hdlc_rec (channel, demodulated_bit);
|
||||
*
|
||||
* to decode HDLC frames from the stream of bits.
|
||||
*
|
||||
* Future: This could be generalized by passing in the name
|
||||
* of the function to be called for each bit recovered
|
||||
* from the demodulator. For now, it's simply hard-coded.
|
||||
*
|
||||
* References: 9600 Baud Packet Radio Modem Design
|
||||
* http://www.amsat.org/amsat/articles/g3ruh/109.html
|
||||
*
|
||||
* The KD2BD 9600 Baud Modem
|
||||
* http://www.amsat.org/amsat/articles/kd2bd/9k6modem/
|
||||
*
|
||||
* 9600 Baud Packet Handbook
|
||||
* ftp://ftp.tapr.org/general/9600baud/96man2x0.txt
|
||||
*
|
||||
*
|
||||
* TODO: This works in a simulated environment but it has not yet
|
||||
* been successfully tested for interoperability with
|
||||
* other systems over the air.
|
||||
* That's why it is not mentioned in documentation.
|
||||
*
|
||||
* The signal from the radio speaker does NOT have
|
||||
* enough bandwidth and the waveform is hopelessly distorted.
|
||||
* It will be necessary to obtain a signal right after
|
||||
* the discriminator of the receiver.
|
||||
* It will probably also be necessary to tap directly into
|
||||
* the modulator, bypassing the microphone amplifier.
|
||||
*
|
||||
*--------------------------------------------------------------------*/
|
||||
|
||||
|
||||
__attribute__((hot))
|
||||
void demod_9600_process_sample (int chan, int sam, struct demodulator_state_s *D)
|
||||
{
|
||||
|
||||
float fsam;
|
||||
float abs_fsam;
|
||||
float amp;
|
||||
float demod_out;
|
||||
|
||||
#if DEBUG5
|
||||
static FILE *demod_log_fp = NULL;
|
||||
static int seq = 0; /* for log file name */
|
||||
#endif
|
||||
|
||||
int j;
|
||||
int subchan = 0;
|
||||
int demod_data; /* Still scrambled. */
|
||||
static int descram; /* Data bit de-scrambled. */
|
||||
|
||||
|
||||
assert (chan >= 0 && chan < MAX_CHANS);
|
||||
assert (subchan >= 0 && subchan < MAX_SUBCHANS);
|
||||
|
||||
|
||||
/*
|
||||
* Filters use last 'filter_size' samples.
|
||||
*
|
||||
* First push the older samples down.
|
||||
*
|
||||
* Finally, put the most recent at the beginning.
|
||||
*
|
||||
* Future project? Rather than shifting the samples,
|
||||
* it might be faster to add another variable to keep
|
||||
* track of the most recent sample and change the
|
||||
* indexing in the later loops that multipy and add.
|
||||
*/
|
||||
|
||||
/* Scale to nice number, range -1.0 to +1.0. */
|
||||
|
||||
fsam = sam / 32768.0;
|
||||
|
||||
push_sample (fsam, D->raw_cb, D->lp_filter_size);
|
||||
|
||||
/*
|
||||
* Low pass filter to reduce noise yet pass the data.
|
||||
*/
|
||||
|
||||
amp = convolve (D->raw_cb, D->lp_filter, D->lp_filter_size);
|
||||
|
||||
/*
|
||||
* The input level can vary greatly.
|
||||
* More importantly, there could be a DC bias which we need to remove.
|
||||
*
|
||||
* Normalize the signal with automatic gain control (AGC).
|
||||
* This works by looking at the minimum and maximum signal peaks
|
||||
* and scaling the results to be roughly in the -1.0 to +1.0 range.
|
||||
*/
|
||||
|
||||
demod_out = 2.0 * agc (amp, D->agc_fast_attack, D->agc_slow_decay, &(D->m_peak), &(D->m_valley));
|
||||
|
||||
//dw_printf ("peak=%.2f valley=%.2f amp=%.2f norm=%.2f\n", D->m_peak, D->m_valley, amp, norm);
|
||||
|
||||
/* Throw in a little Hysteresis??? */
|
||||
/* (Not to be confused with Hysteria.) */
|
||||
|
||||
if (demod_out > 0.01) {
|
||||
demod_data = 1;
|
||||
}
|
||||
else if (demod_out < -0.01) {
|
||||
demod_data = 0;
|
||||
}
|
||||
else {
|
||||
demod_data = D->prev_demod_data;
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* Next, a PLL is used to sample near the centers of the data bits.
|
||||
*
|
||||
* D->data_clock_pll is a SIGNED 32 bit variable.
|
||||
* When it overflows from a large positive value to a negative value, we
|
||||
* sample a data bit from the demodulated signal.
|
||||
*
|
||||
* Ideally, the the demodulated signal transitions should be near
|
||||
* zero we we sample mid way between the transitions.
|
||||
*
|
||||
* Nudge the PLL by removing some small fraction from the value of
|
||||
* data_clock_pll, pushing it closer to zero.
|
||||
*
|
||||
* This adjustment will never change the sign so it won't cause
|
||||
* any erratic data bit sampling.
|
||||
*
|
||||
* If we adjust it too quickly, the clock will have too much jitter.
|
||||
* If we adjust it too slowly, it will take too long to lock on to a new signal.
|
||||
*
|
||||
* I don't think the optimal value will depend on the audio sample rate
|
||||
* because this happens for each transition from the demodulator.
|
||||
*
|
||||
* This was optimized for 1200 baud AFSK. There might be some opportunity
|
||||
* for improvement here.
|
||||
*/
|
||||
D->prev_d_c_pll = D->data_clock_pll;
|
||||
D->data_clock_pll += D->pll_step_per_sample;
|
||||
|
||||
if (D->data_clock_pll < 0 && D->prev_d_c_pll > 0) {
|
||||
|
||||
/* Overflow. */
|
||||
|
||||
/*
|
||||
* At this point, we need to descramble the data as
|
||||
* in hardware based designs by G3RUH and K9NG.
|
||||
*
|
||||
* http://www.amsat.org/amsat/articles/g3ruh/109/fig03.gif
|
||||
*/
|
||||
|
||||
//assert (modem.modem_type[chan] == SCRAMBLE);
|
||||
|
||||
//if (modem.modem_type[chan] == SCRAMBLE) {
|
||||
|
||||
|
||||
// TODO: This needs to be rearranged to allow attempted "fixing"
|
||||
// of corrupted bits later. We need to store the original
|
||||
// received bits and do the descrambling after attempted
|
||||
// repairs. However, we also need to descramble now to
|
||||
// detect the flag sequences.
|
||||
|
||||
|
||||
descram = descramble (demod_data, &(D->lfsr));
|
||||
#if SLICENDICE
|
||||
// TODO: Needs more thought.
|
||||
// Does it even make sense to remember demod_out in this case?
|
||||
// We would need to do the re-thresholding before descrambling.
|
||||
//hdlc_rec_bit_sam (chan, subchan, descram, descram ? 1.0 : -1.0);
|
||||
#else
|
||||
|
||||
// TODO: raw received bit and true later.
|
||||
|
||||
hdlc_rec_bit (chan, subchan, descram, 0, D->lfsr);
|
||||
|
||||
#endif
|
||||
|
||||
//D->prev_descram = descram;
|
||||
//}
|
||||
//else {
|
||||
/* Baseband signal for completeness - not in common use. */
|
||||
#if SLICENDICE
|
||||
//hdlc_rec_bit_sam (chan, subchan, demod_data, demod_data ? 1.0 : -1.0);
|
||||
#else
|
||||
//hdlc_rec_bit (chan, subchan, demod_data);
|
||||
#endif
|
||||
//}
|
||||
}
|
||||
|
||||
if (demod_data != D->prev_demod_data) {
|
||||
|
||||
// Note: Test for this demodulator, not overall for channel.
|
||||
|
||||
if (hdlc_rec_data_detect_1 (chan, subchan)) {
|
||||
D->data_clock_pll = (int)(D->data_clock_pll * D->pll_locked_inertia);
|
||||
}
|
||||
else {
|
||||
D->data_clock_pll = (int)(D->data_clock_pll * D->pll_searching_inertia);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
#if DEBUG5
|
||||
|
||||
//if (chan == 0) {
|
||||
if (hdlc_rec_data_detect_1 (chan,subchan)) {
|
||||
|
||||
char fname[30];
|
||||
|
||||
|
||||
if (demod_log_fp == NULL) {
|
||||
seq++;
|
||||
sprintf (fname, "demod96/%04d.csv", seq);
|
||||
if (seq == 1) mkdir ("demod96"
|
||||
#ifndef __WIN32__
|
||||
, 0777
|
||||
#endif
|
||||
);
|
||||
|
||||
demod_log_fp = fopen (fname, "w");
|
||||
text_color_set(DW_COLOR_DEBUG);
|
||||
dw_printf ("Starting 9600 decoder log file %s\n", fname);
|
||||
fprintf (demod_log_fp, "Audio, Peak, Valley, Demod, SData, Descram, Clock\n");
|
||||
}
|
||||
fprintf (demod_log_fp, "%.3f, %.3f, %.3f, %.3f, %.2f, %.2f, %.2f\n",
|
||||
0.5 * fsam + 3.5,
|
||||
0.5 * D->m_peak + 3.5,
|
||||
0.5 * D->m_valley + 3.5,
|
||||
0.5 * demod_out + 2.0,
|
||||
demod_data ? 1.35 : 1.0,
|
||||
descram ? .9 : .55,
|
||||
(D->data_clock_pll & 0x80000000) ? .1 : .45);
|
||||
}
|
||||
else {
|
||||
if (demod_log_fp != NULL) {
|
||||
fclose (demod_log_fp);
|
||||
demod_log_fp = NULL;
|
||||
}
|
||||
}
|
||||
//}
|
||||
|
||||
#endif
|
||||
|
||||
|
||||
/*
|
||||
* Remember demodulator output (pre-descrambling) so we can compare next time
|
||||
* for the DPLL sync.
|
||||
*/
|
||||
D->prev_demod_data = demod_data;
|
||||
|
||||
} /* end demod_9600_process_sample */
|
||||
|
||||
|
||||
|
||||
/* end demod_9600.c */
|
21
demod_9600.h
21
demod_9600.h
|
@ -1,21 +0,0 @@
|
|||
|
||||
|
||||
/* demod_9600.h */
|
||||
|
||||
void demod_9600_init (int samples_per_sec, int baud, struct demodulator_state_s *D);
|
||||
|
||||
void demod_9600_process_sample (int chan, int sam, struct demodulator_state_s *D);
|
||||
|
||||
|
||||
|
||||
|
||||
/* Undo data scrambling for 9600 baud. */
|
||||
|
||||
static inline int descramble (int in, int *state)
|
||||
{
|
||||
int out;
|
||||
|
||||
out = (in ^ (*state >> 16) ^ (*state >> 11)) & 1;
|
||||
*state = (*state << 1) | (in & 1);
|
||||
return (out);
|
||||
}
|
977
demod_afsk.c
977
demod_afsk.c
|
@ -1,977 +0,0 @@
|
|||
//
|
||||
// This file is part of Dire Wolf, an amateur radio packet TNC.
|
||||
//
|
||||
// Copyright (C) 2011,2012,2013,2014 John Langner, WB2OSZ
|
||||
//
|
||||
// This program is free software: you can redistribute it and/or modify
|
||||
// it under the terms of the GNU General Public License as published by
|
||||
// the Free Software Foundation, either version 2 of the License, or
|
||||
// (at your option) any later version.
|
||||
//
|
||||
// This program is distributed in the hope that it will be useful,
|
||||
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
// GNU General Public License for more details.
|
||||
//
|
||||
// You should have received a copy of the GNU General Public License
|
||||
// along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
//
|
||||
|
||||
|
||||
// #define DEBUG1 1 /* display debugging info */
|
||||
|
||||
// #define DEBUG3 1 /* print carrier detect changes. */
|
||||
|
||||
// #define DEBUG4 1 /* capture AFSK demodulator output to log files */
|
||||
|
||||
// #define DEBUG5 1 /* capture 9600 output to log files */
|
||||
|
||||
|
||||
/*------------------------------------------------------------------
|
||||
*
|
||||
* Module: demod_afsk.c
|
||||
*
|
||||
* Purpose: Demodulator for Audio Frequency Shift Keying (AFSK).
|
||||
*
|
||||
* Input: Audio samples from either a file or the "sound card."
|
||||
*
|
||||
* Outputs: Calls hdlc_rec_bit() for each bit demodulated.
|
||||
*
|
||||
*---------------------------------------------------------------*/
|
||||
|
||||
|
||||
|
||||
#include <stdlib.h>
|
||||
#include <stdio.h>
|
||||
#include <math.h>
|
||||
#include <unistd.h>
|
||||
#include <sys/stat.h>
|
||||
#include <string.h>
|
||||
#include <assert.h>
|
||||
#include <ctype.h>
|
||||
|
||||
#include "direwolf.h"
|
||||
#include "audio.h"
|
||||
//#include "fsk_demod.h"
|
||||
//#include "gen_tone.h"
|
||||
#include "tune.h"
|
||||
#include "fsk_demod_state.h"
|
||||
#include "fsk_gen_filter.h"
|
||||
#include "hdlc_rec.h"
|
||||
#include "textcolor.h"
|
||||
#include "demod_afsk.h"
|
||||
#include "dsp.h"
|
||||
|
||||
#define MIN(a,b) ((a)<(b)?(a):(b))
|
||||
#define MAX(a,b) ((a)>(b)?(a):(b))
|
||||
|
||||
|
||||
|
||||
|
||||
/* Quick approximation to sqrt(x*x+y*y) */
|
||||
/* No benefit for regular PC. */
|
||||
/* Should help with microcomputer platform. */
|
||||
|
||||
|
||||
__attribute__((hot))
|
||||
static inline float z (float x, float y)
|
||||
{
|
||||
x = fabsf(x);
|
||||
y = fabsf(y);
|
||||
|
||||
if (x > y) {
|
||||
return (x * .941246 + y * .41);
|
||||
}
|
||||
else {
|
||||
return (y * .941246 + x * .41);
|
||||
}
|
||||
}
|
||||
|
||||
/* Add sample to buffer and shift the rest down. */
|
||||
|
||||
__attribute__((hot))
|
||||
static inline void push_sample (float val, float *buff, int size)
|
||||
{
|
||||
int j;
|
||||
|
||||
// TODO: memmove any faster?
|
||||
for (j = size - 1; j >= 1; j--) {
|
||||
buff[j] = buff[j-1];
|
||||
}
|
||||
buff[0] = val;
|
||||
}
|
||||
|
||||
|
||||
/* FIR filter kernel. */
|
||||
|
||||
__attribute__((hot))
|
||||
static inline float convolve (const float *data, const float *filter, int filter_size)
|
||||
{
|
||||
float sum = 0;
|
||||
int j;
|
||||
|
||||
for (j=0; j<filter_size; j++) {
|
||||
sum += filter[j] * data[j];
|
||||
}
|
||||
return (sum);
|
||||
}
|
||||
|
||||
/* Automatic gain control. */
|
||||
/* Result should settle down to 1 unit peak to peak. i.e. -0.5 to +0.5 */
|
||||
|
||||
__attribute__((hot))
|
||||
static inline float agc (float in, float fast_attack, float slow_decay, float *ppeak, float *pvalley)
|
||||
{
|
||||
if (in >= *ppeak) {
|
||||
*ppeak = in * fast_attack + *ppeak * (1. - fast_attack);
|
||||
}
|
||||
else {
|
||||
*ppeak = in * slow_decay + *ppeak * (1. - slow_decay);
|
||||
}
|
||||
|
||||
if (in <= *pvalley) {
|
||||
*pvalley = in * fast_attack + *pvalley * (1. - fast_attack);
|
||||
}
|
||||
else {
|
||||
*pvalley = in * slow_decay + *pvalley * (1. - slow_decay);
|
||||
}
|
||||
|
||||
if (*ppeak > *pvalley) {
|
||||
return ((in - 0.5 * (*ppeak + *pvalley)) / (*ppeak - *pvalley));
|
||||
}
|
||||
return (0.0);
|
||||
}
|
||||
|
||||
|
||||
|
||||
/*------------------------------------------------------------------
|
||||
*
|
||||
* Name: demod_afsk_init
|
||||
*
|
||||
* Purpose: Initialization for an AFSK demodulator.
|
||||
* Select appropriate parameters and set up filters.
|
||||
*
|
||||
* Inputs: samples_per_sec
|
||||
* baud
|
||||
* mark_freq
|
||||
* space_freq
|
||||
*
|
||||
* D - Pointer to demodulator state for given channel.
|
||||
*
|
||||
* Outputs: D->ms_filter_size
|
||||
* D->m_sin_table[]
|
||||
* D->m_cos_table[]
|
||||
* D->s_sin_table[]
|
||||
* D->s_cos_table[]
|
||||
*
|
||||
* Returns: None.
|
||||
*
|
||||
* Bugs: This doesn't do much error checking so don't give it
|
||||
* anything crazy.
|
||||
*
|
||||
*----------------------------------------------------------------*/
|
||||
|
||||
void demod_afsk_init (int samples_per_sec, int baud, int mark_freq,
|
||||
int space_freq, char profile, struct demodulator_state_s *D)
|
||||
{
|
||||
|
||||
int j;
|
||||
|
||||
memset (D, 0, sizeof(struct demodulator_state_s));
|
||||
|
||||
#if DEBUG1
|
||||
dw_printf ("demod_afsk_init (rate=%d, baud=%d, mark=%d, space=%d, profile=%c\n",
|
||||
samples_per_sec, baud, mark_freq, space_freq, profile);
|
||||
#endif
|
||||
|
||||
#ifdef TUNE_PROFILE
|
||||
profile = TUNE_PROFILE;
|
||||
#endif
|
||||
|
||||
if (toupper(profile) == 'F') {
|
||||
|
||||
if (baud != DEFAULT_BAUD ||
|
||||
mark_freq != DEFAULT_MARK_FREQ ||
|
||||
space_freq!= DEFAULT_SPACE_FREQ ||
|
||||
samples_per_sec != DEFAULT_SAMPLES_PER_SEC) {
|
||||
|
||||
text_color_set(DW_COLOR_INFO);
|
||||
dw_printf ("Note: Decoder 'F' works only for %d baud, %d/%d tones, %d samples/sec.\n",
|
||||
DEFAULT_BAUD, DEFAULT_MARK_FREQ, DEFAULT_SPACE_FREQ, DEFAULT_SAMPLES_PER_SEC);
|
||||
dw_printf ("Using Decoder 'A' instead.\n");
|
||||
profile = 'A';
|
||||
}
|
||||
}
|
||||
|
||||
if (profile == 'a' || profile == 'A' || profile == 'f' || profile == 'F') {
|
||||
|
||||
/* Original. 52 taps, truncated bandpass, IIR lowpass */
|
||||
/* 'F' is the fast version for low end processors. */
|
||||
/* It is a special case that works only for a particular */
|
||||
/* baud rate, tone pair, and sampling rate. */
|
||||
|
||||
D->filter_len_bits = 1.415; /* 52 @ 44100, 1200 */
|
||||
D->bp_window = BP_WINDOW_TRUNCATED;
|
||||
D->lpf_use_fir = 0;
|
||||
D->lpf_iir = 0.195;
|
||||
D->lpf_baud = 0;
|
||||
D->agc_fast_attack = 0.250;
|
||||
D->agc_slow_decay = 0.00012;
|
||||
D->hysteresis = 0.005;
|
||||
D->pll_locked_inertia = 0.700;
|
||||
D->pll_searching_inertia = 0.580;
|
||||
}
|
||||
else if (profile == 'b' || profile == 'B') {
|
||||
|
||||
/* Original bandpass. Use FIR lowpass instead. */
|
||||
|
||||
D->filter_len_bits = 1.415; /* 52 @ 44100, 1200 */
|
||||
D->bp_window = BP_WINDOW_TRUNCATED;
|
||||
D->lpf_use_fir = 1;
|
||||
D->lpf_iir = 0;
|
||||
D->lpf_baud = 1.09;
|
||||
D->agc_fast_attack = 0.370;
|
||||
D->agc_slow_decay = 0.00014;
|
||||
D->hysteresis = 0.003;
|
||||
D->pll_locked_inertia = 0.620;
|
||||
D->pll_searching_inertia = 0.350;
|
||||
}
|
||||
else if (profile == 'c' || profile == 'C') {
|
||||
|
||||
/* Cosine window, 76 taps for bandpass, FIR lowpass. */
|
||||
|
||||
D->filter_len_bits = 2.068; /* 76 @ 44100, 1200 */
|
||||
D->bp_window = BP_WINDOW_COSINE;
|
||||
D->lpf_use_fir = 1;
|
||||
D->lpf_iir = 0;
|
||||
D->lpf_baud = 1.09;
|
||||
D->agc_fast_attack = 0.495;
|
||||
D->agc_slow_decay = 0.00022;
|
||||
D->hysteresis = 0.005;
|
||||
D->pll_locked_inertia = 0.620;
|
||||
D->pll_searching_inertia = 0.350;
|
||||
}
|
||||
else if (profile == 'd' || profile == 'D') {
|
||||
|
||||
/* Prefilter, Cosine window, FIR lowpass. Tweeked for 300 baud. */
|
||||
|
||||
D->use_prefilter = 1; /* first, a bandpass filter. */
|
||||
D->prefilter_baud = 0.87; /* Cosine window. */
|
||||
D->filter_len_bits = 1.857; /* 91 @ 44100/3, 300 */
|
||||
D->bp_window = BP_WINDOW_COSINE;
|
||||
D->lpf_use_fir = 1;
|
||||
D->lpf_iir = 0;
|
||||
D->lpf_baud = 1.10;
|
||||
D->agc_fast_attack = 0.495;
|
||||
D->agc_slow_decay = 0.00022;
|
||||
D->hysteresis = 0.027;
|
||||
D->pll_locked_inertia = 0.620;
|
||||
D->pll_searching_inertia = 0.350;
|
||||
}
|
||||
else {
|
||||
text_color_set(DW_COLOR_ERROR);
|
||||
dw_printf ("Invalid filter profile = %c\n", profile);
|
||||
exit (1);
|
||||
}
|
||||
|
||||
|
||||
#if defined(TUNE_AGC_FAST) && defined(TUNE_AGC_SLOW)
|
||||
D->agc_fast_attack = TUNE_AGC_FAST;
|
||||
D->agc_slow_decay = TUNE_AGC_SLOW;
|
||||
#endif
|
||||
#ifdef TUNE_HYST
|
||||
D->hysteresis = TUNE_HYST;
|
||||
#endif
|
||||
#if defined(TUNE_PLL_LOCKED) && defined(TUNE_PLL_SEARCHING)
|
||||
D->pll_locked_inertia = TUNE_PLL_LOCKED;
|
||||
D->pll_searching_inertia = TUNE_PLL_SEARCHING;
|
||||
#endif
|
||||
#ifdef TUNE_LPF_BAUD
|
||||
D->lpf_baud = TUNE_LPF_BAUD;
|
||||
#endif
|
||||
#ifdef TUNE_PRE_BAUD
|
||||
D->prefilter_baud = TUNE_PRE_BAUD;
|
||||
#endif
|
||||
|
||||
/*
|
||||
* Calculate constants used for timing.
|
||||
* The audio sample rate must be at least a few times the data rate.
|
||||
*/
|
||||
|
||||
D->pll_step_per_sample = (int) round((TICKS_PER_PLL_CYCLE * (double)baud) / ((double)samples_per_sec));
|
||||
|
||||
|
||||
/*
|
||||
* My initial guess at length of filter was about one bit time.
|
||||
* By trial and error, the optimal value was found to somewhat longer.
|
||||
* This was optimized for 44,100 sample rate, 1200 baud, 1200/2200 Hz.
|
||||
* More experimentation is needed for other situations.
|
||||
*/
|
||||
|
||||
D->ms_filter_size = (int) round( D->filter_len_bits * (float)samples_per_sec / (float)baud );
|
||||
|
||||
/* Experiment with other sizes. */
|
||||
|
||||
#if defined(TUNE_MS_FILTER_SIZE)
|
||||
D->ms_filter_size = TUNE_MS_FILTER_SIZE;
|
||||
#endif
|
||||
D->lp_filter_size = D->ms_filter_size;
|
||||
|
||||
assert (D->ms_filter_size >= 4);
|
||||
|
||||
if (D->ms_filter_size > MAX_FILTER_SIZE)
|
||||
{
|
||||
text_color_set (DW_COLOR_ERROR);
|
||||
dw_printf ("Calculated filter size of %d is too large.\n", D->ms_filter_size);
|
||||
dw_printf ("Decrease the audio sample rate or increase the baud rate or\n");
|
||||
dw_printf ("recompile the application with MAX_FILTER_SIZE larger than %d.\n",
|
||||
MAX_FILTER_SIZE);
|
||||
exit (1);
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* For narrow AFSK (e.g. 200 Hz shift), it might be beneficial to
|
||||
* have a bandpass filter before the mark/space detector.
|
||||
* For now, make it the same number of taps for simplicity.
|
||||
*/
|
||||
|
||||
if (D->use_prefilter) {
|
||||
float f1, f2;
|
||||
|
||||
f1 = MIN(mark_freq,space_freq) - D->prefilter_baud * baud;
|
||||
f2 = MAX(mark_freq,space_freq) + D->prefilter_baud * baud;
|
||||
#if 0
|
||||
text_color_set(DW_COLOR_DEBUG);
|
||||
dw_printf ("Generating prefilter %.0f to %.0f Hz.\n", f1, f2);
|
||||
#endif
|
||||
f1 = f1 / (float)samples_per_sec;
|
||||
f2 = f2 / (float)samples_per_sec;
|
||||
|
||||
//gen_bandpass (f1, f2, D->pre_filter, D->ms_filter_size, BP_WINDOW_HAMMING);
|
||||
//gen_bandpass (f1, f2, D->pre_filter, D->ms_filter_size, BP_WINDOW_BLACKMAN);
|
||||
gen_bandpass (f1, f2, D->pre_filter, D->ms_filter_size, BP_WINDOW_COSINE);
|
||||
}
|
||||
|
||||
/*
|
||||
* Filters for detecting mark and space tones.
|
||||
*/
|
||||
#if DEBUG1
|
||||
text_color_set(DW_COLOR_DEBUG);
|
||||
dw_printf ("%s: \n", __FILE__);
|
||||
dw_printf ("%d baud, %d samples_per_sec\n", baud, samples_per_sec);
|
||||
dw_printf ("AFSK %d & %d Hz\n", mark_freq, space_freq);
|
||||
dw_printf ("spll_step_per_sample = %d = 0x%08x\n", D->pll_step_per_sample, D->pll_step_per_sample);
|
||||
dw_printf ("D->ms_filter_size = %d = 0x%08x\n", D->ms_filter_size, D->ms_filter_size);
|
||||
dw_printf ("\n");
|
||||
dw_printf ("Mark\n");
|
||||
dw_printf (" j shape M sin M cos \n");
|
||||
#endif
|
||||
|
||||
for (j=0; j<D->ms_filter_size; j++) {
|
||||
float am;
|
||||
float center;
|
||||
float shape = 1; /* Shape is an attempt to smooth out the */
|
||||
/* abrupt edges in hopes of reducing */
|
||||
/* overshoot and ringing. */
|
||||
/* My first thought was to use a cosine shape. */
|
||||
/* Should investigate Hamming and Blackman */
|
||||
/* windows mentioned in the literature. */
|
||||
/* http://en.wikipedia.org/wiki/Window_function */
|
||||
|
||||
center = 0.5 * (D->ms_filter_size - 1);
|
||||
am = ((float)(j - center) / (float)samples_per_sec) * ((float)mark_freq) * (2 * M_PI);
|
||||
|
||||
shape = window (D->bp_window, D->ms_filter_size, j);
|
||||
|
||||
D->m_sin_table[j] = sin(am) * shape;
|
||||
D->m_cos_table[j] = cos(am) * shape;
|
||||
|
||||
#if DEBUG1
|
||||
dw_printf ("%6d %6.2f %6.2f %6.2f\n", j, shape, D->m_sin_table[j], D->m_cos_table[j]) ;
|
||||
#endif
|
||||
}
|
||||
|
||||
|
||||
#if DEBUG1
|
||||
text_color_set(DW_COLOR_DEBUG);
|
||||
|
||||
dw_printf ("Space\n");
|
||||
dw_printf (" j shape S sin S cos\n");
|
||||
#endif
|
||||
for (j=0; j<D->ms_filter_size; j++) {
|
||||
float as;
|
||||
float center;
|
||||
float shape = 1;
|
||||
|
||||
center = 0.5 * (D->ms_filter_size - 1);
|
||||
as = ((float)(j - center) / (float)samples_per_sec) * ((float)space_freq) * (2 * M_PI);
|
||||
|
||||
shape = window (D->bp_window, D->ms_filter_size, j);
|
||||
|
||||
D->s_sin_table[j] = sin(as) * shape;
|
||||
D->s_cos_table[j] = cos(as) * shape;
|
||||
|
||||
#if DEBUG1
|
||||
dw_printf ("%6d %6.2f %6.2f %6.2f\n", j, shape, D->s_sin_table[j], D->s_cos_table[j] ) ;
|
||||
#endif
|
||||
}
|
||||
|
||||
|
||||
/* Do we want to normalize for unity gain? */
|
||||
|
||||
|
||||
/*
|
||||
* Now the lowpass filter.
|
||||
* I thought we'd want a cutoff of about 0.5 the baud rate
|
||||
* but it turns out about 1.1x is better. Still investigating...
|
||||
*/
|
||||
|
||||
if (D->lpf_use_fir) {
|
||||
float fc;
|
||||
fc = baud * D->lpf_baud / (float)samples_per_sec;
|
||||
gen_lowpass (fc, D->lp_filter, D->lp_filter_size, BP_WINDOW_TRUNCATED);
|
||||
}
|
||||
|
||||
/*
|
||||
* A non-whole number of cycles results in a DC bias.
|
||||
* Let's see if it helps to take it out.
|
||||
* Actually makes things worse: 20 fewer decoded.
|
||||
* Might want to try again after EXPERIMENTC.
|
||||
*/
|
||||
|
||||
#if 0
|
||||
#ifndef AVOID_FLOATING_POINT
|
||||
|
||||
failed experiment
|
||||
|
||||
dc_bias = 0;
|
||||
for (j=0; j<D->ms_filter_size; j++) {
|
||||
dc_bias += D->m_sin_table[j];
|
||||
}
|
||||
for (j=0; j<D->ms_filter_size; j++) {
|
||||
D->m_sin_table[j] -= dc_bias / D->ms_filter_size;
|
||||
}
|
||||
|
||||
dc_bias = 0;
|
||||
for (j=0; j<D->ms_filter_size; j++) {
|
||||
dc_bias += D->m_cos_table[j];
|
||||
}
|
||||
for (j=0; j<D->ms_filter_size; j++) {
|
||||
D->m_cos_table[j] -= dc_bias / D->ms_filter_size;
|
||||
}
|
||||
|
||||
|
||||
dc_bias = 0;
|
||||
for (j=0; j<D->ms_filter_size; j++) {
|
||||
dc_bias += D->s_sin_table[j];
|
||||
}
|
||||
for (j=0; j<D->ms_filter_size; j++) {
|
||||
D->s_sin_table[j] -= dc_bias / D->ms_filter_size;
|
||||
}
|
||||
|
||||
dc_bias = 0;
|
||||
for (j=0; j<D->ms_filter_size; j++) {
|
||||
dc_bias += D->s_cos_table[j];
|
||||
}
|
||||
for (j=0; j<D->ms_filter_size; j++) {
|
||||
D->s_cos_table[j] -= dc_bias / D->ms_filter_size;
|
||||
}
|
||||
|
||||
#endif
|
||||
#endif
|
||||
|
||||
} /* fsk_gen_filter */
|
||||
|
||||
|
||||
#if GEN_FFF
|
||||
|
||||
|
||||
|
||||
// Properties of the radio channels.
|
||||
|
||||
static struct audio_s modem;
|
||||
|
||||
|
||||
// Filters will be stored here.
|
||||
|
||||
static struct demodulator_state_s ds;
|
||||
|
||||
|
||||
#define SPARSE 3
|
||||
|
||||
|
||||
static void emit_macro (char *name, int size, float *coeff)
|
||||
{
|
||||
int i;
|
||||
|
||||
dw_printf ("#define %s(x) \\\n", name);
|
||||
|
||||
for (i=SPARSE/2; i<size; i+=SPARSE) {
|
||||
dw_printf ("\t%c (%.6f * x[%d]) \\\n", (i==0 ? ' ' : '+'), coeff[i], i);
|
||||
}
|
||||
dw_printf ("\n");
|
||||
}
|
||||
|
||||
int main ()
|
||||
{
|
||||
//int n;
|
||||
char fff_profile;
|
||||
|
||||
fff_profile = 'F';
|
||||
|
||||
memset (&modem, 0, sizeof(modem));
|
||||
memset (&ds, 0, sizeof(ds));
|
||||
|
||||
modem.num_channels = 1;
|
||||
modem.samples_per_sec = DEFAULT_SAMPLES_PER_SEC;
|
||||
modem.mark_freq[0] = DEFAULT_MARK_FREQ;
|
||||
modem.space_freq[0] = DEFAULT_SPACE_FREQ;
|
||||
modem.baud[0] = DEFAULT_BAUD;
|
||||
modem.num_subchan[0] = 1;
|
||||
|
||||
|
||||
demod_afsk_init (modem.samples_per_sec, modem.baud[0],
|
||||
modem.mark_freq[0], modem.space_freq[0], fff_profile, &ds);
|
||||
|
||||
printf ("/* This is an automatically generated file. Do not edit. */\n");
|
||||
printf ("\n");
|
||||
printf ("#define FFF_SAMPLES_PER_SEC %d\n", modem.samples_per_sec);
|
||||
printf ("#define FFF_BAUD %d\n", modem.baud[0]);
|
||||
printf ("#define FFF_MARK_FREQ %d\n", modem.mark_freq[0]);
|
||||
printf ("#define FFF_SPACE_FREQ %d\n", modem.space_freq[0]);
|
||||
printf ("#define FFF_PROFILE '%c'\n", fff_profile);
|
||||
printf ("\n");
|
||||
|
||||
emit_macro ("CALC_M_SUM1", ds.ms_filter_size, ds.m_sin_table);
|
||||
emit_macro ("CALC_M_SUM2", ds.ms_filter_size, ds.m_cos_table);
|
||||
emit_macro ("CALC_S_SUM1", ds.ms_filter_size, ds.s_sin_table);
|
||||
emit_macro ("CALC_S_SUM2", ds.ms_filter_size, ds.s_cos_table);
|
||||
|
||||
exit(0);
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
|
||||
|
||||
#ifndef GEN_FFF
|
||||
|
||||
/* Optimization for slow processors. */
|
||||
|
||||
#include "fsk_fast_filter.h"
|
||||
|
||||
|
||||
|
||||
/*-------------------------------------------------------------------
|
||||
*
|
||||
* Name: demod_afsk_process_sample
|
||||
*
|
||||
* Purpose: (1) Demodulate the AFSK signal.
|
||||
* (2) Recover clock and data.
|
||||
*
|
||||
* Inputs: chan - Audio channel. 0 for left, 1 for right.
|
||||
* subchan - modem of the channel.
|
||||
* sam - One sample of audio.
|
||||
* Should be in range of -32768 .. 32767.
|
||||
*
|
||||
* Returns: None
|
||||
*
|
||||
* Descripion: We start off with two bandpass filters tuned to
|
||||
* the given frequencies. In the case of VHF packet
|
||||
* radio, this would be 1200 and 2200 Hz.
|
||||
*
|
||||
* The bandpass filter amplitudes are compared to
|
||||
* obtain the demodulated signal.
|
||||
*
|
||||
* We also have a digital phase locked loop (PLL)
|
||||
* to recover the clock and pick out data bits at
|
||||
* the proper rate.
|
||||
*
|
||||
* For each recovered data bit, we call:
|
||||
*
|
||||
* hdlc_rec (channel, demodulated_bit);
|
||||
*
|
||||
* to decode HDLC frames from the stream of bits.
|
||||
*
|
||||
* Future: This could be generalized by passing in the name
|
||||
* of the function to be called for each bit recovered
|
||||
* from the demodulator. For now, it's simply hard-coded.
|
||||
*
|
||||
*--------------------------------------------------------------------*/
|
||||
|
||||
|
||||
__attribute__((hot))
|
||||
void demod_afsk_process_sample (int chan, int subchan, int sam, struct demodulator_state_s *D)
|
||||
{
|
||||
float fsam, abs_fsam;
|
||||
float m_sum1, m_sum2, s_sum1, s_sum2;
|
||||
float m_amp, s_amp;
|
||||
float m_norm, s_norm;
|
||||
float demod_out;
|
||||
#if DEBUG4
|
||||
static FILE *demod_log_fp = NULL;
|
||||
static int seq = 0; /* for log file name */
|
||||
#endif
|
||||
|
||||
int j;
|
||||
int demod_data;
|
||||
|
||||
assert (chan >= 0 && chan < MAX_CHANS);
|
||||
assert (subchan >= 0 && subchan < MAX_SUBCHANS);
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
/*
|
||||
* Filters use last 'filter_size' samples.
|
||||
*
|
||||
* First push the older samples down.
|
||||
*
|
||||
* Finally, put the most recent at the beginning.
|
||||
*
|
||||
* Future project? Can we do better than shifting each time?
|
||||
*/
|
||||
|
||||
/* Scale to nice number, TODO: range -1.0 to +1.0, not 2. */
|
||||
|
||||
fsam = sam / 16384.0;
|
||||
|
||||
/*
|
||||
* Accumulate measure of the input signal level.
|
||||
*/
|
||||
abs_fsam = fsam >= 0 ? fsam : -fsam;
|
||||
|
||||
// TODO: move to common code
|
||||
|
||||
if (abs_fsam > D->lev_peak_acc) {
|
||||
D->lev_peak_acc = abs_fsam;
|
||||
}
|
||||
D->lev_sum_acc += abs_fsam;
|
||||
|
||||
D->lev_count++;
|
||||
if (D->lev_count >= D->lev_period) {
|
||||
D->lev_prev_peak = D->lev_last_peak;
|
||||
D->lev_last_peak = D->lev_peak_acc;
|
||||
D->lev_peak_acc = 0;
|
||||
|
||||
D->lev_prev_ave = D->lev_last_ave;
|
||||
D->lev_last_ave = D->lev_sum_acc / D->lev_count;
|
||||
D->lev_sum_acc = 0;
|
||||
|
||||
D->lev_count = 0;
|
||||
}
|
||||
|
||||
/*
|
||||
* Optional bandpass filter before the mark/space discriminator.
|
||||
*/
|
||||
|
||||
if (D->use_prefilter) {
|
||||
float cleaner;
|
||||
|
||||
push_sample (fsam, D->raw_cb, D->ms_filter_size);
|
||||
cleaner = convolve (D->raw_cb, D->pre_filter, D->ms_filter_size);
|
||||
push_sample (cleaner, D->ms_in_cb, D->ms_filter_size);
|
||||
}
|
||||
else {
|
||||
push_sample (fsam, D->ms_in_cb, D->ms_filter_size);
|
||||
}
|
||||
|
||||
/*
|
||||
* Next we have bandpass filters for the mark and space tones.
|
||||
*
|
||||
* This takes a lot of computation.
|
||||
* It's not a problem on a typical (Intel x86 based) PC.
|
||||
* Dire Wolf takes only about 2 or 3% of the CPU time.
|
||||
*
|
||||
* It might be too much for a little microcomputer to handle.
|
||||
*
|
||||
* Here we have an optimized case for the default values.
|
||||
*/
|
||||
|
||||
|
||||
|
||||
// TODO: How do we test for profile F here?
|
||||
|
||||
if (0) {
|
||||
//if (toupper(modem.profiles[chan][subchan]) == toupper(FFF_PROFILE)) {
|
||||
|
||||
/* ========== Faster for default values on slower processors. ========== */
|
||||
|
||||
m_sum1 = CALC_M_SUM1(D->ms_in_cb);
|
||||
m_sum2 = CALC_M_SUM2(D->ms_in_cb);
|
||||
m_amp = z(m_sum1,m_sum2);
|
||||
|
||||
s_sum1 = CALC_S_SUM1(D->ms_in_cb);
|
||||
s_sum2 = CALC_S_SUM2(D->ms_in_cb);
|
||||
s_amp = z(s_sum1,s_sum2);
|
||||
}
|
||||
else {
|
||||
|
||||
/* ========== General case to handle all situations. ========== */
|
||||
|
||||
/*
|
||||
* find amplitude of "Mark" tone.
|
||||
*/
|
||||
m_sum1 = convolve (D->ms_in_cb, D->m_sin_table, D->ms_filter_size);
|
||||
m_sum2 = convolve (D->ms_in_cb, D->m_cos_table, D->ms_filter_size);
|
||||
|
||||
m_amp = sqrtf(m_sum1 * m_sum1 + m_sum2 * m_sum2);
|
||||
|
||||
/*
|
||||
* Find amplitude of "Space" tone.
|
||||
*/
|
||||
s_sum1 = convolve (D->ms_in_cb, D->s_sin_table, D->ms_filter_size);
|
||||
s_sum2 = convolve (D->ms_in_cb, D->s_cos_table, D->ms_filter_size);
|
||||
|
||||
s_amp = sqrtf(s_sum1 * s_sum1 + s_sum2 * s_sum2);
|
||||
|
||||
/* ========== End of general case. ========== */
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* Apply some low pass filtering BEFORE the AGC to remove
|
||||
* overshoot, ringing, and other bad stuff.
|
||||
*
|
||||
* A simple IIR filter is faster but FIR produces better results.
|
||||
*
|
||||
* It is a balancing act between removing high frequency components
|
||||
* from the tone dectection while letting the data thru.
|
||||
*/
|
||||
|
||||
if (D->lpf_use_fir) {
|
||||
|
||||
push_sample (m_amp, D->m_amp_cb, D->lp_filter_size);
|
||||
m_amp = convolve (D->m_amp_cb, D->lp_filter, D->lp_filter_size);
|
||||
|
||||
push_sample (s_amp, D->s_amp_cb, D->lp_filter_size);
|
||||
s_amp = convolve (D->s_amp_cb, D->lp_filter, D->lp_filter_size);
|
||||
}
|
||||
else {
|
||||
|
||||
/* Original, but faster, IIR. */
|
||||
|
||||
m_amp = D->lpf_iir * m_amp + (1.0 - D->lpf_iir) * D->m_amp_prev;
|
||||
D->m_amp_prev = m_amp;
|
||||
|
||||
s_amp = D->lpf_iir * s_amp + (1.0 - D->lpf_iir) * D->s_amp_prev;
|
||||
D->s_amp_prev = s_amp;
|
||||
}
|
||||
|
||||
/*
|
||||
* Which tone is stronger?
|
||||
*
|
||||
* Under real conditions, we find that the higher tone has a
|
||||
* considerably smaller amplitude due to the passband characteristics
|
||||
* of the transmitter and receiver. To make matters worse, it
|
||||
* varies considerably from one station to another.
|
||||
*
|
||||
* The two filters have different amounts of DC bias.
|
||||
*
|
||||
* Try to compensate for this by normalizing them separately with automatic gain
|
||||
* control (AGC). This works by looking at the minimum and maximum outputs
|
||||
* for each filter and scaling the results to be roughly in the -0.5 to +0.5 range.
|
||||
*/
|
||||
|
||||
/* Fast attack and slow decay. */
|
||||
/* Numbers were obtained by trial and error from actual */
|
||||
/* recorded less-than-optimal signals. */
|
||||
|
||||
/* See agc.c and fsk_demod_agc.h for more information. */
|
||||
|
||||
m_norm = agc (m_amp, D->agc_fast_attack, D->agc_slow_decay, &(D->m_peak), &(D->m_valley));
|
||||
s_norm = agc (s_amp, D->agc_fast_attack, D->agc_slow_decay, &(D->s_peak), &(D->s_valley));
|
||||
|
||||
/* Demodulator output is difference between response from two filters. */
|
||||
/* AGC should generally keep this around -1 to +1 range. */
|
||||
|
||||
demod_out = m_norm - s_norm;
|
||||
|
||||
/* Try adding some Hysteresis. */
|
||||
/* (Not to be confused with Hysteria.) */
|
||||
|
||||
if (demod_out > D->hysteresis) {
|
||||
demod_data = 1;
|
||||
}
|
||||
else if (demod_out < (- (D->hysteresis))) {
|
||||
demod_data = 0;
|
||||
}
|
||||
else {
|
||||
demod_data = D->prev_demod_data;
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* Finally, a PLL is used to sample near the centers of the data bits.
|
||||
*
|
||||
* D->data_clock_pll is a SIGNED 32 bit variable.
|
||||
* When it overflows from a large positive value to a negative value, we
|
||||
* sample a data bit from the demodulated signal.
|
||||
*
|
||||
* Ideally, the the demodulated signal transitions should be near
|
||||
* zero we we sample mid way between the transitions.
|
||||
*
|
||||
* Nudge the PLL by removing some small fraction from the value of
|
||||
* data_clock_pll, pushing it closer to zero.
|
||||
*
|
||||
* This adjustment will never change the sign so it won't cause
|
||||
* any erratic data bit sampling.
|
||||
*
|
||||
* If we adjust it too quickly, the clock will have too much jitter.
|
||||
* If we adjust it too slowly, it will take too long to lock on to a new signal.
|
||||
*
|
||||
* Be a little more agressive about adjusting the PLL
|
||||
* phase when searching for a signal. Don't change it as much when
|
||||
* locked on to a signal.
|
||||
*
|
||||
* I don't think the optimal value will depend on the audio sample rate
|
||||
* because this happens for each transition from the demodulator.
|
||||
*/
|
||||
D->prev_d_c_pll = D->data_clock_pll;
|
||||
D->data_clock_pll += D->pll_step_per_sample;
|
||||
|
||||
//text_color_set(DW_COLOR_DEBUG);
|
||||
// dw_printf ("prev = %lx, new data clock pll = %lx\n" D->prev_d_c_pll, D->data_clock_pll);
|
||||
|
||||
if (D->data_clock_pll < 0 && D->prev_d_c_pll > 0) {
|
||||
|
||||
/* Overflow. */
|
||||
#if SLICENDICE
|
||||
hdlc_rec_bit_sam (chan, subchan, demod_data, demod_out);
|
||||
#else
|
||||
hdlc_rec_bit (chan, subchan, demod_data, 0, -1);
|
||||
#endif
|
||||
}
|
||||
|
||||
if (demod_data != D->prev_demod_data) {
|
||||
|
||||
// Note: Test for this demodulator, not overall for channel.
|
||||
|
||||
if (hdlc_rec_data_detect_1 (chan, subchan)) {
|
||||
D->data_clock_pll = (int)(D->data_clock_pll * D->pll_locked_inertia);
|
||||
}
|
||||
else {
|
||||
D->data_clock_pll = (int)(D->data_clock_pll * D->pll_searching_inertia);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
#if DEBUG4
|
||||
|
||||
if (chan == 0) {
|
||||
if (hdlc_rec_data_detect_1 (chan, subchan)) {
|
||||
char fname[30];
|
||||
|
||||
|
||||
if (demod_log_fp == NULL) {
|
||||
seq++;
|
||||
sprintf (fname, "demod/%04d.csv", seq);
|
||||
if (seq == 1) mkdir ("demod", 0777);
|
||||
|
||||
demod_log_fp = fopen (fname, "w");
|
||||
text_color_set(DW_COLOR_DEBUG);
|
||||
dw_printf ("Starting demodulator log file %s\n", fname);
|
||||
fprintf (demod_log_fp, "Audio, Mark, Space, Demod, Data, Clock\n");
|
||||
}
|
||||
fprintf (demod_log_fp, "%.3f, %.3f, %.3f, %.3f, %.2f, %.2f\n", fsam + 3.5, m_norm + 2, s_norm + 2,
|
||||
(m_norm - s_norm) / 2 + 1.5,
|
||||
demod_data ? .9 : .55,
|
||||
(D->data_clock_pll & 0x80000000) ? .1 : .45);
|
||||
}
|
||||
else {
|
||||
if (demod_log_fp != NULL) {
|
||||
fclose (demod_log_fp);
|
||||
demod_log_fp = NULL;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
|
||||
/*
|
||||
* Remember demodulator output so we can compare next time.
|
||||
*/
|
||||
D->prev_demod_data = demod_data;
|
||||
|
||||
|
||||
} /* end demod_afsk_process_sample */
|
||||
|
||||
#endif /* GEN_FFF */
|
||||
|
||||
|
||||
#if 0
|
||||
|
||||
/*-------------------------------------------------------------------
|
||||
*
|
||||
* Name: fsk_demod_print_agc
|
||||
*
|
||||
* Purpose: Print information about input signal amplitude.
|
||||
* This will be useful for adjusting transmitter audio levels.
|
||||
* We also want to avoid having an input level so high
|
||||
* that the A/D converter "clips" the signal.
|
||||
*
|
||||
*
|
||||
* Inputs: chan - Audio channel. 0 for left, 1 for right.
|
||||
*
|
||||
* Returns: None
|
||||
*
|
||||
* Descripion: Not sure what to use for final form.
|
||||
* For now display the AGC peaks for both tones.
|
||||
* This will be called at the end of a frame.
|
||||
*
|
||||
* Future: Come up with a sensible scale and add command line option.
|
||||
* Probably makes more sense to return a single number
|
||||
* and let the caller print it.
|
||||
* Just an experiment for now.
|
||||
*
|
||||
*--------------------------------------------------------------------*/
|
||||
|
||||
#if 0
|
||||
void fsk_demod_print_agc (int chan, int subchan)
|
||||
{
|
||||
|
||||
struct demodulator_state_s *D;
|
||||
|
||||
|
||||
assert (chan >= 0 && chan < MAX_CHANS);
|
||||
assert (subchan >= 0 && subchan < MAX_SUBCHANS);
|
||||
|
||||
D = &demodulator_state[chan][subchan];
|
||||
|
||||
dw_printf ("%d\n", (int)((D->lev_last_peak + D->lev_prev_peak)*50));
|
||||
|
||||
|
||||
|
||||
//dw_printf ("Peak= %.2f, %.2f Ave= %.2f, %.2f AGC M= %.2f / %.2f S= %.2f / %.2f\n",
|
||||
// D->lev_last_peak, D->lev_prev_peak, D->lev_last_ave, D->lev_prev_ave,
|
||||
// D->m_peak, D->m_valley, D->s_peak, D->s_valley);
|
||||
|
||||
}
|
||||
#endif
|
||||
|
||||
/* Resulting scale is 0 to almost 100. */
|
||||
/* Cranking up the input level produces no more than 97 or 98. */
|
||||
/* We currently produce a message when this goes over 90. */
|
||||
|
||||
int fsk_demod_get_audio_level (int chan, int subchan)
|
||||
{
|
||||
struct demodulator_state_s *D;
|
||||
|
||||
|
||||
assert (chan >= 0 && chan < MAX_CHANS);
|
||||
assert (subchan >= 0 && subchan < MAX_SUBCHANS);
|
||||
|
||||
D = &demodulator_state[chan][subchan];
|
||||
|
||||
return ( (int) ((D->lev_last_peak + D->lev_prev_peak) * 50 ) );
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
#endif /* 0 */
|
||||
|
||||
/* end demod_afsk.c */
|
Binary file not shown.
After Width: | Height: | Size: 31 KiB |
885
direwolf.c
885
direwolf.c
|
@ -1,885 +0,0 @@
|
|||
//
|
||||
// This file is part of Dire Wolf, an amateur radio packet TNC.
|
||||
//
|
||||
// Copyright (C) 2011, 2012, 2013 John Langner, WB2OSZ
|
||||
//
|
||||
// This program is free software: you can redistribute it and/or modify
|
||||
// it under the terms of the GNU General Public License as published by
|
||||
// the Free Software Foundation, either version 2 of the License, or
|
||||
// (at your option) any later version.
|
||||
//
|
||||
// This program is distributed in the hope that it will be useful,
|
||||
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
// GNU General Public License for more details.
|
||||
//
|
||||
// You should have received a copy of the GNU General Public License
|
||||
// along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
//
|
||||
|
||||
|
||||
/*------------------------------------------------------------------
|
||||
*
|
||||
* Module: direwolf.c
|
||||
*
|
||||
* Purpose: Main program for "Dire Wolf" which includes:
|
||||
*
|
||||
* AFSK modem using the "sound card."
|
||||
* AX.25 encoder/decoder.
|
||||
* APRS data encoder / decoder.
|
||||
* APRS digipeater.
|
||||
* KISS TNC emulator.
|
||||
* APRStt (touch tone input) gateway
|
||||
* Internet Gateway (IGate)
|
||||
*
|
||||
*
|
||||
*---------------------------------------------------------------*/
|
||||
|
||||
#include <stdio.h>
|
||||
#include <math.h>
|
||||
#include <stdlib.h>
|
||||
#include <getopt.h>
|
||||
#include <assert.h>
|
||||
#include <string.h>
|
||||
#include <signal.h>
|
||||
|
||||
#if __WIN32__
|
||||
#else
|
||||
#include <unistd.h>
|
||||
#include <fcntl.h>
|
||||
#include <sys/types.h>
|
||||
#include <sys/ioctl.h>
|
||||
#include <sys/soundcard.h>
|
||||
#include <sys/socket.h>
|
||||
#include <netinet/in.h>
|
||||
#include <netdb.h>
|
||||
#endif
|
||||
|
||||
|
||||
#define DIREWOLF_C 1
|
||||
|
||||
#include "direwolf.h"
|
||||
#include "version.h"
|
||||
#include "audio.h"
|
||||
#include "config.h"
|
||||
#include "multi_modem.h"
|
||||
#include "demod.h"
|
||||
#include "hdlc_rec.h"
|
||||
#include "hdlc_rec2.h"
|
||||
#include "ax25_pad.h"
|
||||
#include "decode_aprs.h"
|
||||
#include "textcolor.h"
|
||||
#include "server.h"
|
||||
#include "kiss.h"
|
||||
#include "kissnet.h"
|
||||
#include "gen_tone.h"
|
||||
#include "digipeater.h"
|
||||
#include "tq.h"
|
||||
#include "xmit.h"
|
||||
#include "ptt.h"
|
||||
#include "beacon.h"
|
||||
#include "ax25_pad.h"
|
||||
#include "redecode.h"
|
||||
#include "dtmf.h"
|
||||
#include "aprs_tt.h"
|
||||
#include "tt_user.h"
|
||||
#include "igate.h"
|
||||
#include "symbols.h"
|
||||
#include "dwgps.h"
|
||||
|
||||
|
||||
#if __WIN32__
|
||||
static BOOL cleanup_win (int);
|
||||
#else
|
||||
static void cleanup_linux (int);
|
||||
#endif
|
||||
|
||||
static void usage (char **argv);
|
||||
|
||||
#if __SSE__
|
||||
|
||||
static void __cpuid(int cpuinfo[4], int infotype){
|
||||
__asm__ __volatile__ (
|
||||
"cpuid":
|
||||
"=a" (cpuinfo[0]),
|
||||
"=b" (cpuinfo[1]),
|
||||
"=c" (cpuinfo[2]),
|
||||
"=d" (cpuinfo[3]) :
|
||||
"a" (infotype)
|
||||
);
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
|
||||
/*-------------------------------------------------------------------
|
||||
*
|
||||
* Name: main
|
||||
*
|
||||
* Purpose: Main program for packet radio virtual TNC.
|
||||
*
|
||||
* Inputs: Command line arguments.
|
||||
* See usage message for details.
|
||||
*
|
||||
* Outputs: Decoded information is written to stdout.
|
||||
*
|
||||
* A socket and pseudo terminal are created for
|
||||
* for communication with other applications.
|
||||
*
|
||||
*--------------------------------------------------------------------*/
|
||||
|
||||
static struct audio_s modem;
|
||||
|
||||
static int d_u_opt = 0; /* "-d u" command line option. */
|
||||
|
||||
|
||||
|
||||
int main (int argc, char *argv[])
|
||||
{
|
||||
int err;
|
||||
int eof;
|
||||
int j;
|
||||
char config_file[100];
|
||||
int xmit_calibrate_option = 0;
|
||||
int enable_pseudo_terminal = 0;
|
||||
struct digi_config_s digi_config;
|
||||
struct tt_config_s tt_config;
|
||||
struct igate_config_s igate_config;
|
||||
struct misc_config_s misc_config;
|
||||
int r_opt = 0, n_opt = 0, b_opt = 0, B_opt = 0, D_opt = 0; /* Command line options. */
|
||||
char input_file[80];
|
||||
|
||||
int t_opt = 1; /* Text color option. */
|
||||
|
||||
|
||||
#if __WIN32__
|
||||
|
||||
// Select UTF-8 code page for console output.
|
||||
// http://msdn.microsoft.com/en-us/library/windows/desktop/ms686036(v=vs.85).aspx
|
||||
// This is the default I see for windows terminal:
|
||||
// >chcp
|
||||
// Active code page: 437
|
||||
|
||||
//Restore on exit? oldcp = GetConsoleOutputCP();
|
||||
SetConsoleOutputCP(CP_UTF8);
|
||||
|
||||
#elif __CYGWIN__
|
||||
|
||||
/*
|
||||
* Without this, the ISO Latin 1 characters are displayed as gray boxes.
|
||||
*/
|
||||
//setenv ("LANG", "C.ISO-8859-1", 1);
|
||||
#else
|
||||
|
||||
/*
|
||||
* Default on Raspian & Ubuntu Linux is fine. Don't know about others.
|
||||
*
|
||||
* Should we look at LANG environment variable and issue a warning
|
||||
* if it doesn't look something like en_US.UTF-8 ?
|
||||
*/
|
||||
|
||||
#endif
|
||||
|
||||
/*
|
||||
* Pre-scan the command line options for the text color option.
|
||||
* We need to set this before any text output.
|
||||
*/
|
||||
|
||||
t_opt = 1; /* 1 = normal, 0 = no text colors. */
|
||||
for (j=1; j<argc-1; j++) {
|
||||
if (strcmp(argv[j], "-t") == 0) {
|
||||
t_opt = atoi (argv[j+1]);
|
||||
//dw_printf ("DEBUG: text color option = %d.\n", t_opt);
|
||||
}
|
||||
}
|
||||
|
||||
text_color_init(t_opt);
|
||||
text_color_set(DW_COLOR_INFO);
|
||||
//dw_printf ("Dire Wolf version %d.%d (%s) Beta Test 2\n", MAJOR_VERSION, MINOR_VERSION, __DATE__);
|
||||
//dw_printf ("Dire Wolf version %d.%d (%s) Development version\n", MAJOR_VERSION, MINOR_VERSION, __DATE__);
|
||||
|
||||
// Note "a" for fix with beacon sent to IGate Server.
|
||||
|
||||
dw_printf ("Dire Wolf version %d.%da\n", MAJOR_VERSION, MINOR_VERSION);
|
||||
|
||||
|
||||
#if __WIN32__
|
||||
SetConsoleCtrlHandler (cleanup_win, TRUE);
|
||||
#else
|
||||
setlinebuf (stdout);
|
||||
signal (SIGINT, cleanup_linux);
|
||||
#endif
|
||||
|
||||
|
||||
/*
|
||||
* Starting with version 0.9, the prebuilt Windows version
|
||||
* requires a minimum of a Pentium 3 or equivalent so we can
|
||||
* use the SSE instructions.
|
||||
* Try to warn anyone using a CPU from the previous
|
||||
* century rather than just dying for no apparent reason.
|
||||
*
|
||||
* Now, where can I find a Pentium 2 or earlier to test this?
|
||||
*/
|
||||
|
||||
#if __SSE__
|
||||
int cpuinfo[4];
|
||||
__cpuid (cpuinfo, 0);
|
||||
if (cpuinfo[0] >= 1) {
|
||||
__cpuid (cpuinfo, 1);
|
||||
//dw_printf ("debug: cpuinfo = %x, %x, %x, %x\n", cpuinfo[0], cpuinfo[1], cpuinfo[2], cpuinfo[3]);
|
||||
if ( ! ( cpuinfo[3] & (1 << 25))) {
|
||||
text_color_set(DW_COLOR_ERROR);
|
||||
dw_printf ("------------------------------------------------------------------\n");
|
||||
dw_printf ("This version requires a minimum of a Pentium 3 or equivalent.\n");
|
||||
dw_printf ("If you are seeing this message, you are probably using a computer\n");
|
||||
dw_printf ("from the previous century. See comments in Makefile.win for\n");
|
||||
dw_printf ("information on how you can recompile it for use with your antique.\n");
|
||||
dw_printf ("------------------------------------------------------------------\n");
|
||||
}
|
||||
}
|
||||
text_color_set(DW_COLOR_INFO);
|
||||
#endif
|
||||
|
||||
/*
|
||||
* This has not been very well tested in 64 bit mode.
|
||||
*/
|
||||
|
||||
#if 0
|
||||
if (sizeof(int) != 4 || sizeof(long) != 4 || sizeof(char *) != 4) {
|
||||
text_color_set(DW_COLOR_ERROR);
|
||||
dw_printf ("------------------------------------------------------------------\n");
|
||||
dw_printf ("This might not work properly when compiled for a 64 bit target.\n");
|
||||
dw_printf ("It is recommended that you rebuild it with gcc -m32 option.\n");
|
||||
dw_printf ("------------------------------------------------------------------\n");
|
||||
}
|
||||
#endif
|
||||
|
||||
/*
|
||||
* Default location of configuration file is current directory.
|
||||
* Can be overridden by -c command line option.
|
||||
* TODO: Automatically search other places.
|
||||
*/
|
||||
|
||||
strcpy (config_file, "direwolf.conf");
|
||||
|
||||
/*
|
||||
* Look at command line options.
|
||||
* So far, the only one is the configuration file location.
|
||||
*/
|
||||
|
||||
strcpy (input_file, "");
|
||||
while (1) {
|
||||
int this_option_optind = optind ? optind : 1;
|
||||
int option_index = 0;
|
||||
int c;
|
||||
static struct option long_options[] = {
|
||||
{"future1", 1, 0, 0},
|
||||
{"future2", 0, 0, 0},
|
||||
{"future3", 1, 0, 'c'},
|
||||
{0, 0, 0, 0}
|
||||
};
|
||||
|
||||
/* ':' following option character means arg is required. */
|
||||
|
||||
c = getopt_long(argc, argv, "B:D:c:pxr:b:n:d:t:U",
|
||||
long_options, &option_index);
|
||||
if (c == -1)
|
||||
break;
|
||||
|
||||
switch (c) {
|
||||
|
||||
case 0: /* possible future use */
|
||||
text_color_set(DW_COLOR_DEBUG);
|
||||
dw_printf("option %s", long_options[option_index].name);
|
||||
if (optarg) {
|
||||
dw_printf(" with arg %s", optarg);
|
||||
}
|
||||
dw_printf("\n");
|
||||
break;
|
||||
|
||||
|
||||
case 'c': /* -c for configuration file name */
|
||||
|
||||
strcpy (config_file, optarg);
|
||||
break;
|
||||
|
||||
#if __WIN32__
|
||||
#else
|
||||
case 'p': /* -p enable pseudo terminal */
|
||||
|
||||
/* We want this to be off by default because it hangs */
|
||||
/* eventually when nothing is reading from other side. */
|
||||
|
||||
enable_pseudo_terminal = 1;
|
||||
break;
|
||||
#endif
|
||||
|
||||
case 'B': /* -B baud rate and modem properties. */
|
||||
|
||||
B_opt = atoi(optarg);
|
||||
if (B_opt < 100 || B_opt > 10000) {
|
||||
text_color_set(DW_COLOR_ERROR);
|
||||
dw_printf ("Use a more reasonable data baud rate in range of 100 - 10000.\n");
|
||||
exit (EXIT_FAILURE);
|
||||
}
|
||||
break;
|
||||
|
||||
case 'D': /* -D decrease AFSK demodulator sample rate */
|
||||
|
||||
D_opt = atoi(optarg);
|
||||
if (D_opt < 1 || D_opt > 8) {
|
||||
text_color_set(DW_COLOR_ERROR);
|
||||
dw_printf ("Crazy value of -D. \n");
|
||||
exit (EXIT_FAILURE);
|
||||
}
|
||||
break;
|
||||
|
||||
case 'x': /* -x for transmit calibration tones. */
|
||||
|
||||
xmit_calibrate_option = 1;
|
||||
break;
|
||||
|
||||
case 'r': /* -r audio samples/sec. e.g. 44100 */
|
||||
|
||||
r_opt = atoi(optarg);
|
||||
if (r_opt < MIN_SAMPLES_PER_SEC || r_opt > MAX_SAMPLES_PER_SEC)
|
||||
{
|
||||
text_color_set(DW_COLOR_ERROR);
|
||||
dw_printf("-r option, audio samples/sec, is out of range.\n");
|
||||
r_opt = 0;
|
||||
}
|
||||
break;
|
||||
|
||||
case 'n': /* -n number of audio channels. 1 or 2. */
|
||||
|
||||
n_opt = atoi(optarg);
|
||||
if (n_opt < 1 || n_opt > MAX_CHANS)
|
||||
{
|
||||
text_color_set(DW_COLOR_ERROR);
|
||||
dw_printf("-n option, number of audio channels, is out of range.\n");
|
||||
n_opt = 0;
|
||||
}
|
||||
break;
|
||||
|
||||
case 'b': /* -b bits per sample. 8 or 16. */
|
||||
|
||||
b_opt = atoi(optarg);
|
||||
if (b_opt != 8 && b_opt != 16)
|
||||
{
|
||||
text_color_set(DW_COLOR_ERROR);
|
||||
dw_printf("-b option, bits per sample, must be 8 or 16.\n");
|
||||
b_opt = 0;
|
||||
}
|
||||
break;
|
||||
|
||||
case '?':
|
||||
|
||||
/* Unknown option message was already printed. */
|
||||
usage (argv);
|
||||
break;
|
||||
|
||||
case 'd': /* Set debug option. */
|
||||
|
||||
switch (optarg[0]) {
|
||||
case 'a': server_set_debug(1); break;
|
||||
case 'k': kiss_serial_set_debug (1); break;
|
||||
case 'n': kiss_net_set_debug (1); break;
|
||||
case 'u': d_u_opt = 1; break;
|
||||
default: break;
|
||||
}
|
||||
break;
|
||||
|
||||
case 't': /* Was handled earlier. */
|
||||
break;
|
||||
|
||||
|
||||
case 'U': /* Print UTF-8 test and exit. */
|
||||
|
||||
dw_printf ("\n UTF-8 test string: ma%c%cana %c%c F%c%c%c%ce\n\n",
|
||||
0xc3, 0xb1,
|
||||
0xc2, 0xb0,
|
||||
0xc3, 0xbc, 0xc3, 0x9f);
|
||||
|
||||
exit (0);
|
||||
break;
|
||||
|
||||
|
||||
default:
|
||||
|
||||
/* Should not be here. */
|
||||
text_color_set(DW_COLOR_DEBUG);
|
||||
dw_printf("?? getopt returned character code 0%o ??\n", c);
|
||||
usage (argv);
|
||||
}
|
||||
} /* end while(1) for options */
|
||||
|
||||
if (optind < argc)
|
||||
{
|
||||
|
||||
if (optind < argc - 1)
|
||||
{
|
||||
text_color_set(DW_COLOR_ERROR);
|
||||
dw_printf ("Warning: File(s) beyond the first are ignored.\n");
|
||||
}
|
||||
|
||||
strcpy (input_file, argv[optind]);
|
||||
|
||||
}
|
||||
|
||||
/*
|
||||
* Get all types of configuration settings from configuration file.
|
||||
*
|
||||
* Possibly override some by command line options.
|
||||
*/
|
||||
|
||||
symbols_init ();
|
||||
|
||||
config_init (config_file, &modem, &digi_config, &tt_config, &igate_config, &misc_config);
|
||||
|
||||
if (r_opt != 0) {
|
||||
modem.samples_per_sec = r_opt;
|
||||
}
|
||||
if (n_opt != 0) {
|
||||
modem.num_channels = n_opt;
|
||||
}
|
||||
if (b_opt != 0) {
|
||||
modem.bits_per_sample = b_opt;
|
||||
}
|
||||
if (B_opt != 0) {
|
||||
modem.baud[0] = B_opt;
|
||||
|
||||
if (modem.baud[0] < 600) {
|
||||
modem.modem_type[0] = AFSK;
|
||||
modem.mark_freq[0] = 1600;
|
||||
modem.space_freq[0] = 1800;
|
||||
modem.decimate[0] = 3;
|
||||
}
|
||||
else if (modem.baud[0] > 2400) {
|
||||
modem.modem_type[0] = SCRAMBLE;
|
||||
modem.mark_freq[0] = 0;
|
||||
modem.space_freq[0] = 0;
|
||||
}
|
||||
else {
|
||||
modem.modem_type[0] = AFSK;
|
||||
modem.mark_freq[0] = 1200;
|
||||
modem.space_freq[0] = 2200;
|
||||
}
|
||||
}
|
||||
|
||||
if (D_opt != 0) {
|
||||
// Don't document. This will change.
|
||||
modem.decimate[0] = D_opt;
|
||||
}
|
||||
|
||||
misc_config.enable_kiss_pt = enable_pseudo_terminal;
|
||||
|
||||
if (strlen(input_file) > 0) {
|
||||
strcpy (modem.adevice_in, input_file);
|
||||
}
|
||||
|
||||
/*
|
||||
* Open the audio source
|
||||
* - soundcard
|
||||
* - stdin
|
||||
* - UDP
|
||||
* Files not supported at this time.
|
||||
* Can always "cat" the file and pipe it into stdin.
|
||||
*/
|
||||
|
||||
err = audio_open (&modem);
|
||||
if (err < 0) {
|
||||
text_color_set(DW_COLOR_ERROR);
|
||||
dw_printf ("Pointless to continue without audio device.\n");
|
||||
SLEEP_SEC(5);
|
||||
exit (1);
|
||||
}
|
||||
|
||||
/*
|
||||
* Initialize the AFSK demodulator and HDLC decoder.
|
||||
*/
|
||||
multi_modem_init (&modem);
|
||||
|
||||
/*
|
||||
* Initialize the touch tone decoder & APRStt gateway.
|
||||
*/
|
||||
dtmf_init (modem.samples_per_sec);
|
||||
aprs_tt_init (&tt_config);
|
||||
tt_user_init (&tt_config);
|
||||
|
||||
/*
|
||||
* Should there be an option for audio output level?
|
||||
* Note: This is not the same as a volume control you would see on the screen.
|
||||
* It is the range of the digital sound representation.
|
||||
*/
|
||||
gen_tone_init (&modem, 100);
|
||||
|
||||
assert (modem.bits_per_sample == 8 || modem.bits_per_sample == 16);
|
||||
assert (modem.num_channels == 1 || modem.num_channels == 2);
|
||||
assert (modem.samples_per_sec >= MIN_SAMPLES_PER_SEC && modem.samples_per_sec <= MAX_SAMPLES_PER_SEC);
|
||||
|
||||
/*
|
||||
* Initialize the transmit queue.
|
||||
*/
|
||||
|
||||
xmit_init (&modem);
|
||||
|
||||
/*
|
||||
* If -x option specified, transmit alternating tones for transmitter
|
||||
* audio level adjustment, up to 1 minute then quit.
|
||||
* TODO: enhance for more than one channel.
|
||||
*/
|
||||
|
||||
if (xmit_calibrate_option) {
|
||||
|
||||
int max_duration = 60; /* seconds */
|
||||
int n = modem.baud[0] * max_duration;
|
||||
int chan = 0;
|
||||
|
||||
text_color_set(DW_COLOR_INFO);
|
||||
dw_printf ("\nSending transmit calibration tones. Press control-C to terminate.\n");
|
||||
|
||||
ptt_set (chan, 1);
|
||||
while (n-- > 0) {
|
||||
|
||||
tone_gen_put_bit (chan, n & 1);
|
||||
|
||||
}
|
||||
ptt_set (chan, 0);
|
||||
exit (0);
|
||||
}
|
||||
|
||||
/*
|
||||
* Initialize the digipeater and IGate functions.
|
||||
*/
|
||||
digipeater_init (&digi_config);
|
||||
igate_init (&igate_config, &digi_config);
|
||||
|
||||
/*
|
||||
* Provide the AGW & KISS socket interfaces for use by a client application.
|
||||
*/
|
||||
server_init (&misc_config);
|
||||
kissnet_init (&misc_config);
|
||||
|
||||
/*
|
||||
* Create a pseudo terminal and KISS TNC emulator.
|
||||
*/
|
||||
kiss_init (&misc_config);
|
||||
|
||||
/*
|
||||
* Create thread for trying to salvage frames with bad FCS.
|
||||
*/
|
||||
redecode_init ();
|
||||
|
||||
/*
|
||||
* Enable beaconing.
|
||||
*/
|
||||
beacon_init (&misc_config, &digi_config);
|
||||
|
||||
|
||||
/*
|
||||
* Get sound samples and decode them.
|
||||
* Use hot attribute for all functions called for every audio sample.
|
||||
* TODO: separate function with __attribute__((hot))
|
||||
*/
|
||||
eof = 0;
|
||||
while ( ! eof)
|
||||
{
|
||||
|
||||
int audio_sample;
|
||||
int c;
|
||||
char tt;
|
||||
|
||||
for (c=0; c<modem.num_channels; c++)
|
||||
{
|
||||
audio_sample = demod_get_sample ();
|
||||
|
||||
if (audio_sample >= 256 * 256)
|
||||
eof = 1;
|
||||
|
||||
multi_modem_process_sample(c,audio_sample);
|
||||
|
||||
|
||||
/* Previously, the DTMF decoder was always active. */
|
||||
/* It took very little CPU time and the thinking was that an */
|
||||
/* attached application might be interested in this even when */
|
||||
/* the APRStt gateway was not being used. */
|
||||
/* Unfortunately it resulted in too many false detections of */
|
||||
/* touch tones when hearing other types of digital communications */
|
||||
/* on HF. Starting in version 1.0, the DTMF decoder is active */
|
||||
/* only when the APRStt gateway is configured. */
|
||||
|
||||
if (tt_config.obj_xmit_header[0] != '\0') {
|
||||
tt = dtmf_sample (c, audio_sample/16384.);
|
||||
if (tt != ' ') {
|
||||
aprs_tt_button (c, tt);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/* When a complete frame is accumulated, */
|
||||
/* process_rec_frame, below, is called. */
|
||||
|
||||
}
|
||||
|
||||
exit (EXIT_SUCCESS);
|
||||
}
|
||||
|
||||
|
||||
/*-------------------------------------------------------------------
|
||||
*
|
||||
* Name: app_process_rec_frame
|
||||
*
|
||||
* Purpose: This is called when we receive a frame with a valid
|
||||
* FCS and acceptable size.
|
||||
*
|
||||
* Inputs: chan - Audio channel number, 0 or 1.
|
||||
* subchan - Which modem caught it.
|
||||
* Special case -1 for APRStt gateway.
|
||||
* pp - Packet handle.
|
||||
* alevel - Audio level, range of 0 - 100.
|
||||
* (Special case, use negative to skip
|
||||
* display of audio level line.
|
||||
* Use -2 to indicate DTMF message.)
|
||||
* retries - Level of bit correction used.
|
||||
* spectrum - Display of how well multiple decoders did.
|
||||
*
|
||||
*
|
||||
* Description: Print decoded packet.
|
||||
* Optionally send to another application.
|
||||
*
|
||||
*--------------------------------------------------------------------*/
|
||||
|
||||
|
||||
void app_process_rec_packet (int chan, int subchan, packet_t pp, int alevel, retry_t retries, char *spectrum)
|
||||
{
|
||||
|
||||
char stemp[500];
|
||||
unsigned char *pinfo;
|
||||
int info_len;
|
||||
char heard[AX25_MAX_ADDR_LEN];
|
||||
//int j;
|
||||
int h;
|
||||
|
||||
assert (chan >= 0 && chan < MAX_CHANS);
|
||||
assert (subchan >= -1 && subchan < MAX_SUBCHANS);
|
||||
|
||||
|
||||
ax25_format_addrs (pp, stemp);
|
||||
|
||||
info_len = ax25_get_info (pp, &pinfo);
|
||||
|
||||
/* Print so we can see what is going on. */
|
||||
|
||||
/* Display audio input level. */
|
||||
/* Who are we hearing? Original station or digipeater. */
|
||||
|
||||
if (ax25_get_num_addr(pp) == 0) {
|
||||
/* Not AX.25. No station to display below. */
|
||||
h = -1;
|
||||
strcpy (heard, "");
|
||||
}
|
||||
else {
|
||||
h = ax25_get_heard(pp);
|
||||
ax25_get_addr_with_ssid(pp, h, heard);
|
||||
}
|
||||
|
||||
if (alevel >= 0) {
|
||||
|
||||
text_color_set(DW_COLOR_DEBUG);
|
||||
dw_printf ("\n");
|
||||
|
||||
if (h != -1 && h != AX25_SOURCE) {
|
||||
dw_printf ("Digipeater ");
|
||||
}
|
||||
|
||||
/* As suggested by KJ4ERJ, if we are receiving from */
|
||||
/* WIDEn-0, it is quite likely (but not guaranteed), that */
|
||||
/* we are actually hearing the preceding station in the path. */
|
||||
|
||||
if (h >= AX25_REPEATER_2 &&
|
||||
strncmp(heard, "WIDE", 4) == 0 &&
|
||||
isdigit(heard[4]) &&
|
||||
heard[5] == '\0') {
|
||||
|
||||
char probably_really[AX25_MAX_ADDR_LEN];
|
||||
|
||||
ax25_get_addr_with_ssid(pp, h-1, probably_really);
|
||||
dw_printf ("%s (probably %s) audio level = %d [%s] %s\n", heard, probably_really, alevel, retry_text[(int)retries], spectrum);
|
||||
}
|
||||
else {
|
||||
dw_printf ("%s audio level = %d [%s] %s\n", heard, alevel, retry_text[(int)retries], spectrum);
|
||||
}
|
||||
|
||||
/* Cranking up the input currently produces */
|
||||
/* no more than 97. Issue a warning before we */
|
||||
/* reach this saturation point. */
|
||||
|
||||
if (alevel > 90) {
|
||||
text_color_set(DW_COLOR_ERROR);
|
||||
dw_printf ("Audio input level is too high. Reduce so most stations are around 50.\n");
|
||||
}
|
||||
}
|
||||
|
||||
// Display non-APRS packets in a different color.
|
||||
|
||||
// Display subchannel only when multiple modems configured for channel.
|
||||
|
||||
// -1 for APRStt DTMF decoder.
|
||||
|
||||
if (subchan == -1) {
|
||||
text_color_set(DW_COLOR_REC);
|
||||
dw_printf ("[%d.dtmf] ", chan);
|
||||
}
|
||||
else {
|
||||
if (ax25_is_aprs(pp)) {
|
||||
text_color_set(DW_COLOR_REC);
|
||||
}
|
||||
else {
|
||||
text_color_set(DW_COLOR_DEBUG);
|
||||
}
|
||||
if (modem.num_subchan[chan] > 1) {
|
||||
dw_printf ("[%d.%d] ", chan, subchan);
|
||||
}
|
||||
else {
|
||||
dw_printf ("[%d] ", chan);
|
||||
}
|
||||
}
|
||||
|
||||
dw_printf ("%s", stemp); /* stations followed by : */
|
||||
ax25_safe_print ((char *)pinfo, info_len, 0);
|
||||
dw_printf ("\n");
|
||||
|
||||
// Display in pure ASCII if non-ASCII characters and "-d u" option specified.
|
||||
|
||||
if (d_u_opt) {
|
||||
|
||||
unsigned char *p;
|
||||
int n = 0;
|
||||
|
||||
for (p = pinfo; *p != '\0'; p++) {
|
||||
if (*p >= 0x80) n++;
|
||||
}
|
||||
|
||||
if (n > 0) {
|
||||
text_color_set(DW_COLOR_DEBUG);
|
||||
ax25_safe_print ((char *)pinfo, info_len, 1);
|
||||
dw_printf ("\n");
|
||||
}
|
||||
}
|
||||
|
||||
/* Decode the contents of APRS frames and display in human-readable form. */
|
||||
|
||||
if (ax25_is_aprs(pp)) {
|
||||
decode_aprs (pp);
|
||||
}
|
||||
|
||||
/* Send to another application if connected. */
|
||||
|
||||
int flen;
|
||||
unsigned char fbuf[AX25_MAX_PACKET_LEN];
|
||||
|
||||
flen = ax25_pack(pp, fbuf);
|
||||
|
||||
server_send_rec_packet (chan, pp, fbuf, flen);
|
||||
kissnet_send_rec_packet (chan, fbuf, flen);
|
||||
kiss_send_rec_packet (chan, fbuf, flen);
|
||||
|
||||
/* Send to Internet server if option is enabled. */
|
||||
/* Consider only those with correct CRC. */
|
||||
|
||||
if (ax25_is_aprs(pp) && retries == RETRY_NONE) {
|
||||
igate_send_rec_packet (chan, pp);
|
||||
}
|
||||
|
||||
/* Note that packet can be modified in place so this is the last thing we should do with it. */
|
||||
/* Again, use only those with correct CRC. */
|
||||
/* We don't want to spread corrupted data! */
|
||||
/* Single bit change appears to be safe from observations so far but be cautious. */
|
||||
|
||||
if (ax25_is_aprs(pp) && retries == RETRY_NONE) {
|
||||
digipeater (chan, pp);
|
||||
}
|
||||
|
||||
ax25_delete (pp);
|
||||
|
||||
} /* end app_process_rec_packet */
|
||||
|
||||
|
||||
/* Process control C and window close events. */
|
||||
|
||||
#if __WIN32__
|
||||
|
||||
static BOOL cleanup_win (int ctrltype)
|
||||
{
|
||||
if (ctrltype == CTRL_C_EVENT || ctrltype == CTRL_CLOSE_EVENT) {
|
||||
text_color_set(DW_COLOR_INFO);
|
||||
dw_printf ("\nQRT\n");
|
||||
ptt_term ();
|
||||
dwgps_term ();
|
||||
SLEEP_SEC(1);
|
||||
ExitProcess (0);
|
||||
}
|
||||
return (TRUE);
|
||||
}
|
||||
|
||||
|
||||
#else
|
||||
|
||||
static void cleanup_linux (int x)
|
||||
{
|
||||
text_color_set(DW_COLOR_INFO);
|
||||
dw_printf ("\nQRT\n");
|
||||
ptt_term ();
|
||||
dwgps_term ();
|
||||
exit(0);
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
|
||||
|
||||
static void usage (char **argv)
|
||||
{
|
||||
text_color_set(DW_COLOR_ERROR);
|
||||
|
||||
dw_printf ("\n");
|
||||
dw_printf ("Dire Wolf version %d.%d\n", MAJOR_VERSION, MINOR_VERSION);
|
||||
dw_printf ("\n");
|
||||
dw_printf ("Usage: direwolf [options]\n");
|
||||
dw_printf ("Options:\n");
|
||||
dw_printf (" -c fname Configuration file name.\n");
|
||||
|
||||
dw_printf (" -r n Audio sample rate, per sec.\n");
|
||||
dw_printf (" -n n Number of audio channels, 1 or 2.\n");
|
||||
dw_printf (" -b n Bits per audio sample, 8 or 16.\n");
|
||||
dw_printf (" -B n Data rate in bits/sec. Standard values are 300, 1200, 9600.\n");
|
||||
dw_printf (" If < 600, AFSK tones are set to 1600 & 1800.\n");
|
||||
dw_printf (" If > 2400, K9NG/G3RUH style encoding is used.\n");
|
||||
dw_printf (" Otherwise, AFSK tones are set to 1200 & 2200.\n");
|
||||
|
||||
dw_printf (" -d Debug communication with client application, one of\n");
|
||||
dw_printf (" a a = AGWPE network protocol.\n");
|
||||
dw_printf (" k k = KISS serial port.\n");
|
||||
dw_printf (" n n = KISS network.\n");
|
||||
dw_printf (" u u = Display non-ASCII text in hexadecimal.\n");
|
||||
|
||||
dw_printf (" -t n Text colors. 1=normal, 0=disabled.\n");
|
||||
|
||||
#if __WIN32__
|
||||
#else
|
||||
dw_printf (" -p Enable pseudo terminal for KISS protocol.\n");
|
||||
#endif
|
||||
dw_printf (" -x Send Xmit level calibration tones.\n");
|
||||
dw_printf (" -U Print UTF-8 test string and exit.\n");
|
||||
dw_printf ("\n");
|
||||
|
||||
#if __WIN32__
|
||||
#else
|
||||
dw_printf ("Complete documentation can be found in /usr/local/share/doc/direwolf.\n");
|
||||
#endif
|
||||
exit (EXIT_FAILURE);
|
||||
}
|
||||
|
||||
|
||||
|
||||
/* end direwolf.c */
|
592
direwolf.conf
592
direwolf.conf
|
@ -1,592 +0,0 @@
|
|||
#############################################################
|
||||
# #
|
||||
# Configuration file for Dire Wolf #
|
||||
# #
|
||||
#############################################################
|
||||
#
|
||||
# Consult the User Guide for more details on configuration options.
|
||||
#
|
||||
#
|
||||
# These are the most likely settings you might change:
|
||||
#
|
||||
# (1) MYCALL - call sign and SSID for your station.
|
||||
#
|
||||
# Look for lines starting with MYCALL and
|
||||
# change NOCALL to your own.
|
||||
#
|
||||
#
|
||||
# (2) PBEACON - enable position beaconing.
|
||||
#
|
||||
# Look for lines starting with PBEACON and
|
||||
# modify for your call, location, etc.
|
||||
#
|
||||
#
|
||||
# (3) DIGIPEATER - configure digipeating rules.
|
||||
#
|
||||
# Look for lines starting with DIGIPEATER.
|
||||
# Most people will probably use the first example.
|
||||
# Just remove the "#" from the start of the line
|
||||
# to enable it.
|
||||
#
|
||||
#
|
||||
# (4) IGSERVER, IGLOGIN - IGate server and login
|
||||
#
|
||||
# Configure an IGate client to relay messages between
|
||||
# radio and internet servers.
|
||||
#
|
||||
#
|
||||
# The default location is "direwolf.conf" in the current working directory.
|
||||
# On Linux, the user's home directory will also be searched.
|
||||
# An alternate configuration file location can be specified with the "-c" command line option.
|
||||
#
|
||||
# As you probably guessed by now, # indicates a comment line.
|
||||
#
|
||||
# Remove the # at the beginning of a line if you want to use a sample
|
||||
# configuration that is currently commented out.
|
||||
#
|
||||
# Commands are a keyword followed by parameters.
|
||||
#
|
||||
# Command key words are case insensitive. i.e. upper and lower case are equivalent.
|
||||
#
|
||||
# Command parameters are generally case sensitive. i.e. upper and lower case are different.
|
||||
#
|
||||
# Example: The next two are equivalent
|
||||
#
|
||||
# PTT /dev/ttyS0 RTS
|
||||
# ptt /dev/ttyS0 RTS
|
||||
#
|
||||
# But this not equivalent because device names are case sensitive.
|
||||
#
|
||||
# PTT /dev/TTYs0 RTS
|
||||
#
|
||||
|
||||
|
||||
#############################################################
|
||||
# #
|
||||
# AUDIO DEVICE PROPERTIES #
|
||||
# #
|
||||
#############################################################
|
||||
|
||||
#
|
||||
# Many people will simply use the default sound device.
|
||||
# Some might want to use an alternative device by chosing it here.
|
||||
#
|
||||
# When the Windows version starts up, it displays something like
|
||||
# this with the available sound devices and capabilities:
|
||||
#
|
||||
# Available audio input devices for receive (*=selected):
|
||||
# 0: Microphone (Realtek High Defini
|
||||
# 1: Microphone (Bluetooth SCO Audio
|
||||
# 2: Microphone (Bluetooth AV Audio)
|
||||
# 3: Microphone (USB PnP Sound Devic
|
||||
# Available audio output devices for transmit (*=selected):
|
||||
# 0: Speakers (Realtek High Definiti
|
||||
# 1: Speakers (Bluetooth SCO Audio)
|
||||
# 2: Realtek Digital Output (Realtek
|
||||
# 3: Realtek Digital Output(Optical)
|
||||
# 4: Speakers (Bluetooth AV Audio)
|
||||
# 5: Speakers (USB PnP Sound Device)
|
||||
|
||||
# Example: To use the USB Audio, use a command like this with
|
||||
# the input and output device numbers. (Remove the # comment character.)
|
||||
|
||||
#ADEVICE 3 5
|
||||
|
||||
# The position in the list can change when devices (e.g. USB) are added and removed.
|
||||
# You can also specify devices by using part of the name.
|
||||
# Here is an example of specifying the USB Audio device.
|
||||
# This is case-sensitive. Upper and lower case are not treated the same.
|
||||
|
||||
#ADEVICE USB
|
||||
|
||||
|
||||
# Linux ALSA is complicated. See User Guide for discussion.
|
||||
# To use something other than the default, generally use plughw
|
||||
# and a card number reported by "arecord -l" command. Examples:
|
||||
|
||||
# ADEVICE plughw:CARD=Device,DEV=0
|
||||
# ADEVICE plughw:1,0
|
||||
|
||||
# Starting with version 1.0, you can also use "-" or "stdin" to
|
||||
# pipe stdout from some other application such as a software defined
|
||||
# radio. You can also specify "UDP:" and an optional port for input.
|
||||
# Something different must be specified for output.
|
||||
|
||||
# ADEVICE - plughw:1,0
|
||||
# ADEVICE UDP:7355 default
|
||||
|
||||
#
|
||||
# This is the sound card audio sample rate.
|
||||
# The default is 44100. Other standard values are 22050 or 11025.
|
||||
#
|
||||
# Change this only if your computer can't keep up.
|
||||
# A lower rate means lower CPU demands but performance will be degraded.
|
||||
#
|
||||
|
||||
ARATE 44100
|
||||
|
||||
|
||||
#
|
||||
# Number of audio channels. 1 or 2.
|
||||
# If you specify 2, it is possible to attach two different transceivers
|
||||
# and receive from both simultaneously.
|
||||
#
|
||||
|
||||
ACHANNELS 1
|
||||
|
||||
# Use this instead if you want to use two transceivers.
|
||||
|
||||
#ACHANNELS 2
|
||||
|
||||
|
||||
#############################################################
|
||||
# #
|
||||
# CHANNEL 0 PROPERTIES #
|
||||
# #
|
||||
#############################################################
|
||||
|
||||
CHANNEL 0
|
||||
|
||||
#
|
||||
# The following will apply to the first or only channel.
|
||||
# When two channels are used, this is the left audio channel.
|
||||
#
|
||||
|
||||
|
||||
#
|
||||
# Station identifier for this channel.
|
||||
# Multiple channels can have the same or different names.
|
||||
#
|
||||
# It can be up to 6 letters and digits with an optional ssid.
|
||||
# The APRS specification requires that it be upper case.
|
||||
#
|
||||
# Example (don't use this unless you are me): MYCALL WB2OSZ-5
|
||||
#
|
||||
|
||||
MYCALL NOCALL
|
||||
|
||||
#
|
||||
# VHF FM operation normally uses 1200 baud data with AFSK tones of 1200 and 2200 Hz.
|
||||
#
|
||||
|
||||
MODEM 1200 1200 2200
|
||||
|
||||
#
|
||||
# 200 Hz shift is normally used for 300 baud HF SSB operation.
|
||||
#
|
||||
# Note that if you change the tones here, you will need to adjust
|
||||
# your tuning dial accordingly to get the same transmitted frequencies.
|
||||
#
|
||||
# In the second example, we have 7 demodulators spaced 30 Hz apart
|
||||
# to capture signals that are off frequency.
|
||||
# If you run out of CPU power, drop the audio sample rate down to 22050.
|
||||
|
||||
#MODEM 300 1600 1800
|
||||
#MODEM 300 1600 1800 7 30
|
||||
|
||||
#
|
||||
# 9600 baud doesn't use AFSK so no tones are listed.
|
||||
#
|
||||
|
||||
#MODEM 9600
|
||||
|
||||
|
||||
#
|
||||
# If not using a VOX circuit, the transmitter Push to Talk (PTT)
|
||||
# control is usually wired to a serial port with a suitable interface circuit.
|
||||
# DON'T connect it directly!
|
||||
#
|
||||
# For the PTT command, specify the device and either RTS or DTR.
|
||||
# RTS or DTR may be preceded by "-" to invert the signal.
|
||||
#
|
||||
|
||||
#PTT COM1 RTS
|
||||
#PTT COM1 -DTR
|
||||
#PTT /dev/ttyUSB0 RTS
|
||||
|
||||
#
|
||||
# On Linux, you can also use general purpose I/O pins if
|
||||
# your system is configured for user access to them.
|
||||
# This would apply mostly to microprocessor boards, not a regular PC.
|
||||
# See separate Raspberry Pi document for more details.
|
||||
# The number may be preceded by "-" to invert the signal.
|
||||
#
|
||||
|
||||
#PTT GPIO 25
|
||||
|
||||
|
||||
#
|
||||
# After turning on transmitter, send "flag" characters for
|
||||
# TXDELAY * 10 milliseconds for transmitter to stabilize before
|
||||
# sending data. 300 milliseconds is a good default.
|
||||
#
|
||||
|
||||
TXDELAY 30
|
||||
|
||||
#
|
||||
# Keep transmitting for TXTAIL * 10 milliseconds after sending
|
||||
# the data. This is needed to avoid dropping PTT too soon and
|
||||
# chopping of the end of the data because we don't have
|
||||
# precise control of when the sound will actually get out.
|
||||
#
|
||||
|
||||
TXTAIL 10
|
||||
|
||||
|
||||
#############################################################
|
||||
# #
|
||||
# CHANNEL 1 PROPERTIES #
|
||||
# #
|
||||
#############################################################
|
||||
|
||||
CHANNEL 1
|
||||
|
||||
#
|
||||
# The following will apply to the second (right) channel if ACHANNELS is 2.
|
||||
#
|
||||
|
||||
#
|
||||
# The two radio channels can have the same or different station identifiers.
|
||||
#
|
||||
#
|
||||
# Example (don't use this unless you are me): MYCALL WB2OSZ-5
|
||||
#
|
||||
|
||||
MYCALL NOCALL
|
||||
|
||||
MODEM 1200 1200 2200
|
||||
|
||||
#
|
||||
# For this example, we use the same serial port for both
|
||||
# transmitters. RTS for channel 0 and DTR for channel 1.
|
||||
#
|
||||
|
||||
#PTT COM1 DTR
|
||||
|
||||
TXDELAY 30
|
||||
TXTAIL 10
|
||||
|
||||
|
||||
|
||||
#############################################################
|
||||
# #
|
||||
# VIRTUAL TNC SERVER PROPERTIES #
|
||||
# #
|
||||
#############################################################
|
||||
|
||||
#
|
||||
# Dire Wolf acts as a virtual TNC and can communicate with
|
||||
# two different protocols:
|
||||
# - the “AGW TCPIP Socket Interface” - default port 8000
|
||||
# - KISS TNC via serial port
|
||||
# - KISS protocol over TCP socket - default port 8001
|
||||
#
|
||||
# See descriptions of AGWPORT, KISSPORT, and NULLMODEM in the
|
||||
# User Guide for more details.
|
||||
#
|
||||
|
||||
AGWPORT 8000
|
||||
KISSPORT 8001
|
||||
|
||||
#
|
||||
# Some applications are designed to operate with only a physical
|
||||
# TNC attached to a serial port. For these, we provide a virtual serial
|
||||
# port ("pseudo terminal" in Linux) that appears to be connected to a TNC.
|
||||
#
|
||||
# Linux:
|
||||
# Linux applications can often specify "/tmp/kisstnc"
|
||||
# for the serial port name. Behind the scenes, Dire Wolf
|
||||
# creates a pseudo terminal. Unfortunately we can't specify the name
|
||||
# and we wouldn't want to reconfigure the application each time.
|
||||
# To get around this, /tmp/kisstnc is a symbolic link to the
|
||||
# non-constant pseudo terminal name.
|
||||
#
|
||||
# Use the -p command line option to enable this feature.
|
||||
#
|
||||
# Windows:
|
||||
#
|
||||
# Microsoft Windows applications need a serial port
|
||||
# name like COM1, COM2, COM3, or COM4.
|
||||
#
|
||||
# Take a look at the User Guide for instructions to set up
|
||||
# two virtual serial ports named COM3 and COM4 connected by
|
||||
# a null modem.
|
||||
#
|
||||
# Using the default configuration, Dire Wolf will connect to
|
||||
# COM3 and the client application will use COM4.
|
||||
#
|
||||
# Uncomment following line to use this feature.
|
||||
|
||||
#NULLMODEM COM3
|
||||
|
||||
|
||||
#
|
||||
# Version 0.6 adds a new feature where it is sometimes possible
|
||||
# to recover frames with a bad FCS. Several levels of effort
|
||||
# are possible.
|
||||
#
|
||||
# 0 [NONE] - Don't try to repair.
|
||||
# 1 [SINGLE] - Attempt to fix single bit error. (default)
|
||||
# 2 [DOUBLE] - Also attempt to fix two adjacent bits.
|
||||
# 3 [TRIPLE] - Also attempt to fix three adjacent bits.
|
||||
# 4 [TWO_SEP] - Also attempt to fix two non-adjacent (separated) bits.
|
||||
#
|
||||
|
||||
FIX_BITS 1
|
||||
|
||||
#
|
||||
#############################################################
|
||||
# #
|
||||
# BEACONING PROPERTIES #
|
||||
# #
|
||||
#############################################################
|
||||
|
||||
|
||||
#
|
||||
# Beaconing is configured with these two commands:
|
||||
#
|
||||
# PBEACON - for a position report (usually yourself)
|
||||
# OBEACON - for an object report (usually some other entity)
|
||||
#
|
||||
# Each has a series of keywords and values for options.
|
||||
# See User Guide for details.
|
||||
#
|
||||
# Example:
|
||||
#
|
||||
# This results in a broadcast once every 10 minutes.
|
||||
# Every half hour, it can travel via two digipeater hops.
|
||||
# The others are kept local.
|
||||
#
|
||||
|
||||
#PBEACON delay=00:15 every=30 overlay=S symbol="digi" lat=42^37.14N long=071^20.83W power=50 height=20 gain=4 comment="Chelmsford MA" via=WIDE1-1,WIDE2-1
|
||||
#PBEACON delay=10:15 every=30 overlay=S symbol="digi" lat=42^37.14N long=071^20.83W power=50 height=20 gain=4 comment="Chelmsford MA"
|
||||
#PBEACON delay=20:15 every=30 overlay=S symbol="digi" lat=42^37.14N long=071^20.83W power=50 height=20 gain=4 comment="Chelmsford MA"
|
||||
|
||||
#
|
||||
# Modify this for your particular situation before removing
|
||||
# the # comment character from the beginning of the lines above.
|
||||
#
|
||||
|
||||
|
||||
#############################################################
|
||||
# #
|
||||
# DIGIPEATER PROPERTIES #
|
||||
# #
|
||||
#############################################################
|
||||
|
||||
#
|
||||
# Digipeating is activated with commands of the form:
|
||||
#
|
||||
# DIGIPEAT from-chan to-chan aliases wide [ preemptive ]
|
||||
#
|
||||
# where,
|
||||
#
|
||||
# from-chan is the channel where the packet is received.
|
||||
#
|
||||
# to-chan is the channel where the packet is to be re-transmitted.
|
||||
#
|
||||
# aliases is a pattern for digipeating ONCE. Anything matching
|
||||
# this pattern is effectively treated like WIDE1-1.
|
||||
# 'MYCALL' for the receiving channel is an implied
|
||||
# member of this list.
|
||||
#
|
||||
# wide is the pattern for normal WIDEn-N digipeating
|
||||
# where the ssid is decremented.
|
||||
#
|
||||
# preemptive is the "preemptive" digipeating option. See
|
||||
# User Guide for more details.
|
||||
#
|
||||
# Pattern matching uses "extended regular expressions." Rather than listing
|
||||
# all the different possibilities (such as "WIDE3-3,WIDE4-4,WIDE5-5,WIDE6-6,WIDE7-7"),
|
||||
# a pattern can be specified such as "^WIDE[34567]-[1-7]$". This means:
|
||||
#
|
||||
# ^ beginning of call. Without this, leading characters
|
||||
# don't need to match and ZWIDE3-3 would end up matching.
|
||||
#
|
||||
# WIDE is an exact literal match of upper case letters W I D E.
|
||||
#
|
||||
# [34567] means ANY ONE of the characters listed.
|
||||
#
|
||||
# - is an exact literal match of the "-" character (when not
|
||||
# found inside of []).
|
||||
#
|
||||
# [1-7] is an alternative form where we have a range of characters
|
||||
# rather than listing them all individually.
|
||||
#
|
||||
# $ means end of call. Without this, trailing characters don't
|
||||
# need to match. As an example, we would end up matching
|
||||
# WIDE3-15 besides WIDE3-1.
|
||||
#
|
||||
# Google "Extended Regular Expressions" for more information.
|
||||
#
|
||||
|
||||
#
|
||||
# If the first unused digipeater field, in the received packet,
|
||||
# matches the first pattern, it is treated the same way you
|
||||
# would expect WIDE1-1 to behave.
|
||||
#
|
||||
# The digipeater name is replaced by MYCALL of the destination channel.
|
||||
#
|
||||
# Example: W1ABC>APRS,WIDE7-7
|
||||
# Becomes: W1ABC>APRS,WB2OSZ-5*
|
||||
#
|
||||
# In this example, we trap large values of N as recommended in
|
||||
# http://www.aprs.org/fix14439.html
|
||||
#
|
||||
|
||||
#
|
||||
# If not caught by the first pattern, see if it matches the second pattern.
|
||||
#
|
||||
# Matches will be processed with the usual WIDEn-N rules.
|
||||
#
|
||||
# If N >= 2, the N value is decremented and MYCALL (of the destination
|
||||
# channel) is inserted if enough room.
|
||||
#
|
||||
# Example: W1ABC>APRS,WIDE2-2
|
||||
# Becomes: W1ABC>APRS,WB2OSZ-5*,WIDE2-1
|
||||
#
|
||||
# If N = 1, we don't want to keep WIDEn-0 in the digipeater list so
|
||||
# the station is replaced by MYCALL.
|
||||
#
|
||||
# Example: W1ABC>APRS,W9XYZ*,WIDE2-1
|
||||
# Becomes: W1ABC>APRS,W9XYZ,WB2OSZ-5*
|
||||
#
|
||||
|
||||
#-------------------------------------------------------
|
||||
# ---------- Example 1: Typical digipeater ----------
|
||||
#-------------------------------------------------------
|
||||
|
||||
#
|
||||
# For most common situations, use something like this by removing
|
||||
# the "#" from the beginning of the line.
|
||||
# To disable digipeating, put # at the beginning of the line.
|
||||
#
|
||||
|
||||
# DIGIPEAT 0 0 ^WIDE[3-7]-[1-7]$|^TEST$ ^WIDE[12]-[12]$ TRACE
|
||||
|
||||
|
||||
|
||||
|
||||
#############################################################
|
||||
# #
|
||||
# INTERNET GATEWAY #
|
||||
# #
|
||||
#############################################################
|
||||
|
||||
# First you need to specify the name of a Tier 2 server.
|
||||
# The current preferred way is to use one of these regional rotate addresses:
|
||||
|
||||
# noam.aprs2.net - for North America
|
||||
# soam.aprs2.net - for South America
|
||||
# euro.aprs2.net - for Europe and Africa
|
||||
# asia.aprs2.net - for Asia
|
||||
# aunz.aprs2.net - for Oceania
|
||||
|
||||
#IGSERVER noam.aprs2.net
|
||||
|
||||
# You also need to specify your login name and passcode.
|
||||
# Contact the author if you can't figure out how to generate the passcode.
|
||||
|
||||
#IGLOGIN WB2OSZ-5 123456
|
||||
|
||||
# That's all you need for a receive only IGate which relays
|
||||
# messages from the local radio channel to the global servers.
|
||||
|
||||
# Some might want to send an IGate client position directly to a server
|
||||
# without sending it over the air and relying on someone else to
|
||||
# forward it to an IGate server. This is done by using sendto=IG rather
|
||||
# than a radio channel number. Overlay R for receive only, T for two way.
|
||||
|
||||
#PBEACON sendto=IG delay=0:30 every=60:00 symbol="igate" overlay=R lat=42^37.14N long=071^20.83W
|
||||
#PBEACON sendto=IG delay=0:30 every=60:00 symbol="igate" overlay=T lat=42^37.14N long=071^20.83W
|
||||
|
||||
|
||||
# To relay messages from the Internet to radio, you need to add
|
||||
# one more option with the transmit channel number and a VIA path.
|
||||
|
||||
#IGTXVIA 0 WIDE1-1
|
||||
|
||||
# You might want to apply a filter for what packets will be obtained from the server.
|
||||
# Read about filters here: http://www.aprs2.net/wiki/pmwiki.php/Main/FilterGuide
|
||||
# Example:
|
||||
|
||||
#IGFILTER m/50
|
||||
|
||||
# Finally, we don’t want to flood the radio channel.
|
||||
# The IGate function will limit the number of packets transmitted
|
||||
# during 1 minute and 5 minute intervals. If a limit would
|
||||
# be exceeded, the packet is dropped and message is displayed in red.
|
||||
|
||||
IGTXLIMIT 6 10
|
||||
|
||||
|
||||
#############################################################
|
||||
# #
|
||||
# APRStt GATEWAY #
|
||||
# #
|
||||
#############################################################
|
||||
|
||||
#
|
||||
# Dire Wolf can receive DTMF (commonly known as Touch Tone)
|
||||
# messages and convert them to packet objects.
|
||||
#
|
||||
# See "APRStt-Implementation-Notes" document for details.
|
||||
#
|
||||
|
||||
#
|
||||
# Sample gateway configuration based on:
|
||||
#
|
||||
# http://www.aprs.org/aprstt/aprstt-coding24.txt
|
||||
# http://www.aprs.org/aprs-jamboree-2013.html
|
||||
#
|
||||
|
||||
# Define specific points.
|
||||
|
||||
TTPOINT B01 37^55.37N 81^7.86W
|
||||
TTPOINT B7495088 42.605237 -71.34456
|
||||
TTPOINT B934 42.605237 -71.34456
|
||||
|
||||
TTPOINT B901 42.661279 -71.364452
|
||||
TTPOINT B902 42.660411 -71.364419
|
||||
TTPOINT B903 42.659046 -71.364452
|
||||
TTPOINT B904 42.657578 -71.364602
|
||||
|
||||
|
||||
# For location at given bearing and distance from starting point.
|
||||
|
||||
TTVECTOR B5bbbddd 37^55.37N 81^7.86W 0.01 mi
|
||||
|
||||
# For location specified by x, y coordinates.
|
||||
|
||||
TTGRID Byyyxxx 37^50.00N 81^00.00W 37^59.99N 81^09.99W
|
||||
|
||||
# UTM location for Lowell-Dracut-Tyngsborough State Forest.
|
||||
|
||||
TTUTM B6xxxyyy 19T 10 300000 4720000
|
||||
|
||||
|
||||
|
||||
# Location for the corral.
|
||||
|
||||
TTCORRAL 37^55.50N 81^7.00W 0^0.02N
|
||||
|
||||
# Compact messages - Fixed locations xx and object yyy where
|
||||
# Object numbers 100 – 199 = bicycle
|
||||
# Object numbers 200 – 299 = fire truck
|
||||
# Others = dog
|
||||
|
||||
TTMACRO xx1yy B9xx*AB166*AA2B4C5B3B0A1yy
|
||||
TTMACRO xx2yy B9xx*AB170*AA3C4C7C3B0A2yy
|
||||
TTMACRO xxyyy B9xx*AB180*AA3A6C4A0Ayyy
|
||||
|
||||
TTMACRO z Cz
|
||||
|
||||
# Transmit object reports on channel 0 with this header.
|
||||
|
||||
#TTOBJ 0 WB2OSZ-5>APDW10
|
||||
|
||||
# Advertise gateway position with beacon.
|
||||
|
||||
# OBEACON DELAY=0:15 EVERY=10:00 VIA=WIDE1-1 OBJNAME=WB2OSZ-tt SYMBOL=APRStt LAT=42^37.14N LONG=71^20.83W COMMENT="APRStt Gateway"
|
||||
|
||||
|
|
@ -1,10 +0,0 @@
|
|||
[Desktop Entry]
|
||||
Type=Application
|
||||
Exec=lxterminal -t "Dire Wolf" -e "/usr/local/bin/direwolf"
|
||||
Name=Dire Wolf
|
||||
Comment=APRS Soundcard TNC
|
||||
Icon=/usr/share/direwolf/dw-icon.png
|
||||
Path=/home/pi
|
||||
#Terminal=true
|
||||
Categories=HamRadio
|
||||
Keywords=Ham Radio;APRS;Soundcard TNC;KISS;AGWPE;AX.25
|
39
direwolf.h
39
direwolf.h
|
@ -1,39 +0,0 @@
|
|||
|
||||
#ifndef DIREWOLF_H
|
||||
#define DIREWOLF_H 1
|
||||
|
||||
|
||||
/*
|
||||
* Maximum number of radio channels.
|
||||
*/
|
||||
|
||||
#define MAX_CHANS 2
|
||||
|
||||
/*
|
||||
* Maximum number of modems per channel.
|
||||
* I called them "subchannels" (in the code) because
|
||||
* it is short and unambiguous.
|
||||
* Nothing magic about the number. Could be larger
|
||||
* but CPU demands might be overwhelming.
|
||||
*/
|
||||
|
||||
#define MAX_SUBCHANS 9
|
||||
|
||||
|
||||
#if __WIN32__
|
||||
#include <windows.h>
|
||||
#define SLEEP_SEC(n) Sleep((n)*1000)
|
||||
#define SLEEP_MS(n) Sleep(n)
|
||||
#else
|
||||
#define SLEEP_SEC(n) sleep(n)
|
||||
#define SLEEP_MS(n) usleep((n)*1000)
|
||||
#endif
|
||||
|
||||
#endif
|
||||
|
||||
#if __WIN32__
|
||||
#define PTW32_STATIC_LIB
|
||||
#include "pthreads/pthread.h"
|
||||
#else
|
||||
#include <pthread.h>
|
||||
#endif
|
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
|
@ -0,0 +1,21 @@
|
|||
|
||||
install(FILES "${CUSTOM_DOC_DIR}/README.md" DESTINATION ${INSTALL_DOC_DIR})
|
||||
install(FILES "${CUSTOM_DOC_DIR}/2400-4800-PSK-for-APRS-Packet-Radio.pdf" DESTINATION ${INSTALL_DOC_DIR})
|
||||
install(FILES "${CUSTOM_DOC_DIR}/A-Better-APRS-Packet-Demodulator-Part-1-1200-baud.pdf" DESTINATION ${INSTALL_DOC_DIR})
|
||||
install(FILES "${CUSTOM_DOC_DIR}/A-Better-APRS-Packet-Demodulator-Part-2-9600-baud.pdf" DESTINATION ${INSTALL_DOC_DIR})
|
||||
install(FILES "${CUSTOM_DOC_DIR}/A-Closer-Look-at-the-WA8LMF-TNC-Test-CD.pdf" DESTINATION ${INSTALL_DOC_DIR})
|
||||
install(FILES "${CUSTOM_DOC_DIR}/AIS-Reception.pdf" DESTINATION ${INSTALL_DOC_DIR})
|
||||
install(FILES "${CUSTOM_DOC_DIR}/APRS-Telemetry-Toolkit.pdf" DESTINATION ${INSTALL_DOC_DIR})
|
||||
install(FILES "${CUSTOM_DOC_DIR}/APRStt-Implementation-Notes.pdf" DESTINATION ${INSTALL_DOC_DIR})
|
||||
install(FILES "${CUSTOM_DOC_DIR}/APRStt-interface-for-SARTrack.pdf" DESTINATION ${INSTALL_DOC_DIR})
|
||||
install(FILES "${CUSTOM_DOC_DIR}/APRStt-Listening-Example.pdf" DESTINATION ${INSTALL_DOC_DIR})
|
||||
install(FILES "${CUSTOM_DOC_DIR}/AX25_plus_FEC_equals_FX25.pdf" DESTINATION ${INSTALL_DOC_DIR})
|
||||
install(FILES "${CUSTOM_DOC_DIR}/Bluetooth-KISS-TNC.pdf" DESTINATION ${INSTALL_DOC_DIR})
|
||||
install(FILES "${CUSTOM_DOC_DIR}/Going-beyond-9600-baud.pdf" DESTINATION ${INSTALL_DOC_DIR})
|
||||
install(FILES "${CUSTOM_DOC_DIR}/Raspberry-Pi-APRS.pdf" DESTINATION ${INSTALL_DOC_DIR})
|
||||
install(FILES "${CUSTOM_DOC_DIR}/Raspberry-Pi-APRS-Tracker.pdf" DESTINATION ${INSTALL_DOC_DIR})
|
||||
install(FILES "${CUSTOM_DOC_DIR}/Raspberry-Pi-SDR-IGate.pdf" DESTINATION ${INSTALL_DOC_DIR})
|
||||
install(FILES "${CUSTOM_DOC_DIR}/Successful-APRS-IGate-Operation.pdf" DESTINATION ${INSTALL_DOC_DIR})
|
||||
install(FILES "${CUSTOM_DOC_DIR}/User-Guide.pdf" DESTINATION ${INSTALL_DOC_DIR})
|
||||
install(FILES "${CUSTOM_DOC_DIR}/WA8LMF-TNC-Test-CD-Results.pdf" DESTINATION ${INSTALL_DOC_DIR})
|
||||
install(FILES "${CUSTOM_DOC_DIR}/Why-is-9600-only-twice-as-fast-as-1200.pdf" DESTINATION ${INSTALL_DOC_DIR})
|
Binary file not shown.
|
@ -0,0 +1,178 @@
|
|||
# Documentation for Dire Wolf #
|
||||
|
||||
Click on the document name to view in your web browser or the link following to download the PDF file.
|
||||
|
||||
|
||||
## Slide Show ##
|
||||
|
||||
Brief summary of packet radio / APRS history and the capbilities of Dire Wolf.
|
||||
|
||||
[Power Point presentation](https://github.com/wb2osz/direwolf-presentation) -- Why not give a talk at a local club meeting?
|
||||
|
||||
## Essential Reading ##
|
||||
|
||||
- [**User Guide**](User-Guide.pdf) [ [*download*](../../../raw/master/doc/User-Guide.pdf) ]
|
||||
|
||||
This is your primary source of information about installation, operation, and configuration.
|
||||
|
||||
- [**Raspberry Pi APRS**](Raspberry-Pi-APRS.pdf) [ [*download*](../../../raw/master/doc/Raspberry-Pi-APRS.pdf) ]
|
||||
|
||||
The Raspberry Pi has some special considerations that
|
||||
make it different from other generic Linux systems.
|
||||
Start here if using the Raspberry Pi, Beaglebone Black, cubieboard2, or similar single board computers.
|
||||
|
||||
|
||||
## Application Notes ##
|
||||
|
||||
These dive into more detail for specialized topics or typical usage scenarios.
|
||||
|
||||
|
||||
|
||||
- [**AX.25 + FEC = FX.25**](AX25_plus_FEC_equals_FX25.pdf) [ [*download*](../../../raw/dev/doc/AX25_plus_FEC_equals_FX25.pdf) ]
|
||||
|
||||
What can you do if your radio signal isn’t quite strong enough to get through reliably? Move to higher ground? Get a better antenna? More power? Use very narrow bandwidth and very slow data?
|
||||
|
||||
Sometimes those are not options. Another way to improve communication reliability is to add redundant information so the message will still get through even if small parts are missing. FX.25 adds forward error correction (FEC) which maintaining complete compatibility with older equipment.
|
||||
|
||||
|
||||
- [**AX.25 Throughput: Why is 9600 bps Packet Radio only twice as fast as 1200?**](Why-is-9600-only-twice-as-fast-as-1200.pdf) [ [*download*](../../../raw/dev/doc/Why-is-9600-only-twice-as-fast-as-1200.pdf) ]
|
||||
|
||||
Simply switching to a higher data rate will probably result in great disappointment. You might expect it to be 8 times faster but it can turn out to be only twice as fast.
|
||||
|
||||
In this document, we look at why a large increase in data bit rate can produce a much smaller increase in throughput. We will explore techniques that can be used to make large improvements and drastically speed up large data transfer.
|
||||
|
||||
|
||||
|
||||
|
||||
- [**Successful APRS IGate Operation**](Successful-APRS-IGate-Operation.pdf) [ [*download*](../../../raw/dev/doc/Successful-APRS-IGate-Operation.pdf) ]
|
||||
|
||||
|
||||
Dire Wolf can serve as a gateway between the APRS radio network and APRS-IS servers on the Internet.
|
||||
|
||||
This explains how it all works, proper configuration, and troubleshooting.
|
||||
|
||||
- [**Bluetooth KISS TNC**](Bluetooth-KISS-TNC.pdf) [ [*download*](../../../raw/master/doc/Bluetooth-KISS-TNC.pdf) ]
|
||||
|
||||
Eliminate the cable between your TNC and application. Use Bluetooth instead.
|
||||
|
||||
- [**APRStt Implementation Notes**](APRStt-Implementation-Notes.pdf) [ [*download*](../../../raw/master/doc/APRStt-Implementation-Notes.pdf) ]
|
||||
|
||||
Very few hams have portable equipment for APRS but nearly everyone has a handheld radio that can send DTMF tones. APRStt allows a user, equipped with only DTMF (commonly known as Touch Tone) generation capability, to enter information into the global APRS data network.
|
||||
This document explains how the APRStt concept was implemented in the Dire Wolf application.
|
||||
|
||||
- [**APRStt Interface for SARTrack**](APRStt-interface-for-SARTrack.pdf) [ [*download*](../../../raw/master/doc/APRStt-interface-for-SARTrack.pdf) ]
|
||||
|
||||
This example illustrates how APRStt can be integrated with other applications such as SARTrack, APRSISCE/32, YAAC, or Xastir.
|
||||
|
||||
- [**APRStt Listening Example**](APRStt-Listening-Example.pdf) [ [*download*](../../../raw/master/doc/APRStt-Listening-Example.pdf) ]
|
||||
|
||||
|
||||
WB4APR described a useful application for the [QIKCOM-2 Satallite Transponder](http://www.tapr.org/pipermail/aprssig/2015-November/045035.html).
|
||||
|
||||
Don’t have your own QIKCOM-2 Satellite Transponder? No Problem. You can do the same thing with an ordinary computer and the APRStt gateway built into Dire Wolf. Here’s how.
|
||||
|
||||
- [**Raspberry Pi APRS Tracker**](Raspberry-Pi-APRS-Tracker.pdf) [ [*download*](../../../raw/master/doc/Raspberry-Pi-APRS-Tracker.pdf) ]
|
||||
|
||||
Build a tracking device which transmits position from a GPS receiver.
|
||||
|
||||
- [**Raspberry Pi SDR IGate**](Raspberry-Pi-SDR-IGate.pdf) [ [*download*](../../../raw/master/doc/Raspberry-Pi-SDR-IGate.pdf) ]
|
||||
|
||||
It's easy to build a receive-only APRS Internet Gateway (IGate) with only a Raspberry Pi and a software defined radio (RTL-SDR) dongle. Here’s how.
|
||||
|
||||
- [**APRS Telemetry Toolkit**](APRS-Telemetry-Toolkit.pdf) [ [*download*](../../../raw/master/doc/APRS-Telemetry-Toolkit.pdf) ]
|
||||
|
||||
Describes scripts and methods to generate telemetry.
|
||||
Includes a complete example of attaching an analog to
|
||||
digital converter to a Raspberry Pi and transmitting
|
||||
a measured voltage.
|
||||
|
||||
|
||||
|
||||
- [**2400 & 4800 bps PSK for APRS / Packet Radio**](2400-4800-PSK-for-APRS-Packet-Radio.pdf) [ [*download*](../../../raw/master/doc/2400-4800-PSK-for-APRS-Packet-Radio.pdf) ]
|
||||
|
||||
|
||||
Double or quadruple your data rate by sending multiple bits at the same time.
|
||||
|
||||
- [**Going beyond 9600 baud**](Going-beyond-9600-baud.pdf) [ [*download*](../../../raw/master/doc/Going-beyond-9600-baud.pdf) ]
|
||||
|
||||
|
||||
Why stop at 9600 baud? Go faster if your soundcard and radio can handle it.
|
||||
|
||||
- [**AIS Reception**](AIS-Reception.pdf) [ [*download*](../../../raw/dev/doc/AIS-Reception.pdf) ]
|
||||
|
||||
|
||||
AIS is an international tracking system for ships. Messages can contain position, speed, course, name, destination, status, vessel dimensions, and many other types of information. Learn how to receive these signals with an ordindary ham transceiver and display the ship locations with APRS applications or [OpenCPN](https://opencpn.org).
|
||||
|
||||
- **[EAS to APRS message converter](https://github.com/wb2osz/eas2aprs)**
|
||||
|
||||
|
||||
The [U.S. National Weather Service](https://www.weather.gov/nwr/) (NWS) operates more than 1,000 VHF FM radio stations that continuously transmit weather information. These stations also transmit special warnings about severe weather, disasters (natural & manmade), and public safety.
|
||||
|
||||
Alerts are sent in a digital form known as Emergency Alert System (EAS) Specific Area Message Encoding (SAME). [You can hear a sample here](https://en.wikipedia.org/wiki/Specific_Area_Message_Encoding).
|
||||
|
||||
It is possible to buy radios that decode these messages but what fun is that? We are ham radio operators so we want to build our own from stuff that we already have sitting around.
|
||||
|
||||
|
||||
## Miscellaneous ##
|
||||
|
||||
- **[Ham Radio of Things (HRoT)](https://github.com/wb2osz/hrot)**
|
||||
|
||||
|
||||
Now that billions of computers and mobile phones (which are handheld computers) are all connected by the Internet, the large growth is expected from the “Internet of Things.” What is a “thing?” It could be a temperature sensor, garage door opener, motion detector, flood water level, smoke alarm, antenna rotator, coffee maker, lights, home thermostat, …, just about anything you might want to monitor or control.
|
||||
|
||||
There have been other occasional mentions of merging Ham Radio with the Internet of Things but only ad hoc incompatible narrowly focused applications. Here is a proposal for a standardized more flexible method so different systems can communicate with each other.
|
||||
|
||||
- [**A Better APRS Packet Demodulator, part 1, 1200 baud**](A-Better-APRS-Packet-Demodulator-Part-1-1200-baud.pdf) [ [*download*](../../../raw/master/doc/A-Better-APRS-Packet-Demodulator-Part-1-1200-baud.pdf) ]
|
||||
|
||||
Sometimes it's a little mystifying why an
|
||||
APRS / AX.25 Packet TNC will decode some signals
|
||||
and not others. A weak signal, buried in static,
|
||||
might be fine while a nice strong clean sounding
|
||||
signal is not decoded. Here we will take a brief
|
||||
look at what could cause this perplexing situation
|
||||
and a couple things that can be done about it.
|
||||
|
||||
|
||||
|
||||
- [**A Better APRS Packet Demodulator, part 2, 9600 baud**](A-Better-APRS-Packet-Demodulator-Part-2-9600-baud.pdf) [ [*download*](../../../raw/master/doc/A-Better-APRS-Packet-Demodulator-Part-2-9600-baud.pdf) ]
|
||||
|
||||
In the first part of this series we discussed 1200 baud audio frequency shift keying (AFSK). The mismatch
|
||||
between FM transmitter pre-emphasis and the
|
||||
receiver de-emphasis will
|
||||
cause the amplitudes of the two tones to be different.
|
||||
This makes it more difficult to demodulate them accurately.
|
||||
9600 baud operation is an entirely different animal. ...
|
||||
|
||||
- [**WA8LMF TNC Test CD Results a.k.a. Battle of the TNCs**](WA8LMF-TNC-Test-CD-Results.pdf) [ [*download*](../../../raw/master/doc/WA8LMF-TNC-Test-CD-Results.pdf) ]
|
||||
|
||||
How can we compare how well the TNCs perform under real world conditions?
|
||||
The de facto standard of measurement is the number of packets decoded from [WA8LMF’s TNC Test CD](http://wa8lmf.net/TNCtest/index.htm).
|
||||
Many have published the number of packets they have been able to decode from this test. Here they are, all gathered in one place, for your reading pleasure.
|
||||
|
||||
- [**A Closer Look at the WA8LMF TNC Test CD**](A-Closer-Look-at-the-WA8LMF-TNC-Test-CD.pdf) [ [*download*](../../../raw/master/doc/A-Closer-Look-at-the-WA8LMF-TNC-Test-CD.pdf) ]
|
||||
|
||||
Here, we take a closer look at some of the frames on the TNC Test CD in hopes of gaining some insights into why some are easily decoded and others are more difficult.
|
||||
There are a lot of ugly signals out there. Many can be improved by decreasing the transmit volume. Others are just plain weird and you have to wonder how they are being generated.
|
||||
|
||||
|
||||
## Additional Documentation for Dire Wolf Software TNC #
|
||||
|
||||
|
||||
When there was little documentation, it was all added to the source code repository [https://github.com/wb2osz/direwolf/tree/master/doc](https://github.com/wb2osz/direwolf/tree/master/doc)
|
||||
|
||||
The growing number of documentation files and revisions are making the source code repository very large which means long download times. Additional documentation, not tied to a specific release, is now being added to [https://github.com/wb2osz/direwolf-doc](https://github.com/wb2osz/direwolf-doc)
|
||||
|
||||
## Questions? Experiences to share? ##
|
||||
|
||||
Here are some good places to ask questions and share your experiences:
|
||||
|
||||
- [Dire Wolf Software TNC](https://groups.io/g/direwolf)
|
||||
|
||||
- [Raspberry Pi 4 Ham Radio](https://groups.io/g/RaspberryPi-4-HamRadio)
|
||||
|
||||
- [linuxham](https://groups.io/g/linuxham)
|
||||
|
||||
- [TAPR aprssig](http://www.tapr.org/pipermail/aprssig/)
|
||||
|
||||
|
||||
The github "issues" section is for reporting software defects and enhancement requests. It is NOT a place to ask questions or have general discussions. Please use one of the locations above.
|
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue