diff --git a/pixel-shared-rs b/pixel-shared-rs index 92bb683..3fc82ba 160000 --- a/pixel-shared-rs +++ b/pixel-shared-rs @@ -1 +1 @@ -Subproject commit 92bb68371b861341d03763a287e25d01cb3fb1e6 +Subproject commit 3fc82ba1cecd41e3b0bcb72b105ef69320dceea9 diff --git a/src/upd_loop.rs b/src/upd_loop.rs index ed0c2af..1f68d05 100644 --- a/src/upd_loop.rs +++ b/src/upd_loop.rs @@ -1,7 +1,7 @@ use crate::DISPLAY; use log::{error, info, warn}; use pixel_shared_rs::{ - read_hdr_window, DisplayCommand, HdrWindow, ReadHdrWindowError, PIXEL_WIDTH, TILE_SIZE, + read_header, DisplayCommand, HdrWindow, ReadHeaderError, PIXEL_WIDTH, TILE_SIZE, }; use std::io::ErrorKind; use std::mem::size_of; @@ -45,16 +45,16 @@ pub fn start_udp_thread(bind: String, stop_receiver: Receiver<()>) -> JoinHandle } fn handle_package(received: &mut [u8]) { - let header = match read_hdr_window(&received[..10]) { - Err(ReadHdrWindowError::BufferTooSmall) => { + let header = match read_header(&received[..10]) { + Err(ReadHeaderError::BufferTooSmall) => { error!("received a packet that is too small"); return; } - Err(ReadHdrWindowError::InvalidCommand(command_u16)) => { + Err(ReadHeaderError::InvalidCommand(command_u16)) => { error!("received invalid command {}", command_u16); return; } - Err(ReadHdrWindowError::WrongCommandEndianness(command_u16, command_swapped)) => { + Err(ReadHeaderError::WrongCommandEndianness(command_u16, command_swapped)) => { error!( "The reversed byte order of {} matches command {:?}, you are probably sending the wrong endianness", command_u16, command_swapped