diff --git a/src/whisker/destination.rs b/src/whisker/destination.rs index 516d7b7cf0eef7f86d848a1fe1a1e27b999fa5f9..de5f9d5ce803c582a3aaf657c65a87fb760e8dc9 100644 --- a/src/whisker/destination.rs +++ b/src/whisker/destination.rs @@ -36,7 +36,7 @@ impl Destination { } pub fn ack_num(&self) -> u8 { - self.ack + self.ack & !(1 << 7) } pub fn callsign(&self) -> &str { diff --git a/src/whisker/mod.rs b/src/whisker/mod.rs index 6a63f96a4b2d37ff8a097597a64eff9820acd489..6be118b79b65f9cb84ce961d5839d8a381274ec9 100644 --- a/src/whisker/mod.rs +++ b/src/whisker/mod.rs @@ -496,6 +496,15 @@ mod tests { assert_eq!(dest, decoded); } + #[test] + fn dest_ack() { + let dest = Destination::new(true, 84, "abc", 17).unwrap(); + assert_eq!(84, dest.ack_num()); + assert!(dest.is_ack()); + assert_eq!("abc", dest.callsign()); + assert_eq!(17, dest.ssid()); + } + #[test] fn arbitrary_e2e() { let data = b"Hello world! This is an example comment";