]> code.octet-stream.net Git - m17rt/blobdiff - m17app/src/link_setup.rs
Document reflector destination call
[m17rt] / m17app / src / link_setup.rs
index 007dc78fc3b2338cf6a9cd57734648c6d28856a5..2e960a718017f9fd01ded26ad4d4451149dfeadd 100644 (file)
@@ -1,7 +1,7 @@
 use std::fmt::Display;
 
 use m17core::{
-    address::{Address, Callsign, ALPHABET},
+    address::{ALPHABET, Address, Callsign},
     protocol::LsfFrame,
 };
 
@@ -17,6 +17,14 @@ impl LinkSetup {
         Self { raw: frame }
     }
 
+    pub fn source(&self) -> M17Address {
+        M17Address(self.raw.source())
+    }
+
+    pub fn destination(&self) -> M17Address {
+        M17Address(self.raw.destination())
+    }
+
     /// Set up an unencrypted voice stream with channel access number 0 and the given source and destination.
     pub fn new_voice(source: &M17Address, destination: &M17Address) -> Self {
         Self {
@@ -44,7 +52,7 @@ impl LinkSetup {
 
 /// Station address. High level version of `Address` from core.
 
-#[derive(Debug, Clone)]
+#[derive(Debug, Clone, PartialEq, Eq)]
 pub struct M17Address(Address);
 
 impl M17Address {
@@ -71,7 +79,7 @@ impl M17Address {
         Ok(Self(Address::Callsign(Callsign(address))))
     }
 
-    pub(crate) fn address(&self) -> &Address {
+    pub fn address(&self) -> &Address {
         &self.0
     }
 }