Expand description
APRS (Automatic Packet Reporting System) protocol stack.
This crate provides a std-only, sans-io implementation of the APRS
protocol over AX.25, including the core stateful algorithms used by
real APRS clients: digipeater path handling, SmartBeaconing, messaging
ack/rej tracking, and heard-station lists.
§Scope
- APRS 1.0.1 / 1.2 info-field parsing: position (compressed and uncompressed), Mic-E, messages, status, weather, telemetry, items, objects, queries.
- Builders for constructing outgoing info fields.
- Stateful algorithms:
DigipeaterConfig(with 30s dup cache and viscous delay),SmartBeaconing(HamHUDformula),AprsMessenger(ack/rej + retry),StationList(heard-station DB with expiry).
§Time handling
This crate is sans-io and never calls std::time::Instant::now().
Every stateful method accepts a now: Instant parameter; callers
in the tokio shell layer (e.g. kenwood-thd75::aprs::AprsClient)
read the wall clock once per iteration and thread it down.
§References
- APRS 1.0.1: http://www.aprs.org/doc/APRS101.PDF
- APRS 1.2: http://www.aprs.org/aprs12.html
Structs§
- Aprs
Data Extension - Parsed APRS data extensions from the position comment field.
- Aprs
Item - An APRS item report (data type
)). - Aprs
Message - An APRS message (data type
:) addressed to a specific station or group. - Aprs
Messenger - Manages APRS message send/receive with automatic ack/retry.
- Aprs
Object - An APRS object report (data type
;). - Aprs
Packet - A parsed APRS packet. Currently just a thin wrapper over
AprsData; future extensions may add envelope-level fields (source callsign, digipeater path) if the APRS layer ever owns the AX.25 context. - Aprs
Position - A parsed APRS position report.
- Aprs
Status - An APRS status report (data type
>). - Aprs
Symbol - A full APRS symbol (table selector + 1-byte code).
- Aprs
Telemetry - Parsed APRS telemetry report.
- Aprs
Weather - An APRS weather report.
- Course
- A course-over-ground value, validated to
0..=360degrees. - Digipeater
Alias - A typed digipeater alias.
- Digipeater
Config - Digipeater configuration.
- Fahrenheit
- Temperature in degrees Fahrenheit as used by APRS weather reports.
- Latitude
- Geographic latitude in decimal degrees, validated to
[-90.0, 90.0]. - Longitude
- Geographic longitude in decimal degrees, validated to
[-180.0, 180.0]. - Message
Id - An APRS message identifier: 1 to 5 alphanumeric characters.
- Messenger
Config - Configuration knobs for the APRS messenger.
- Parse
Context - Diagnostic context for a parse failure.
- Phg
- Power-Height-Gain-Directivity data (APRS101 Chapter 7).
- Smart
Beaconing SmartBeaconingalgorithm for adaptive APRS position beacon timing.- Smart
Beaconing Config - Configuration for the
SmartBeaconingalgorithm. - Station
Entry - A single station’s latest state.
- Station
List - Tracks APRS stations heard on the network.
- Telemetry
Parameters - 5 analog + 8 digital channel labels used by both
PARM.andUNIT.. - Tocall
- An APRS “tocall” — the destination callsign used to identify the originating software or device.
Enums§
- Aprs
Data - A parsed APRS data frame, covering all major APRS data types.
- Aprs
Error - Errors produced by APRS parsing, building, and stateful algorithms.
- Aprs
Query - Parsed APRS query.
- Aprs
Timestamp - An APRS timestamp as used by object and position-with-timestamp reports (APRS 1.0.1 §6.1).
- Beacon
Reason - Reason a
SmartBeaconwas triggered at a given moment. - Beacon
State SmartBeaconingruntime state.- Digi
Action - Result of digipeater processing.
- Message
Kind - APRS message kind (per APRS 1.0.1 §14 and bulletin sections).
- Mice
Message - Mic-E standard message code.
- Position
Ambiguity - APRS position ambiguity level (APRS 1.0.1 §8.1.6).
- Speed
- A ground-speed measurement with explicit units.
- Symbol
Table - An APRS symbol table selector.
- Telemetry
Definition - Telemetry parameter definitions sent as APRS messages.
Constants§
- DEFAULT_
DEDUP_ TTL - Default rolling dedup window for digipeater retransmission suppression.
- DEFAULT_
VISCOUS_ DELAY - Default viscous delay for fill-in digipeaters.
- INCOMING_
DEDUP_ WINDOW - How long an incoming message’s
(source, msgno)stays in the dedup cache before being purged. - MAX_
APRS_ MESSAGE_ TEXT_ LEN - Maximum APRS message text length in bytes (APRS 1.0.1 §14).
- MAX_
RETRIES - Maximum number of transmission attempts per message before giving up
(the default used when
MessengerConfig::defaultis in play). - RETRY_
INTERVAL - Default interval between retry attempts.
Functions§
- build_
aprs_ item - Build a KISS-encoded APRS item report.
- build_
aprs_ item_ packet - Like
build_aprs_itembut returns the unencoded [Ax25Packet]. - build_
aprs_ message - Build a KISS-encoded APRS message packet.
- build_
aprs_ message_ checked - Like
build_aprs_messagebut returns an error when the text exceeds the APRS 1.0.1 67-byte limit instead of silently truncating. - build_
aprs_ message_ packet - Like
build_aprs_messagebut returns the unencoded [Ax25Packet]. - build_
aprs_ mice - Build a Mic-E encoded APRS position report for KISS transmission.
- build_
aprs_ mice_ with_ message - Build a Mic-E encoded APRS position report with a specific
MiceMessagestatus code. - build_
aprs_ mice_ with_ message_ packet - Like
build_aprs_mice_with_messagebut returns the unencoded [Ax25Packet] for callers that want to inspect or route it. - build_
aprs_ object - Build a KISS-encoded APRS object report.
- build_
aprs_ object_ with_ timestamp - Build a KISS-encoded APRS object report with a caller-supplied timestamp.
- build_
aprs_ object_ with_ timestamp_ packet - Like
build_aprs_object_with_timestampbut returns the unencoded [Ax25Packet] for callers that want to inspect or route it. - build_
aprs_ position_ compressed - Build a KISS-encoded APRS compressed position report.
- build_
aprs_ position_ compressed_ packet - Like
build_aprs_position_compressedbut returns the unencoded [Ax25Packet]. - build_
aprs_ position_ report - Build a KISS-encoded APRS uncompressed position report.
- build_
aprs_ position_ report_ packet - Like
build_aprs_position_reportbut returns the unencoded [Ax25Packet] so callers can inspect, log, or route it before wrapping it in KISS framing. - build_
aprs_ position_ weather - Build a combined APRS position + weather report as a single KISS frame, per APRS 1.0.1 §12.1.
- build_
aprs_ position_ weather_ packet - Like
build_aprs_position_weatherbut returns the unencoded [Ax25Packet]. - build_
aprs_ status - Build a KISS-encoded APRS status report.
- build_
aprs_ status_ packet - Like
build_aprs_statusbut returns the unencoded [Ax25Packet]. - build_
aprs_ weather - Build a KISS-encoded positionless APRS weather report.
- build_
aprs_ weather_ packet - Like
build_aprs_weatherbut returns the unencoded [Ax25Packet]. - build_
query_ response_ position - Build a position query response as a KISS-encoded APRS position report.
- classify_
ack_ rej - Classify a message text as an APRS ack or rej control frame.
- decode_
base91_ 4 - Decode a 4-byte base-91 value.
- extract_
position_ weather - Try to extract weather data embedded in a position report’s comment.
- mice_
message_ bits - Map a Mic-E standard message code to its 3-bit
(A, B, C)encoding. - parse_
aprs_ data - Parse any APRS data frame from an AX.25 information field.
- parse_
aprs_ data_ full - Parse any APRS data frame, including Mic-E types that require the AX.25 destination address.
- parse_
aprs_ extensions - Parse data extensions from an APRS position comment string.
- parse_
aprs_ item - Parse an APRS item report (
)name!pos...or)name_pos...). - parse_
aprs_ message - Parse an APRS message (
:ADDRESSEE:text{id). - parse_
aprs_ object - Parse an APRS object report (
;name_____*DDHHMMzpos...). - parse_
aprs_ position - Parse an APRS position report from an AX.25 information field.
- parse_
aprs_ query - Parse an APRS query (
?APRSxor?text). - parse_
aprs_ status - Parse an APRS status report (
>text). - parse_
aprs_ telemetry - Parse an APRS telemetry report (
T#seq,v1,v2,v3,v4,v5,dddddddd). - parse_
aprs_ weather_ positionless - Parse a positionless APRS weather report (
_MMDDHHMMdata). - parse_
compressed_ body - Parse compressed APRS position body (APRS101.PDF Chapter 9).
- parse_
mice_ position - Parse a Mic-E encoded APRS position (APRS101.PDF Chapter 10).
- parse_
uncompressed_ body - Parse uncompressed APRS position body.