Debugging

This commit is contained in:
Bastian Gruber 2023-05-21 15:48:18 +02:00
parent 7e2fb1e5a9
commit 6f94491464
No known key found for this signature in database
GPG key ID: BE9F8C772B188CBF
2 changed files with 6 additions and 2 deletions

View file

@ -112,7 +112,8 @@ async fn test_dipatcher_connection(
// 13 88 5000 // 13 88 5000
// ] // ]
// } // }
let i_am_dispatcher = [0x81, 0x03, 0x00, 0x42, 0x01, 0x70, 0x13, 0x88]; // let i_am_dispatcher = [0x81, 0x03, 0x00, 0x42, 0x01, 0x70, 0x13, 0x88];
let i_am_dispatcher = [0x81, 0x02, 0x00, 0x7b, 0x00, 0x01];
write.write_all(&i_am_dispatcher).await?; write.write_all(&i_am_dispatcher).await?;

View file

@ -222,8 +222,11 @@ fn get_u16_vec<'a>(src: &mut Cursor<&'a [u8]>, len: usize) -> Result<Vec<u16>, E
} }
fn skip(src: &mut Cursor<&[u8]>, n: usize) -> Result<(), Error> { fn skip(src: &mut Cursor<&[u8]>, n: usize) -> Result<(), Error> {
info!(
"Bytes left: src: {src:?}: n: {n}, remaining: {}",
src.remaining()
);
if src.remaining() < n { if src.remaining() < n {
info!("Not enough bytes left: {src:?}: {n}");
return Err(Error::Incomplete); return Err(Error::Incomplete);
} }