Expand description
A pure Rust parser and encoder for APRS packets.
FRAP is a Rust port of Ham::APRS::FAP.
It parses TNC2/APRS-IS packets from UTF-8 strings or raw byte slices without
native dependencies. The original bytes are retained even when a payload
contains text that is not valid UTF-8.
§Parsing
parse returns an owned Packet. Its Packet::body is a
PacketBody variant describing the concrete APRS information field.
use frap::{PacketBody, parse};
let packet = parse("2W0FWJ>APRS:>FRAP example")?;
assert_eq!(packet.source, "2W0FWJ");
assert!(matches!(packet.body, PacketBody::Status { .. }));Use parse_ref on hot paths to borrow envelope fields from the input.
Call PacketRef::into_owned when the packet must outlive that input.
ParseOptions enables strict AX.25 validation and damaged Mic-E recovery.
§Encoding and utilities
The crate encodes messages, objects, positions, and timestamps. It also provides KISS/TNC2 conversion, duplicate-detection helpers, geographic calculations, callsign validation, and APRS-IS passcode calculation.
§Optional APRS-IS client
Enable the aprs-is feature to expose AprsIsConnection, an asynchronous
Tokio-based APRS-IS client. Parsing itself does not require an async runtime.
Structs§
- Aprs
IsConnection aprs-is - An asynchronous APRS-IS connection.
- Aprs
Timestamp - A decoded APRS timestamp.
- Digipeater
- An owned digipeater path component.
- Digipeater
Ref - A digipeater path component that may borrow its callsign from the input.
- Encode
Object Options - Options controlling APRS object information-field encoding.
- Encode
Position Options - Options controlling APRS position information-field encoding.
- Message
- An APRS message or telemetry metadata message.
- Packet
- Fully owned parsed APRS packet.
- Packet
Ref - Parsed APRS packet borrowing envelope fields from its input where possible.
- Parse
Error - A parse error with a stable code and a specific explanation.
- Parse
Options - Options controlling parser validation and compatibility recovery.
- Position
Report - Position-related data shared by locations, objects, and items.
- Telemetry
- Decoded APRS telemetry values.
- Weather
- Decoded APRS weather measurements.
Enums§
- Error
Code - Stable, machine-readable parse failure categories.
- Format
- Position encoding found in an APRS packet.
- Packet
Body - Parsed APRS information field, represented by its concrete wire type.
- Packet
Type - High-level APRS packet classification.
- Timestamp
Format - APRS timestamp representation produced by
encode_timestamp.
Functions§
- aprs_
duplicate_ parts - Extract the innermost source, destination base call, and payload used for APRS duplicate detection.
- aprs_
passcode - Compute the APRS-IS authentication passcode for a callsign.
- check_
ax25_ call - Validate and normalize an AX.25 callsign (
CALLorCALL-SSID). - count_
digihops - Estimate the number of digipeated hops represented by a TNC2 header.
- direction
- Initial bearing in degrees from the first position to the second.
- distance
- Great-circle distance in kilometres between two decimal-degree positions.
- encode_
message - Encode an APRS message information field.
- encode_
object - Encode an APRS object information field.
- encode_
position - Encode an APRS position information field.
- encode_
timestamp - Create a UTC APRS timestamp from Unix seconds.
- kiss_
to_ tnc2 - Convert a single-port KISS data frame to a TNC2 UI frame.
- make_
object - FAP-compatible name for
encode_object. - make_
position - FAP-compatible name for
encode_position. - make_
timestamp - FAP-compatible name for
encode_timestamp. - mice_
mbits_ to_ message - FAP-compatible name for
mice_message. Convert Mic-E message bits to their standard status text. - mice_
message - Convert Mic-E message bits to their standard status text.
- parse
- Parse a TNC2/APRS-IS packet into an owned
Packet. - parse_
ref - Parse a packet while borrowing input-backed fields whenever possible.
- parse_
ref_ with_ options - Parse a borrowed packet with explicit parser options.
- parse_
with_ options - Parse a TNC2/APRS-IS packet into an owned
Packetusingoptions. - tnc2_
to_ kiss - Convert a TNC2 UI frame to a complete single-port KISS data frame.