AprsClientConfig

Struct AprsClientConfig 

Source
#[non_exhaustive]
pub struct AprsClientConfig {
Show 14 fields pub callsign: String, pub ssid: u8, pub symbol_table: char, pub symbol_code: char, pub baud: TncBaud, pub beacon_comment: String, pub smart_beaconing: SmartBeaconingConfig, pub digipeater: Option<DigipeaterConfig>, pub max_stations: usize, pub station_timeout_secs: u64, pub auto_ack: bool, pub digipeater_path: Vec<Ax25Address>, pub auto_query_response: bool, pub auto_query_position: Option<(f64, f64)>,
}
Expand description

Configuration for an AprsClient session.

Created with AprsClientConfig::new which provides sensible defaults for a mobile station. All fields are public for customisation before passing to AprsClient::start. Marked #[non_exhaustive] so future optional fields can be added without breaking the API.

Fields (Non-exhaustive)§

This struct is marked as non-exhaustive
Non-exhaustive structs could have additional fields added in future. Therefore, non-exhaustive structs cannot be constructed in external crates using the traditional Struct { .. } syntax; cannot be matched against without a wildcard ..; and struct update syntax will not work.
§callsign: String

Station callsign (e.g., "N0CALL").

§ssid: u8

SSID (0-15). Common values: 7 = handheld, 9 = mobile, 15 = generic.

§symbol_table: char

APRS primary symbol table character. Default: '/'.

§symbol_code: char

APRS symbol code character. Default: '>' (car).

§baud: TncBaud

TNC data speed. Default: 1200 bps (AFSK).

§beacon_comment: String

Default comment appended to position beacons.

§smart_beaconing: SmartBeaconingConfig

SmartBeaconing algorithm configuration.

§digipeater: Option<DigipeaterConfig>

Optional digipeater configuration. When set, incoming packets are evaluated for relay according to the digipeater rules.

§max_stations: usize

Maximum number of stations to track. Default: 500.

§station_timeout_secs: u64

Seconds before a station entry expires. Default: 3600 (1 hour).

§auto_ack: bool

Automatically acknowledge incoming messages addressed to us. Default: true.

§digipeater_path: Vec<Ax25Address>

Digipeater path for outgoing packets.

Default: WIDE1-1,WIDE2-1 (standard 2-hop path). Use an empty vector for direct transmission with no digipeating. Parse from a string with crate::aprs::parse_digipeater_path.

§auto_query_response: bool

Automatically respond to ?APRSP position queries addressed to us.

When set and an incoming message contains ?APRSP, the client sends a position beacon in response. Requires auto_query_position to be set.

Default: true.

§auto_query_position: Option<(f64, f64)>

Cached position for auto query responses, as (lat, lon).

When None, query responses are not sent even if auto_query_response is true. Update via AprsClient::set_query_response_position.

Implementations§

Source§

impl AprsClientConfig

Source

pub fn new(callsign: &str, ssid: u8) -> Self

Create a new configuration with sensible defaults for a mobile station.

  • Symbol: car (/>)
  • Baud: 1200 bps (standard APRS AFSK)
  • SmartBeaconing: TH-D75 defaults (Menu 540-547)
  • Max stations: 500, timeout: 1 hour
  • Auto-ack: on
Source

pub fn builder(callsign: &str, ssid: u8) -> AprsClientConfigBuilder

Start building a configuration with the fluent builder.

Example:

use kenwood_thd75::AprsClientConfig;
let config = AprsClientConfig::builder("N0CALL", 9)
    .symbol('/', '>')
    .beacon_comment("mobile")
    .auto_ack(true)
    .build()
    .expect("valid callsign and symbol");

Trait Implementations§

Source§

impl Clone for AprsClientConfig

Source§

fn clone(&self) -> AprsClientConfig

Returns a duplicate of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for AprsClientConfig

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

§

impl<T> Instrument for T

§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided [Span], returning an Instrumented wrapper. Read more
§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<T> WithSubscriber for T

§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a [WithDispatch] wrapper. Read more
§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a [WithDispatch] wrapper. Read more