From 302ee0e38d157edf80c6bb88f41be9643051c788 Mon Sep 17 00:00:00 2001 From: John Goerzen Date: Mon, 21 Sep 2020 05:30:06 -0500 Subject: [PATCH] tweaks --- src/ping.rs | 2 +- src/xb.rs | 2 +- src/xbpacket.rs | 4 ++-- src/xbrx.rs | 10 ++-------- 4 files changed, 6 insertions(+), 12 deletions(-) diff --git a/src/ping.rs b/src/ping.rs index cfde2c0..3782f40 100644 --- a/src/ping.rs +++ b/src/ping.rs @@ -25,7 +25,7 @@ use std::io; use std::thread; use std::time::Duration; -const INTERVAL: u64 = 5; +const INTERVAL: u64 = 5; // FIXME: this should be configurable pub fn genpings(dest: u64, sender: crossbeam_channel::Sender) -> io::Result<()> { let mut counter: u64 = 1; diff --git a/src/xb.rs b/src/xb.rs index 7b322f9..746c4a2 100644 --- a/src/xb.rs +++ b/src/xb.rs @@ -179,7 +179,7 @@ fn writerthread( match packet.serialize() { Ok(datatowrite) => { trace!( - "TX ID {} to {:?} data {}", + "TX ID {:X} to {:?} data {}", packet.frame_id, &dest, hex::encode(&datatowrite) diff --git a/src/xbpacket.rs b/src/xbpacket.rs index d885786..ed23854 100644 --- a/src/xbpacket.rs +++ b/src/xbpacket.rs @@ -198,12 +198,12 @@ impl PacketStream { let mut payload = BytesMut::new(); payload.put_u8(chunks_remaining); payload.put_slice(chunk); - let frame_id = self.get_and_incr_framecounter(); + let frame_id = self.get_and_incr_framecounter(); // FIXME: make this configurable whether we get back TX reports. let packet = XBTXRequest { frame_id, dest_addr: dest.clone(), broadcast_radius: 0, - transmit_options: 0, + transmit_options: 0x01, // FIXME: make this configurable whether or not to request ACKs (0x01 disables; 0x00 default) payload: Bytes::from(payload), }; diff --git a/src/xbrx.rs b/src/xbrx.rs index 15203c4..2b01243 100644 --- a/src/xbrx.rs +++ b/src/xbrx.rs @@ -83,14 +83,8 @@ pub fn rxxbpacket(ser: &mut XBSerReader) -> Option { let tx_retry_count = inner.get_u8(); let delivery_status = inner.get_u8(); let discovery_status = inner.get_u8(); - let txstatus = ExtTxStatus { - frame_id, - dest_addr_16, - tx_retry_count, - delivery_status, - discovery_status, - }; - trace!("TX STATUS: {:?}", txstatus); + trace!("TX STATUS: frame_id: {:X}, dest_addr_16: {:X}, tx_retry_count: {:X}, delivery_status: {:X}, discovery_status: {:X}", + frame_id, dest_addr_16, tx_retry_count, delivery_status, discovery_status); None } 0x90 => {