Crate aprs

Crate aprs 

Source
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 (HamHUD formula), 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

Structs§

AprsDataExtension
Parsed APRS data extensions from the position comment field.
AprsItem
An APRS item report (data type ) ).
AprsMessage
An APRS message (data type :) addressed to a specific station or group.
AprsMessenger
Manages APRS message send/receive with automatic ack/retry.
AprsObject
An APRS object report (data type ;).
AprsPacket
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.
AprsPosition
A parsed APRS position report.
AprsStatus
An APRS status report (data type >).
AprsSymbol
A full APRS symbol (table selector + 1-byte code).
AprsTelemetry
Parsed APRS telemetry report.
AprsWeather
An APRS weather report.
Course
A course-over-ground value, validated to 0..=360 degrees.
DigipeaterAlias
A typed digipeater alias.
DigipeaterConfig
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].
MessageId
An APRS message identifier: 1 to 5 alphanumeric characters.
MessengerConfig
Configuration knobs for the APRS messenger.
ParseContext
Diagnostic context for a parse failure.
Phg
Power-Height-Gain-Directivity data (APRS101 Chapter 7).
SmartBeaconing
SmartBeaconing algorithm for adaptive APRS position beacon timing.
SmartBeaconingConfig
Configuration for the SmartBeaconing algorithm.
StationEntry
A single station’s latest state.
StationList
Tracks APRS stations heard on the network.
TelemetryParameters
5 analog + 8 digital channel labels used by both PARM. and UNIT..
Tocall
An APRS “tocall” — the destination callsign used to identify the originating software or device.

Enums§

AprsData
A parsed APRS data frame, covering all major APRS data types.
AprsError
Errors produced by APRS parsing, building, and stateful algorithms.
AprsQuery
Parsed APRS query.
AprsTimestamp
An APRS timestamp as used by object and position-with-timestamp reports (APRS 1.0.1 §6.1).
BeaconReason
Reason a SmartBeacon was triggered at a given moment.
BeaconState
SmartBeaconing runtime state.
DigiAction
Result of digipeater processing.
MessageKind
APRS message kind (per APRS 1.0.1 §14 and bulletin sections).
MiceMessage
Mic-E standard message code.
PositionAmbiguity
APRS position ambiguity level (APRS 1.0.1 §8.1.6).
Speed
A ground-speed measurement with explicit units.
SymbolTable
An APRS symbol table selector.
TelemetryDefinition
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::default is 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_item but returns the unencoded [Ax25Packet].
build_aprs_message
Build a KISS-encoded APRS message packet.
build_aprs_message_checked
Like build_aprs_message but 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_message but 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 MiceMessage status code.
build_aprs_mice_with_message_packet
Like build_aprs_mice_with_message but 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_timestamp but 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_compressed but 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_report but 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_weather but returns the unencoded [Ax25Packet].
build_aprs_status
Build a KISS-encoded APRS status report.
build_aprs_status_packet
Like build_aprs_status but returns the unencoded [Ax25Packet].
build_aprs_weather
Build a KISS-encoded positionless APRS weather report.
build_aprs_weather_packet
Like build_aprs_weather but 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 (?APRSx or ?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.