aprs_is/events.rs
1//! Events emitted by the APRS-IS client.
2
3/// An event from the APRS-IS server.
4#[derive(Debug, Clone, PartialEq, Eq)]
5pub enum AprsIsEvent {
6 /// An APRS packet line was received (not a comment).
7 ///
8 /// The line is stripped of trailing `\r\n`. Parse with the standard
9 /// APRS parsers in the `aprs` crate after splitting
10 /// source/dest/path/data.
11 Packet(String),
12
13 /// A server comment line was received (starts with `#`).
14 ///
15 /// Comments carry server info, login responses, and keepalives.
16 /// The line is stripped of trailing `\r\n`.
17 Comment(String),
18
19 /// The server accepted the login (`# logresp ... verified, server ...`).
20 ///
21 /// Emitted the first time a `logresp` line confirming `verified` is
22 /// seen. `server` is the upstream server's hostname extracted from
23 /// the comment, if present.
24 LoggedIn {
25 /// APRS-IS server hostname from the `logresp` line (e.g. `T2TEST`).
26 server: Option<String>,
27 },
28
29 /// The server rejected the login (`# logresp ... unverified`).
30 ///
31 /// Emitted when the passcode does not validate for the given
32 /// callsign. `reason` carries the full comment text for diagnosis.
33 LoginRejected {
34 /// Raw reason text from the server's `logresp` line.
35 reason: String,
36 },
37
38 /// The TCP connection was closed (EOF from server).
39 Disconnected,
40}