Merge branch 'dev' into jj1bdx-apple-serialspeed

This commit is contained in:
Kenji Rikitake 2020-11-23 09:59:25 +09:00
commit c071a7d053
39 changed files with 541 additions and 697 deletions

View File

@ -2,15 +2,25 @@
# Revision History #
## Version 1.6 -- Under Development ##
## Version 1.7 -- Under Development ('dev' branch) ##
### New Features: ###
- 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.
## 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.
- 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.
- README.md has a quick summary of the process. More details in the ***User Guide***.
### New Features: ###
@ -45,15 +55,21 @@
- ***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 - IoT over Ham Radio***](https://github.com/wb2osz/hrot)
- [***Ham Radio of Things (HRoT) - IoT over Ham Radio***](https://github.com/wb2osz/hrot)
- Power Point slide show in separate repository. [https://github.com/wb2osz/direwolf-presentation ](https://github.com/wb2osz/direwolf-presentation)
- [***EAS SAME to APRS Message Converter***](https://github.com/wb2osz/eas2aprs)
- [***Dire Wolf PowerPoint Slide Show***](https://github.com/wb2osz/direwolf-presentation)
### Notes: ###
Windows binary distribution now uses gcc (MinGW) version 7.4.0.
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.

View File

@ -4,12 +4,13 @@ project(direwolf)
# configure version
set(direwolf_VERSION_MAJOR "1")
set(direwolf_VERSION_MINOR "6")
set(direwolf_VERSION_MINOR "7")
set(direwolf_VERSION_PATCH "0")
set(direwolf_VERSION_SUFFIX "")
set(direwolf_VERSION_SUFFIX "Development")
# options
option(FORCE_SSE "Compile with SSE instruction only" OFF)
# 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)
@ -86,13 +87,21 @@ set(CUSTOM_SHELL_SHABANG "#!/bin/sh -e")
set(CPACK_GENERATOR "ZIP")
set(CPACK_STRIP_FILES true)
set(CPACK_PACKAGE_NAME "${CMAKE_PROJECT_NAME}")
set(CPACK_PACKAGE_FILE_NAME "${CMAKE_PROJECT_NAME}-${direwolf_VERSION}_${CMAKE_SYSTEM_PROCESSOR}")
# 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 a software soundcard AX.25 packet modem/TNC and APRS encoder/decoder")
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 "")
@ -114,6 +123,12 @@ 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)

36
Makefile Normal file
View File

@ -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 " "

View File

@ -5,7 +5,7 @@
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 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.
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.
![](tnc-test-cd-results.png)
@ -23,7 +23,7 @@ Without any additional software, it can perform as:
- [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), and many others.
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 ##
@ -51,7 +51,7 @@ It can also be used as a virtual TNC for other applications such as [APRSIS32](h
IGate stations allow communication between disjoint radio networks by allowing some content to flow between them over the Internet.
- **Ham Radio of Things.**
- **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.
@ -63,7 +63,7 @@ It can also be used as a virtual TNC for other applications such as [APRSIS32](h
- **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, UI-View32, Xastir, APRS-TW,YAAC, UISS, Linux AX25, SARTrack, Winlink / RMS Express, Outpost PM, and many others.
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: ###
@ -79,7 +79,7 @@ It can also be used as a virtual TNC for other applications such as [APRSIS32](h
- **DTMF ("Touch Tone") Decoding and Encoding.**
- **Speech Synthesizer & Morse code generator.**
- **Speech Synthesizer interface & Morse code generator.**
Transmit human understandable messages.
@ -108,7 +108,7 @@ It can also be used as a virtual TNC for other applications such as [APRSIS32](h
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.
For more details see the **User Guide** in the [**doc** directory](https://github.com/wb2osz/direwolf/tree/master/doc).
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).

View File

@ -354,7 +354,12 @@ 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()
try_run(RUN_NEON COMPILE_NEON "${CMAKE_BINARY_DIR}/tmp" "${TEST_DIR}/test_arm_neon.cxx" COMPILE_DEFINITIONS -mfpu=neon -O0)
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")

View File

@ -1,529 +0,0 @@
C#############################################################
C# #
C# Configuration file for Dire Wolf #
C# #
L# Linux version #
W# Windows 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
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#
W# The complete documentation set can also be found in the doc folder.
L# The complete 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.
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#
C#
C# These are the most likely settings you might change just to get started:
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 chosing it here.
C#
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# 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
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# Starting with version 1.0, you can also use "-" or "stdin" to
L# pipe stdout from some other application such as a software defined
L# radio. "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
W# ADEVICE stdin 0
W# ADEVICE UDP:7355 0
L# ADEVICE stdin plughw:1,0
L# ADEVICE UDP:7355 default
L
L
C
C#
C# Number of audio channels for this souncard: 1 or 2.
C#
C
CACHANNELS 1
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
CCHANNEL 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
CMYCALL N0CALL
C
C#
C# Pick a suitable modem speed based on your situation.
C# 1200 Most common for VHF/UHF. Default if not specified.
C# 300 Low speed for HF SSB.
C# 9600 High speed - Can't use Microphone and Speaker connections.
C#
C# In the simplest form, just specify the speed.
C#
C
CMODEM 1200
C#MODEM 300
C#MODEM 9600
C
C#
C# These are the defaults should be fine for most cases. In special situations,
C# you might want to specify different AFSK tones or the baseband mode which does
C# not use AFSK.
C#
C#MODEM 1200 1200:2200
C#MODEM 300 1600:1800
C#MODEM 9600 0:0
C#
C#
C# On HF SSB, you might want to use multiple demodulators on slightly different
C# frequencies to compensate for stations off frequency. Here we have 7 different
C# demodulators at 30 Hz intervals. This takes a lot of CPU power so you will
C# probably need to reduce the audio sampling rate with the /n option.
C
C#MODEM 300 1600:1800 7@30 /4
C
C
C#
C# Uncomment line below to enable the DTMF decoder for this channel.
C#
C
C#DTMF
C
C#
C# If not using a VOX circuit, the transmitter Push to Talk (PTT)
C# control is usually wired to a serial port with a suitable interface circuit.
C# 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
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 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
CAGWPORT 8000
CKISSPORT 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#SERIALKISS COM3
W
W
C#
C# It is sometimes possible to recover frames with a bad FCS.
C# This applies to all channels.
C#
C# 0 [NONE] - Don't try to repair.
C# 1 [SINGLE] - Attempt to fix single bit error. (default)
C# ... see User Guide for more values and in-depth discussion.
C#
C
C#FIX_BITS 0
C
C#
C#############################################################
C# #
C# FIXED POSITION BEACONING PROPERTIES #
C# #
C#############################################################
C
C
C#
C# Fixed Position 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 two digipeater hops.
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,WIDE2-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# 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
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# 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]$ TRACE
C
C# See User Guide for more explanation of what this means and how
C# it can be customized for your particular needs.
C
C# Filtering can be used to limit was is digipeated.
C# For example, only weather weather reports, received on channel 0,
C# will be retransmitted on channel 1.
C#
C
C#FILTER 0 1 t/wn
C
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
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 options with the transmit channel number and a VIA path.
C
C#IGTXVIA 0 WIDE1-1
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
CIGTXLIMIT 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#
C
C#
C# Sample gateway configuration based on:
C#
C# http://www.aprs.org/aprstt/aprstt-coding24.txt
C# http://www.aprs.org/aprs-jamboree-2013.html
C#
C
C# Define specific points.
C
CTTPOINT B01 37^55.37N 81^7.86W
CTTPOINT B7495088 42.605237 -71.34456
CTTPOINT B934 42.605237 -71.34456
C
CTTPOINT B901 42.661279 -71.364452
CTTPOINT B902 42.660411 -71.364419
CTTPOINT B903 42.659046 -71.364452
CTTPOINT B904 42.657578 -71.364602
C
C
C# For location at given bearing and distance from starting point.
C
CTTVECTOR B5bbbddd 37^55.37N 81^7.86W 0.01 mi
C
C# For location specified by x, y coordinates.
C
CTTGRID Byyyxxx 37^50.00N 81^00.00W 37^59.99N 81^09.99W
C
C# UTM location for Lowell-Dracut-Tyngsborough State Forest.
C
CTTUTM B6xxxyyy 19T 10 300000 4720000
C
C
C
C# Location for the corral.
C
CTTCORRAL 37^55.50N 81^7.00W 0^0.02N
C
C# Compact messages - Fixed locations xx and object yyy where
C# Object numbers 100 - 199 = bicycle
C# Object numbers 200 - 299 = fire truck
C# Others = dog
C
CTTMACRO xx1yy B9xx*AB166*AA2B4C5B3B0A1yy
CTTMACRO xx2yy B9xx*AB170*AA3C4C7C3B0A2yy
CTTMACRO xxyyy B9xx*AB180*AA3A6C4A0Ayyy
C
CTTMACRO z Cz
C
C# Receive on channel 0, Transmit object reports on channel 1 with optional via path.
C
C#TTOBJ 0 1 WIDE1-1
C
C# Advertise gateway position with beacon.
C
C# 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"
C
C

View File

@ -26,8 +26,19 @@
%R% M Macintosh version and possibly others (portaudio used).
%R%
%C%#
%C%# Consult the User Guide for more details on configuration options.
%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%#
%W%# The complete documentation set can also be found in the doc folder.
%L%# The complete 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%# This sample file does not have examples for all of the possibilities.
%C%# Consult the User Guide for more details on configuration options.%C%#
%C%#
%C%# These are the most likely settings you might change:
%C%#
@ -82,6 +93,8 @@
%C%# Many people will simply use the default sound device.
%C%# Some might want to use an alternative device by choosing it here.
%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%#
@ -109,6 +122,16 @@
%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.
@ -117,17 +140,26 @@
%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%# Starting with version 1.0, you can also use "-" or "stdin" to
%L%# pipe stdout from some other application such as a software defined
%L%# radio. You can also specify "UDP:" and an optional port for input.
%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
@ -136,23 +168,26 @@
%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%#
%W%# ADEVICE - 0
%W%# ADEVICE UDP:7355 0
%L%# ADEVICE - plughw:1,0
%L%# ADEVICE UDP:7355 default
%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%#
%L%
%L%
%C%
%C%#
%C%# Number of audio channels for this soundcard: 1 or 2.
%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 1
%C%#ACHANNELS 2
%C%
%C%
@ -204,33 +239,23 @@
%C%#
%C%# Pick a suitable modem speed based on your situation.
%C%# 1200 Most common for VHF/UHF. Default if not specified.
%C%# 300 Low speed for HF SSB.
%C%# 9600 High speed - Can't use Microphone and Speaker connections.
%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 the simplest form, just specify the speed.
%C%# In most cases you can just specify the speed. Examples:
%C%#
%C%
%C%MODEM 1200
%C%#MODEM 300
%C%#MODEM 9600
%C%
%C%#
%C%# These are the defaults should be fine for most cases. In special situations,
%C%# you might want to specify different AFSK tones or the baseband mode which does
%C%# not use AFSK.
%C%# Many options are available for great flexibility.
%C%# See User Guide for details.
%C%#
%C%#MODEM 1200 1200:2200
%C%#MODEM 300 1600:1800
%C%#MODEM 9600 0:0
%C%#
%C%#
%C%# On HF SSB, you might want to use multiple demodulators on slightly different
%C%# frequencies to compensate for stations off frequency. Here we have 7 different
%C%# demodulators at 30 Hz intervals. This takes a lot of CPU power so you will
%C%# probably need to reduce the audio sampling rate with the /n option.
%C%
%C%#MODEM 300 1600:1800 7@30 /4
%C%
%C%
%C%#
%C%# Uncomment line below to enable the DTMF decoder for this channel.
@ -336,7 +361,6 @@
%C%#
%C%# 0 [NONE] - Don't try to repair.
%C%# 1 [SINGLE] - Attempt to fix single bit error. (default)
%C%# 2 [DOUBLE] - Also attempt to fix two adjacent bits.
%C%# ... see User Guide for more values and in-depth discussion.
%C%#
%C%
@ -345,7 +369,7 @@
%C%#
%C%#############################################################
%C%# #
%C%# BEACONING PROPERTIES #
%C%# FIXED POSIION BEACONING PROPERTIES #
%C%# #
%C%#############################################################
%C%
@ -397,7 +421,7 @@
%C%
%C%#############################################################
%C%# #
%C%# DIGIPEATER PROPERTIES #
%C%# APRS DIGIPEATER PROPERTIES #
%C%# #
%C%#############################################################
%C%
@ -418,6 +442,8 @@
%C%
%C%#FILTER 0 1 t/wn
%C%
%C%# Traditional connected mode packet radio uses a different
%C%# type of digipeating. See User Guide for details.
%C%
%C%#############################################################
%C%# #
@ -458,19 +484,6 @@
%C%
%C%#IGTXVIA 0 WIDE1-1
%C%
%C%# You might want to apply a filter for what packets will be obtained from the server.
%C%# Read about filters here: http://www.aprs-is.net/javaprsfilter.aspx
%C%# Example, positions and objects within 50 km of my location:
%C%
%C%#IGFILTER m/50
%C%
%C%# That is known as a server-side filter. It is processed by the IGate server.
%C%# You can also apply local filtering to limit what will be transmitted on the
%C%# RF side. For example, transmit only "messages" on channel 0 and weather
%C%# reports on channel 1.
%C%
%C%#FILTER IG 0 t/m
%C%#FILTER IG 1 t/wn
%C%
%C%# Finally, we don't want to flood the radio channel.
%C%# The IGate function will limit the number of packets transmitted

View File

@ -1,9 +1,19 @@
<title>
APRS TO-CALL VERSION NUMBERS 20 Jan 2020
APRS TO-CALL VERSION NUMBERS 13 Oct 2020
-------------------------------------------------------------------
WB4APR
</title>
<version_notes>
13 Oct 20 Added APIZCI hymTR IZCI Tracker by TA7W/OH2UDS and TA6AEU
13 Aug 20 Added APLGxx for LoRa Gateway/Digipeater
APLTxx for LoRa Tracker - OE5BPA
02 Aug 20 Added APNVxx for SQ8L's VP digi and Nodes
26 May 20 Added APY300 for Yaesu
5 May 20 added APESPG ESP SmartBeacon APRS-IS Client
APESPW ESP Weather Station APRS-IS Client
17 Apr 20 Added APGDTx for VK4FAST's Graphic Data Terminal
19 Mar 20 Added APOSW and APOSB for OpenSPOT2 and 3
20 Jan 20 Added APBT62 for BTech DMR 6x2
08 Jan 20 Added APCLUB for Brazil APRS network
06 Jan 20 Added APMQxx for Ham Radio of Things WB2OSZ
@ -106,13 +116,16 @@ a TOCALL number series:
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
APGBLN for NW5W's GoBalloon
APGDTx for VK4FAST's Graphic Data Terminal
APH APHKxx for LA1BR tracker/digipeater
APHAXn SM2APRS by PY2UEP
APHTxx HMTracker by IU0AAC
@ -121,6 +134,7 @@ a TOCALL number series:
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
@ -133,9 +147,11 @@ a TOCALL number series:
APK1xx Kenwood D700's
APK102 Kenwood D710
APKRAM KRAMstuff.com - Mark. G7LEU
APL APLIGx LightAPRS - TA2MUN and TA9OHC
APL APLGxx LoRa Gateway/Digipeater OE5BPA
APLIGx LightAPRS - TA2MUN and TA9OHC
APLQRU Charlie - QRU Server
APLMxx WA0TQG transceiver controller
APLTxx LoRa Tracker - OE5BPA
APM APMxxx MacAPRS,
APMGxx PiCrumbs and MiniGate - Alex, AB0TJ
APMIxx SQ3PLX http://microsat.com.pl/
@ -155,6 +171,7 @@ a TOCALL number series:
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
@ -162,8 +179,10 @@ a TOCALL number series:
APOLUx for OSCAR satellites for AMSAT-LU by LU9DO
APOAxx OpenAPRS - Greg Carter
APOCSG For N0AGI's APRS to POCSAG project
APOTxx Open Track
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
@ -225,11 +244,15 @@ a TOCALL number series:
APWWxx APRSISCE win32 version
APX APXnnn Xastir
APXRnn Xrouter
APY APYxxx Yeasu
APY APYxxx Yaesu Radios
APY008 Yaesu VX-8 series
APY350 Yaesu FTM-350 series
APYTxx for YagTracker
APYSxx for W2GMD's Python APRS
APY01D Yaesu FT1D series
APY02D Yaesu FT2D series
APY03D Yaesu FT3D series
APY100 Yaesu FTM-100D series
APY300 Yaesu FTM-300D series
APY350 Yaesu FTM-350 series
APY400 Yaesu FTM-400D series
APZ APZxxx Experimental
APZ247 for UPRS NR0Q
APZ0xx Xastir (old versions. See APX)

Binary file not shown.

Binary file not shown.

Binary file not shown.

View File

@ -101,9 +101,24 @@ These dive into more detail for specialized topics or typical usage scenarios.
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/dev/doc/A-Better-APRS-Packet-Demodulator-Part-1-1200-baud.pdf) ]

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

View File

@ -61,6 +61,10 @@ Data rate in bits/sec for first channel. Standard values are 300, 1200, 2400, 4
4800 bps uses 8PSK based on V.27 standard.
.P
9600 bps and up uses K9NG/G3RUH standard.
.P
AIS for ship Automatic Identification System.
.P
EAS for Emergency Alert System (EAS) Specific Area Message Encoding (SAME).
.RE
.RE
.PD
@ -81,6 +85,10 @@ Force G3RUH modem regardless of data rate.
.BI "-D " "n"
Divide audio sample by n for first channel.
.TP
.BI "-X " "n"
1 to enable FX.25 transmit.
.TP
.BI "-d " "x"
Debug options. Specify one or more of the following in place of x.
@ -112,6 +120,10 @@ h = Hamlib verbose level. Repeat for more.
m = Monitor heard station list.
.P
f = Packet filtering.
.P
x = FX.25 increase verbose level.
.P
d = APRStt (DTMF to APRS object conversion).
.RE
.RE
.PD
@ -131,7 +143,8 @@ d = Decoding of APRS packets.
.TP
.BI "-t " "n"
Text colors. 1=normal, 0=disabled.
Text colors. 0=disabled. 1=default. 2,3,4,... alternatives. Use 9 to test compatibility with your terminal.
.TP
.B "-p "
@ -153,6 +166,13 @@ Print Symbol tables and exit.
.BI "-a " "n"
Report audio device statistics each n seconds.
.TP
.BI "-T " "fmt"
Time stamp format for sent and received frames.
.TP
.BI "-e " "ber"
Receive Bit Error Rate (BER), e.g. 1e-5
.SH EXAMPLES
gqrx (2.3 and later) has the ability to send streaming audio through a UDP socket to another application for further processing.

View File

@ -44,7 +44,8 @@ RUNMODE=AUTO
DIREWOLF="direwolf"
#Direwolf start up command :: two examples where example one is enabled
#Direwolf start up command :: Uncomment only one of the examples.
#
# 1. For normal operation as TNC, digipeater, IGate, etc.
# Print audio statistics each 100 seconds for troubleshooting.
@ -52,9 +53,14 @@ DIREWOLF="direwolf"
DWCMD="$DIREWOLF -a 100"
# 2. FX.25 Forward Error Correction (FEC) will allow your signal to
# go farther under poor radio conditions. Add "-X 1" to the command line.
#DWCMD="$DIREWOLF -a 100 -X 1"
#---------------------------------------------------------------
#
# 2. Alternative for running with SDR receiver.
# 3. Alternative for running with SDR receiver.
# Piping one application into another makes it a little more complicated.
# We need to use bash for the | to be recognized.

View File

@ -115,6 +115,8 @@ static int find_ttloc_match (char *e, char *xstr, char *ystr, char *zstr, char *
static void check_result (void);
#endif
static int tt_debug = 0;
/*------------------------------------------------------------------
*
@ -122,7 +124,8 @@ static void check_result (void);
*
* Purpose: Initialize the APRStt gateway at system startup time.
*
* Inputs: Configuration options gathered by config.c.
* Inputs: P - Pointer to configuration options gathered by config.c.
* debug - Debug printing control.
*
* Global out: Make our own local copy of the structure here.
*
@ -164,9 +167,10 @@ static struct ttloc_s test_config[] = {
#endif
void aprs_tt_init (struct tt_config_s *p)
void aprs_tt_init (struct tt_config_s *p, int debug)
{
int c;
tt_debug = debug;
#if TT_MAIN
/* For unit testing. */
@ -483,7 +487,19 @@ static int parse_fields (char *msg)
//text_color_set(DW_COLOR_DEBUG);
//dw_printf ("parse_fields (%s).\n", msg);
strlcpy (stemp, msg, sizeof(stemp));
// Make a copy of msg because strtok corrupts the original.
// While we are at it, remove any blanks.
// This should not happen with DTMF reception but could happen
// in manually crafted strings for testing.
int n = 0;
for (char *m = msg; *m != '\0' && n < sizeof(stemp)-1; m++) {
if (*m != ' ') {
stemp[n++] = *m;
}
}
stemp[n] = '\0';
e = strtok_r (stemp, "*#", &save);
while (e != NULL) {
@ -551,7 +567,7 @@ static int parse_fields (char *msg)
default:
text_color_set(DW_COLOR_ERROR);
dw_printf ("Field does not start with A, B, C, or digit: \"%s\"\n", msg);
dw_printf ("Field does not start with A, B, C, or digit: \"%s\"\n", e);
return (TT_ERROR_D_MSG);
}
@ -690,17 +706,15 @@ static int expand_macro (char *e)
*
* Inputs: e - An "entry" extracted from a complete
* APRStt messsage.
* In this case, it should start with "A".
* In this case, it should start with "A" then a digit.
*
* Outputs: m_callsign
*
* m_symtab_or_overlay - Set to 0-9 or A-Z if specified.
*
* m_symbol_code - Always set to 'A'.
* NO! This should be applied only if we
* have the default value at this point.
* The symbol might have been explicitly
* set already and we don't want to overwrite that.
* m_symbol_code - Always set to 'A' (Box, DTMF or RFID)
* If you want a different symbol, use the new
* object name format and separate symbol specification.
*
* Returns: 0 for success or one of the TT_ERROR_... codes.
*
@ -752,6 +766,11 @@ static int parse_callsign (char *e)
int len;
char tttemp[40], stemp[30];
if (tt_debug) {
text_color_set(DW_COLOR_DEBUG);
dw_printf ("APRStt parse callsign (starts with A then digit): \"%s\"\n", e);
}
assert (*e == 'A');
len = strlen(e);
@ -762,6 +781,10 @@ static int parse_callsign (char *e)
if (len == 4 && isdigit(e[1]) && isdigit(e[2]) && isdigit(e[3])) {
strlcpy (m_callsign, e+1, sizeof(m_callsign));
if (tt_debug) {
text_color_set(DW_COLOR_DEBUG);
dw_printf ("Special case, 3 digit tactical call: \"%s\"\n", m_callsign);
}
return (0);
}
@ -779,7 +802,7 @@ static int parse_callsign (char *e)
return (cs_err);
}
strncpy (m_callsign, e+1, 3);
memcpy (m_callsign, e+1, 3);
m_callsign[3] = '\0';
if (len == 7) {
@ -789,10 +812,20 @@ static int parse_callsign (char *e)
tt_two_key_to_text (tttemp, 0, stemp);
m_symbol_code = APRSTT_DEFAULT_SYMBOL;
m_symtab_or_overlay = stemp[0];
if (tt_debug) {
text_color_set(DW_COLOR_DEBUG);
dw_printf ("Three digit abbreviation1: callsign \"%s\", symbol code '%c (Box DTMF)', overlay '%c', checksum %c\n",
m_callsign, m_symbol_code, m_symtab_or_overlay, e[len-1]);
}
}
else {
m_symbol_code = APRSTT_DEFAULT_SYMBOL;
m_symtab_or_overlay = e[len-2];
if (tt_debug) {
text_color_set(DW_COLOR_DEBUG);
dw_printf ("Three digit abbreviation2: callsign \"%s\", symbol code '%c' (Box DTMF), overlay '%c', checksum %c\n",
m_callsign, m_symbol_code, m_symtab_or_overlay, e[len-1]);
}
}
return (0);
}
@ -810,7 +843,7 @@ static int parse_callsign (char *e)
}
if (isupper(e[len-2])) {
strncpy (tttemp, e+1, len-4);
memcpy (tttemp, e+1, len-4);
tttemp[len-4] = '\0';
tt_two_key_to_text (tttemp, 0, m_callsign);
@ -820,14 +853,24 @@ static int parse_callsign (char *e)
tt_two_key_to_text (tttemp, 0, stemp);
m_symbol_code = APRSTT_DEFAULT_SYMBOL;
m_symtab_or_overlay = stemp[0];
if (tt_debug) {
text_color_set(DW_COLOR_DEBUG);
dw_printf ("Callsign in two key format1: callsign \"%s\", symbol code '%c' (Box DTMF), overlay '%c', checksum %c\n",
m_callsign, m_symbol_code, m_symtab_or_overlay, e[len-1]);
}
}
else {
strncpy (tttemp, e+1, len-3);
memcpy (tttemp, e+1, len-3);
tttemp[len-3] = '\0';
tt_two_key_to_text (tttemp, 0, m_callsign);
m_symbol_code = APRSTT_DEFAULT_SYMBOL;
m_symtab_or_overlay = e[len-2];
if (tt_debug) {
text_color_set(DW_COLOR_DEBUG);
dw_printf ("Callsign in two key format2: callsign \"%s\", symbol code '%c' (Box DTMF), overlay '%c', checksum %c\n",
m_callsign, m_symbol_code, m_symtab_or_overlay, e[len-1]);
}
}
return (0);
}
@ -864,9 +907,11 @@ static int parse_callsign (char *e)
static int parse_object_name (char *e)
{
int len;
//int c_length;
//char tttemp[40];
//char stemp[30];
if (tt_debug) {
text_color_set(DW_COLOR_DEBUG);
dw_printf ("APRStt parse object name (starts with AA): \"%s\"\n", e);
}
assert (e[0] == 'A');
assert (e[1] == 'A');
@ -882,6 +927,10 @@ static int parse_object_name (char *e)
if (tt_two_key_to_text (e+2, 0, m_callsign) == 0) {
m_callsign[9] = '\0'; /* truncate to 9 */
m_ssid = 0; /* No ssid for object name */
if (tt_debug) {
text_color_set(DW_COLOR_DEBUG);
dw_printf ("Object name in two key format: \"%s\"\n", m_callsign);
}
return (0);
}
}
@ -935,6 +984,11 @@ static int parse_symbol (char *e)
int nn;
char stemp[10];
if (tt_debug) {
text_color_set(DW_COLOR_DEBUG);
dw_printf ("APRStt parse symbol (starts with AB): \"%s\"\n", e);
}
assert (e[0] == 'A');
assert (e[1] == 'B');
@ -959,12 +1013,22 @@ static int parse_symbol (char *e)
case '1':
m_symtab_or_overlay = '/';
m_symbol_code = 32 + nn;
if (tt_debug) {
text_color_set(DW_COLOR_DEBUG);
dw_printf ("symbol code '%c', primary symbol table '%c'\n",
m_symbol_code, m_symtab_or_overlay);
}
return (0);
break;
case '2':
m_symtab_or_overlay = '\\';
m_symbol_code = 32 + nn;
if (tt_debug) {
text_color_set(DW_COLOR_DEBUG);
dw_printf ("symbol code '%c', alternate symbol table '%c'\n",
m_symbol_code, m_symtab_or_overlay);
}
return (0);
break;
@ -973,6 +1037,11 @@ static int parse_symbol (char *e)
if (tt_two_key_to_text (e+5, 0, stemp) == 0) {
m_symbol_code = 32 + nn;
m_symtab_or_overlay = stemp[0];
if (tt_debug) {
text_color_set(DW_COLOR_DEBUG);
dw_printf ("symbol code '%c', alternate symbol table with overlay '%c'\n",
m_symbol_code, m_symtab_or_overlay);
}
return (0);
}
}
@ -1018,6 +1087,11 @@ static int parse_aprstt3_call (char *e)
assert (e[0] == 'A');
assert (e[1] == 'C');
if (tt_debug) {
text_color_set(DW_COLOR_DEBUG);
dw_printf ("APRStt parse QIKcom-2 / APRStt 3 ten digit call or five digit suffix (starts with AC): \"%s\"\n", e);
}
if (strlen(e) == 2+10) {
char call[12];
@ -1125,6 +1199,11 @@ static int parse_location (char *e)
char mh[20];
char stemp[32];
if (tt_debug) {
text_color_set(DW_COLOR_DEBUG);
dw_printf ("APRStt parse location (starts with B): \"%s\"\n", e);
// TODO: more detail later...
}
assert (*e == 'B');
@ -1985,7 +2064,7 @@ static void check_result (void)
int main (int argc, char *argv[])
{
aprs_tt_init (NULL);
aprs_tt_init (NULL, 0);
error_count = 0;

View File

@ -165,7 +165,7 @@ struct tt_config_s {
void aprs_tt_init (struct tt_config_s *p_config);
void aprs_tt_init (struct tt_config_s *p_config, int debug);
void aprs_tt_button (int chan, char button);

View File

@ -278,6 +278,8 @@ struct audio_s {
#ifdef USE_HAMLIB
int ptt_model; /* HAMLIB model. -1 for AUTO. 2 for rigctld. Others are radio model. */
int ptt_rate; /* Serial port speed when using hamlib CAT control for PTT. */
/* If zero, hamlib will come up with a default for pariticular rig. */
#endif
} octrl[NUM_OCTYPES];

View File

@ -804,7 +804,12 @@ static void beacon_send (int j, dwgps_info_t *gpsinfo)
* src > dest [ , via ]
*/
strlcpy (beacon_text, mycall, sizeof(beacon_text));
if (bp->source != NULL) {
strlcpy (beacon_text, bp->source, sizeof(beacon_text));
}
else {
strlcpy (beacon_text, mycall, sizeof(beacon_text));
}
strlcat (beacon_text, ">", sizeof(beacon_text));
if (bp->dest != NULL) {

View File

@ -49,7 +49,7 @@
#include <stdio.h>
#include <ctype.h> /* for isdigit, isupper */
#include "regex.h"
#include <sys/unistd.h>
#include <unistd.h>
#include "ax25_pad.h"
#include "cdigipeater.h"

View File

@ -1682,8 +1682,8 @@ void config_init (char *fname, struct audio_s *p_audio_config,
* xxx serial-port [-]rts-or-dtr [ [-]rts-or-dtr ]
* xxx GPIO [-]gpio-num
* xxx LPT [-]bit-num
* PTT RIG model port
* PTT RIG AUTO port
* PTT RIG model port [ rate ]
* PTT RIG AUTO port [ rate ]
* PTT CM108 [ [-]bit-num ] [ hid-device ]
*
* When model is 2, port would host:port like 127.0.0.1:4532
@ -1808,6 +1808,19 @@ void config_init (char *fname, struct audio_s *p_audio_config,
}
strlcpy (p_audio_config->achan[channel].octrl[ot].ptt_device, t, sizeof(p_audio_config->achan[channel].octrl[ot].ptt_device));
// Optional serial port rate for CAT controll PTT.
t = split(NULL,0);
if (t != NULL) {
if ( ! alldigits(t)) {
text_color_set(DW_COLOR_ERROR);
dw_printf ("Config file line %d: An optional number is required here for CAT serial port speed: %s\n", line, t);
continue;
}
int n = atoi(t);
p_audio_config->achan[channel].octrl[ot].ptt_rate = n;
}
t = split(NULL,0);
if (t != NULL) {
text_color_set(DW_COLOR_ERROR);
@ -5260,6 +5273,8 @@ static int beacon_options(char *cmd, struct beacon_s *b, int line, struct audio_
b->freq = G_UNKNOWN;
b->tone = G_UNKNOWN;
b->offset = G_UNKNOWN;
b->source = NULL;
b->dest = NULL;
while ((t = split(NULL,0)) != NULL) {
@ -5331,6 +5346,17 @@ static int beacon_options(char *cmd, struct beacon_s *b, int line, struct audio_
b->sendto_chan = n;
}
}
else if (strcasecmp(keyword, "SOURCE") == 0) {
b->source = strdup(value);
for (p = b->source; *p != '\0'; p++) {
if (islower(*p)) {
*p = toupper(*p); /* silently force upper case. */
}
}
if (strlen(b->source) > 9) {
b->source[9] = '\0';
}
}
else if (strcasecmp(keyword, "DEST") == 0) {
b->dest = strdup(value);
for (p = b->dest; *p != '\0'; p++) {

View File

@ -160,6 +160,9 @@ struct misc_config_s {
time_t next; /* Unix time to transmit next one. */
char *source; /* NULL or explicit AX.25 source address to use */
/* instead of the mycall value for the channel. */
char *dest; /* NULL or explicit AX.25 destination to use */
/* instead of the software version such as APDW11. */

View File

@ -116,7 +116,6 @@ static void aprs_morse_code (decode_aprs_t *A, char *, int);
static void aprs_positionless_weather_report (decode_aprs_t *A, unsigned char *, int);
static void weather_data (decode_aprs_t *A, char *wdata, int wind_prefix);
static void aprs_ultimeter (decode_aprs_t *A, char *, int);
static void third_party_header (decode_aprs_t *A, char *, int);
static void decode_position (decode_aprs_t *A, position_t *ppos);
static void decode_compressed_position (decode_aprs_t *A, compressed_position_t *ppos);
static double get_latitude_8 (char *p, int quiet);
@ -197,7 +196,22 @@ void decode_aprs (decode_aprs_t *A, packet_t pp, int quiet)
A->g_footprint_lon = G_UNKNOWN;
A->g_footprint_radius = G_UNKNOWN;
// If third-party header, try to decode just the payload.
if (*pinfo == '}') {
packet_t pp_payload = ax25_from_text ((char*)pinfo+1, 0);
if (pp_payload != NULL) {
decode_aprs (A, pp_payload, quiet);
ax25_delete (pp_payload);
return;
}
else {
strlcpy (A->g_msg_type, "Third Party Header: Unable to parse payload.", sizeof(A->g_msg_type));
ax25_get_addr_with_ssid (pp, AX25_SOURCE, A->g_src);
ax25_get_addr_with_ssid (pp, AX25_DESTINATION, dest);
}
}
/*
* Extract source and destination including the SSID.
@ -362,11 +376,9 @@ void decode_aprs (decode_aprs_t *A, packet_t pp, int quiet)
aprs_morse_code (A, (char*)pinfo, info_len);
break;
case '}': /* third party header */
third_party_header (A, (char*)pinfo, info_len);
break;
//case '}': /* third party header */
// was already caught earlier.
//case '\r': /* CR or LF? */
//case '\n':
@ -380,7 +392,12 @@ void decode_aprs (decode_aprs_t *A, packet_t pp, int quiet)
/*
* Look in other locations if not found in information field.
* Priority order for determining the symbol is:
* - Information part, where appropriate. Already done above.
* - Destination field starting with GPS, SPC, or SYM.
* - Source SSID - Confusing to most people. Even I forgot about it when
* someone questioned where the symbol came from. It's in the APRS
* protocol spec, end of Chapter 20.
*/
if (A->g_symbol_table == ' ' || A->g_symbol_code == ' ') {
@ -476,6 +493,7 @@ void decode_aprs_print (decode_aprs_t *A) {
* Any example was checked for each hemihemisphere using
* http://www.amsat.org/cgi-bin/gridconv
*/
// FIXME soften language about upper case.
if (strlen(A->g_maidenhead) > 0) {
@ -2933,31 +2951,6 @@ static void aprs_ultimeter (decode_aprs_t *A, char *info, int ilen)
} /* end aprs_ultimeter */
/*------------------------------------------------------------------
*
* Function: third_party_header
*
* Purpose: Decode packet from a third party network.
*
* Inputs: info - Pointer to Information field.
* ilen - Information field length.
*
* Outputs: A->g_comment
*
* Description:
*
*------------------------------------------------------------------*/
static void third_party_header (decode_aprs_t *A, char *info, int ilen)
{
strlcpy (A->g_msg_type, "Third Party Header", sizeof(A->g_msg_type));
/* more later? */
} /* end third_party_header */
/*------------------------------------------------------------------
*
@ -3778,7 +3771,7 @@ static int data_extension_comment (decode_aprs_t *A, char *pdext)
// Dec. 2016 tocalls.txt has 153 destination addresses.
#define MAX_TOCALLS 200
#define MAX_TOCALLS 250
static struct tocalls_s {
unsigned char len;

View File

@ -67,7 +67,7 @@
/* No benefit for regular PC. */
/* Should help with microcomputer platform. */
#if 0 // not using anymore
__attribute__((hot)) __attribute__((always_inline))
static inline float z (float x, float y)
{
@ -81,6 +81,7 @@ static inline float z (float x, float y)
return (y * .941246f + x * .41f);
}
}
#endif
/* Add sample to buffer and shift the rest down. */

View File

@ -129,7 +129,8 @@ static inline float convolve (const float *__restrict__ data, const float *__res
float sum = 0.0;
int j;
#pragma GCC ivdep
//Does pragma make any difference? Annoying warning on Mac.
//#pragma GCC ivdep
for (j=0; j<filter_size; j++) {
sum += filter[j] * data[j];
}

View File

@ -62,7 +62,7 @@
#include <stdio.h>
#include <ctype.h> /* for isdigit, isupper */
#include "regex.h"
#include <sys/unistd.h>
#include <unistd.h>
#include "ax25_pad.h"
#include "digipeater.h"

View File

@ -223,6 +223,7 @@ int main (int argc, char *argv[])
int d_h_opt = 0; /* "-d h" option for hamlib debugging. Repeat for more detail */
#endif
int d_x_opt = 1; /* "-d x" option for FX.25. Default minimal. Repeat for more detail. -qx to silence. */
int aprstt_debug = 0; /* "-d d" option for APRStt (think Dtmf) debug. */
int E_tx_opt = 0; /* "-E n" Error rate % for clobbering trasmit frames. */
int E_rx_opt = 0; /* "-E Rn" Error rate % for clobbering receive frames. */
@ -288,7 +289,7 @@ int main (int argc, char *argv[])
text_color_init(t_opt);
text_color_set(DW_COLOR_INFO);
//dw_printf ("Dire Wolf version %d.%d (%s) Beta Test 4\n", MAJOR_VERSION, MINOR_VERSION, __DATE__);
dw_printf ("Dire Wolf DEVELOPMENT version %d.%d %s (%s)\n", MAJOR_VERSION, MINOR_VERSION, "G", __DATE__);
dw_printf ("Dire Wolf DEVELOPMENT version %d.%d %s (%s)\n", MAJOR_VERSION, MINOR_VERSION, "A", __DATE__);
//dw_printf ("Dire Wolf version %d.%d\n", MAJOR_VERSION, MINOR_VERSION);
@ -566,6 +567,7 @@ int main (int argc, char *argv[])
case 'h': d_h_opt++; break; // Hamlib verbose level.
#endif
case 'x': d_x_opt++; break; // FX.25
case 'd': aprstt_debug++; break; // APRStt (mnemonic Dtmf)
default: break;
}
}
@ -758,7 +760,7 @@ int main (int argc, char *argv[])
// Will make more precise in afsk demod init.
audio_config.achan[0].mark_freq = 2083; // Actually 2083.3 - logic 1.
audio_config.achan[0].space_freq = 1563; // Actually 1562.5 - logic 0.
strlcpy (audio_config.achan[0].profiles, "D", sizeof(audio_config.achan[0].profiles));
strlcpy (audio_config.achan[0].profiles, "A", sizeof(audio_config.achan[0].profiles));
}
else {
audio_config.achan[0].modem_type = MODEM_SCRAMBLE;
@ -883,7 +885,7 @@ int main (int argc, char *argv[])
* Initialize the touch tone decoder & APRStt gateway.
*/
dtmf_init (&audio_config, audio_amplitude);
aprs_tt_init (&tt_config);
aprs_tt_init (&tt_config, aprstt_debug);
tt_user_init (&audio_config, &tt_config);
/*
@ -1345,18 +1347,24 @@ void app_process_rec_packet (int chan, int subchan, int slice, packet_t pp, alev
}
/*
* If it came from DTMF decoder, send it to APRStt gateway.
* If it came from DTMF decoder (subchan == -1), send it to APRStt gateway.
* Otherwise, it is a candidate for IGate and digipeater.
*
* TODO: It would be useful to have some way to simulate touch tone
* It is also useful to have some way to simulate touch tone
* sequences with BEACON sendto=R0 for testing.
*/
if (subchan == -1) {
if (subchan == -1) { // from DTMF decoder
if (tt_config.gateway_enabled && info_len >= 2) {
aprs_tt_sequence (chan, (char*)(pinfo+1));
}
}
else if (*pinfo == 't' && info_len >= 2 && tt_config.gateway_enabled) {
// For testing.
// Would be nice to verify it was generated locally,
// not received over the air.
aprs_tt_sequence (chan, (char*)(pinfo+1));
}
else {
/* Send to Internet server if option is enabled. */
@ -1487,6 +1495,7 @@ static void usage (char **argv)
dw_printf (" h h = hamlib increase verbose level.\n");
#endif
dw_printf (" x x = FX.25 increase verbose level.\n");
dw_printf (" d d = APRStt (DTMF to APRS object translation).\n");
dw_printf (" -q Quiet (suppress output) options:\n");
dw_printf (" h h = Heard line with the audio level.\n");
dw_printf (" d d = Decoding of APRS packets.\n");
@ -1510,9 +1519,12 @@ static void usage (char **argv)
dw_printf ("\n");
#if __WIN32__
dw_printf ("Complete documentation can be found in the 'doc' folder\n");
#else
dw_printf ("Complete documentation can be found in /usr/local/share/doc/direwolf.\n");
// TODO: Could vary by platform and build options.
dw_printf ("Complete documentation can be found in /usr/local/share/doc/direwolf\n");
#endif
dw_printf ("or online at https://github.com/wb2osz/direwolf/tree/master/doc\n");
exit (EXIT_FAILURE);
}

View File

@ -59,7 +59,7 @@
// An incompatibility was introduced with version 7
// and again with 9 and again with 10.
#if GPSD_API_MAJOR_VERSION < 5 || GPSD_API_MAJOR_VERSION > 10
#if GPSD_API_MAJOR_VERSION < 5 || GPSD_API_MAJOR_VERSION > 11
#error libgps API version might be incompatible.
#endif
@ -348,6 +348,15 @@ static void * read_gpsd_thread (void *arg)
#define stupid_status status
#endif
if (s_debug >= 3) {
text_color_set(DW_COLOR_DEBUG);
dw_printf ("gpsdata: status=%d, mode=%d, lat=%.6f, lon=%.6f, track=%.1f, speed=%.1f, alt=%.0f\n",
gpsdata.stupid_status, gpsdata.fix.mode,
gpsdata.fix.latitude, gpsdata.fix.longitude,
gpsdata.fix.track, gpsdata.fix.speed, gpsdata.fix.stupid_altitude);
}
// Inform user about change in fix status.
switch (gpsdata.fix.mode) {
@ -378,23 +387,25 @@ static void * read_gpsd_thread (void *arg)
break;
}
if (gpsdata.stupid_status >= STATUS_FIX && gpsdata.fix.mode >= MODE_2D) {
info.dlat = isnan(gpsdata.fix.latitude) ? G_UNKNOWN : gpsdata.fix.latitude;
info.dlon = isnan(gpsdata.fix.longitude) ? G_UNKNOWN : gpsdata.fix.longitude;
info.track = isnan(gpsdata.fix.track) ? G_UNKNOWN : gpsdata.fix.track;
info.speed_knots = isnan(gpsdata.fix.speed) ? G_UNKNOWN : (MPS_TO_KNOTS * gpsdata.fix.speed);
// Oct. 2020 - 'status' is always zero for latest version of libgps so we can't use that anymore.
if (/*gpsdata.stupid_status >= STATUS_FIX &&*/ gpsdata.fix.mode >= MODE_2D) {
info.dlat = isfinite(gpsdata.fix.latitude) ? gpsdata.fix.latitude : G_UNKNOWN;
info.dlon = isfinite(gpsdata.fix.longitude) ? gpsdata.fix.longitude : G_UNKNOWN;
// When stationary, track is NaN which is not finite.
info.track = isfinite(gpsdata.fix.track) ? gpsdata.fix.track : G_UNKNOWN;
info.speed_knots = isfinite(gpsdata.fix.speed) ? (MPS_TO_KNOTS * gpsdata.fix.speed) : G_UNKNOWN;
if (gpsdata.fix.mode >= MODE_3D) {
info.altitude = isnan(gpsdata.fix.stupid_altitude) ? G_UNKNOWN : gpsdata.fix.stupid_altitude;
info.altitude = isfinite(gpsdata.fix.stupid_altitude) ? gpsdata.fix.stupid_altitude : G_UNKNOWN;
}
// Otherwise keep last known altitude when we downgrade from 3D to 2D fix.
// Caller knows altitude is outdated if info.fix == DWFIX_2D.
}
else {
// Keep the last known location.
// Using info.fix, the caller knows if the location is current (DWFIX_[23]D),
// last known (DWFIX_NONE), or never known (DWFIX_NOT_SEEN).
info.fix = DWFIX_NO_FIX;
}
// Otherwise keep the last known location which is better than totally lost.
// Caller knows location is outdated if info.fix == DWFIX_NO_FIX.
info.timestamp = time(NULL);
if (s_debug >= 2) {

View File

@ -81,8 +81,14 @@ typedef struct position_s {
static int set_norm_position (char symtab, char symbol, double dlat, double dlong, int ambiguity, position_t *presult)
{
// An over zealous compiler might complain about l*itude_to_str writing
// N characters plus nul to an N character field so we stick it into a
// larger temp then copy the desired number of bytes. (Issue 296)
latitude_to_str (dlat, ambiguity, presult->lat);
char stemp[16];
latitude_to_str (dlat, ambiguity, stemp);
memcpy (presult->lat, stemp, sizeof(presult->lat));
if (symtab != '/' && symtab != '\\' && ! isdigit(symtab) && ! isupper(symtab)) {
text_color_set(DW_COLOR_ERROR);
@ -90,7 +96,8 @@ static int set_norm_position (char symtab, char symbol, double dlat, double dlon
}
presult->sym_table_id = symtab;
longitude_to_str (dlong, ambiguity, presult->lon);
longitude_to_str (dlong, ambiguity, stemp);
memcpy (presult->lon, stemp, sizeof(presult->lon));
if (symbol < '!' || symbol > '~') {
text_color_set(DW_COLOR_ERROR);

View File

@ -55,7 +55,11 @@
* ambiguity - If 1, 2, 3, or 4, blank out that many trailing digits.
*
* Outputs: slat - String in format ddmm.mm[NS]
* Should always be exactly 8 characters + NUL.
* Must always be exactly 8 characters + NUL.
* Put in leading zeros if necessary.
* We must have exactly ddmm.mm and hemisphere because
* the APRS position report has fixed width fields.
* Trailing digits can be blanked for position ambiguity.
*
* Returns: None
*
@ -101,6 +105,12 @@ void latitude_to_str (double dlat, int ambiguity, char *slat)
ideg = (int)dlat;
dmin = (dlat - ideg) * 60.;
// dmin is known to be in range of 0 <= dmin < 60.
// Minutes must be exactly like 99.99 with leading zeros,
// if needed, to make it fixed width.
// Two digits, decimal point, two digits, nul terminator.
snprintf (smin, sizeof(smin), "%05.2f", dmin);
/* Due to roundoff, 59.9999 could come out as "60.00" */
if (smin[0] == '6') {
@ -108,6 +118,9 @@ void latitude_to_str (double dlat, int ambiguity, char *slat)
ideg++;
}
// Assumes slat can hold 8 characters + nul.
// Degrees must be exactly 2 digits, with leading zero, if needed.
sprintf (slat, "%02d%s%c", ideg, smin, hemi);
if (ambiguity >= 1) {
@ -135,9 +148,12 @@ void latitude_to_str (double dlat, int ambiguity, char *slat)
* Inputs: dlong - Floating point degrees.
* ambiguity - If 1, 2, 3, or 4, blank out that many trailing digits.
*
* Outputs: slat - String in format dddmm.mm[NS]
* Should always be exactly 9 characters + NUL.
*
* Outputs: slong - String in format dddmm.mm[NS]
* Must always be exactly 9 characters + NUL.
* Put in leading zeros if necessary.
* We must have exactly dddmm.mm and hemisphere because
* the APRS position report has fixed width fields.
* Trailing digits can be blanked for position ambiguity.
* Returns: None
*
*----------------------------------------------------------------*/
@ -178,7 +194,11 @@ void longitude_to_str (double dlong, int ambiguity, char *slong)
ideg++;
}
// Assumes slong can hold 9 characters + nul.
// Degrees must be exactly 3 digits, with leading zero, if needed.
sprintf (slong, "%03d%s%c", ideg, smin, hemi);
/*
* The spec says position ambiguity in latitude also
* applies to longitude automatically.
@ -903,6 +923,14 @@ int main (int argc, char *argv[])
latitude_to_str (45.999830, 4, result);
if (strcmp(result, "45 . N") != 0) { errors++; dw_printf ("Error 1.8: Did not expect \"%s\"\n", result); }
// Test for leading zeros for small values. Result must be fixed width.
latitude_to_str (0.016666666, 0, result);
if (strcmp(result, "0001.00N") != 0) { errors++; dw_printf ("Error 1.9: Did not expect \"%s\"\n", result); }
latitude_to_str (-1.999999, 0, result);
if (strcmp(result, "0200.00S") != 0) { errors++; dw_printf ("Error 1.10: Did not expect \"%s\"\n", result); }
/* Longitude to APRS format. */
longitude_to_str (45.25, 0, result);
@ -931,6 +959,15 @@ int main (int argc, char *argv[])
longitude_to_str (45.999830, 4, result);
if (strcmp(result, "045 . E") != 0) { errors++; dw_printf ("Error 2.8: Did not expect \"%s\"\n", result); }
// Test for leading zeros for small values. Result must be fixed width.
longitude_to_str (0.016666666, 0, result);
if (strcmp(result, "00001.00E") != 0) { errors++; dw_printf ("Error 2.9: Did not expect \"%s\"\n", result); }
longitude_to_str (-1.999999, 0, result);
if (strcmp(result, "00200.00W") != 0) { errors++; dw_printf ("Error 2.10: Did not expect \"%s\"\n", result); }
/* Compressed format. */
/* Protocol spec example has <*e7 but I got <*e8 due to rounding rather than truncation to integer. */

View File

@ -70,7 +70,7 @@ static const struct morse_s {
{ 'F', "..-." },
{ 'G', "--." },
{ 'H', "...." },
{ 'I', "." },
{ 'I', ".." },
{ 'J', ".---" },
{ 'K', "-.-" },
{ 'L', ".-.." },

View File

@ -91,7 +91,7 @@
#include <string.h>
#include <assert.h>
#include <stdio.h>
#include <sys/unistd.h>
#include <unistd.h>
#include "ax25_pad.h"
#include "textcolor.h"

View File

@ -1298,7 +1298,7 @@ static int filt_s (pfstate_t *pf)
*
*
* "time" is maximum number of minutes since message addressee was last heard.
* This is required.
* This is required. APRS-IS uses 3 hours so that would be a good value here.
*
* "hops" is maximum number of digpeater hops. (i.e. 0 for heard directly).
* If hops is not specified, the maximum transmit digipeater hop count,
@ -1309,8 +1309,8 @@ static int filt_s (pfstate_t *pf)
* Examples:
* i/60/0 Heard in past 60 minutes directly.
* i/45 Past 45 minutes, default max digi hops.
* i/30/3 Default time, max 3 digi hops.
* i/30/8/42.6/-71.3/50.
* i/180/3 Default time (3 hours), max 3 digi hops.
* i/180/8/42.6/-71.3/50.
*
*
* It only makes sense to use this for the IS>RF direction.
@ -1321,6 +1321,10 @@ static int filt_s (pfstate_t *pf)
* position report from the sender of the "message."
* That is done somewhere else. We are not concerned with it here.
*
* IMHO, the rules here are too restrictive.
*
* FIXME -explain
*
*------------------------------------------------------------------------------*/
static int filt_i (pfstate_t *pf)
@ -1329,7 +1333,15 @@ static int filt_i (pfstate_t *pf)
char *cp;
char sep[2];
char *v;
int heardtime = 30;
// http://lists.tapr.org/pipermail/aprssig_lists.tapr.org/2020-July/048656.html
// Default of 3 hours should be good.
// One might question why to have a time limit at all. Messages are very rare
// the the APRS-IS wouldn't be sending it to me unless the addressee was in the
// vicinity recently.
// TODO: Should produce a warning if a user specified filter does not include "i".
int heardtime = 180; // 3 hours * 60 min/hr = 180 minutes
#if PFTEST
int maxhops = 2;
#else
@ -1466,7 +1478,7 @@ static int filt_i (pfstate_t *pf)
*
* Maybe we could compromise here and say the sender must have been heard directly.
* It sent the message currently being processed so we must have heard it very recently, i.e. in
* the past minute, rather than the usual 30 or 60 minutes for the addressee.
* the past minute, rather than the usual 180 minutes for the addressee.
*/
was_heard = mheard_was_recently_nearby ("source", src, 1, 0, G_UNKNOWN, G_UNKNOWN, G_UNKNOWN);

View File

@ -984,10 +984,20 @@ void ptt_init (struct audio_s *audio_config_p)
/* For "AUTO" model, try to guess what is out there. */
if (audio_config_p->achan[ch].octrl[ot].ptt_model == -1) {
hamlib_port_t hport;
hamlib_port_t hport; // http://hamlib.sourceforge.net/manuals/1.2.15/structhamlib__port__t.html
memset (&hport, 0, sizeof(hport));
strlcpy (hport.pathname, audio_config_p->achan[ch].octrl[ot].ptt_device, sizeof(hport.pathname));
if (audio_config_p->achan[ch].octrl[ot].ptt_rate > 0) {
// Override the default serial port data rate.
hport.parm.serial.rate = audio_config_p->achan[ch].octrl[ot].ptt_rate;
hport.parm.serial.data_bits = 8;
hport.parm.serial.stop_bits = 1;
hport.parm.serial.parity = RIG_PARITY_NONE;
hport.parm.serial.handshake = RIG_HANDSHAKE_NONE;
}
rig_load_all_backends();
audio_config_p->achan[ch].octrl[ot].ptt_model = rig_probe(&hport);
@ -1011,6 +1021,29 @@ void ptt_init (struct audio_s *audio_config_p)
}
strlcpy (rig[ch][ot]->state.rigport.pathname, audio_config_p->achan[ch].octrl[ot].ptt_device, sizeof(rig[ch][ot]->state.rigport.pathname));
// Issue 290.
// We had a case where hamlib defaulted to 9600 baud for a particular
// radio model but 38400 was needed. Add an option for the configuration
// file to override the hamlib default speed.
text_color_set(DW_COLOR_INFO);
if (audio_config_p->achan[ch].octrl[ot].ptt_model != 2) { // 2 is network, not serial port.
dw_printf ("Hamlib determined CAT control serial port rate of %d.\n", rig[ch][ot]->state.rigport.parm.serial.rate);
}
// Config file can optionally override the rate that hamlib came up with.
if (audio_config_p->achan[ch].octrl[ot].ptt_rate > 0) {
dw_printf ("User configuration overriding hamlib CAT control speed to %d.\n", audio_config_p->achan[ch].octrl[ot].ptt_rate);
rig[ch][ot]->state.rigport.parm.serial.rate = audio_config_p->achan[ch].octrl[ot].ptt_rate;
// Do we want to explicitly set all of these or let it default?
rig[ch][ot]->state.rigport.parm.serial.data_bits = 8;
rig[ch][ot]->state.rigport.parm.serial.stop_bits = 1;
rig[ch][ot]->state.rigport.parm.serial.parity = RIG_PARITY_NONE;
rig[ch][ot]->state.rigport.parm.serial.handshake = RIG_HANDSHAKE_NONE;
}
int err = rig_open(rig[ch][ot]);
if (err != RIG_OK) {
text_color_set(DW_COLOR_ERROR);

View File

@ -495,7 +495,7 @@ void symbols_list (void)
}
}
dw_printf ("\n");
dw_printf ("More information here: http://www.aprs.org/symbols.html\n");
} /* end symbols_list */
@ -659,6 +659,8 @@ void symbols_from_dest_or_src (char dti, char *src, char *dest, char *symtab, ch
/*
* When all else fails, use source SSID.
* This is totally non-obvious and confusing, but it is in the APRS protocol spec.
* Chapter 20, "Symbol in the Source Address SSID"
*/
p = strchr (src, '-');