mirror of
https://github.com/kaesaecracker/servicepoint-simulator.git
synced 2025-01-18 18:40:14 +01:00
update shared
This commit is contained in:
parent
72336ab0ba
commit
3f543dd476
|
@ -1 +1 @@
|
||||||
Subproject commit 92bb68371b861341d03763a287e25d01cb3fb1e6
|
Subproject commit 3fc82ba1cecd41e3b0bcb72b105ef69320dceea9
|
|
@ -1,7 +1,7 @@
|
||||||
use crate::DISPLAY;
|
use crate::DISPLAY;
|
||||||
use log::{error, info, warn};
|
use log::{error, info, warn};
|
||||||
use pixel_shared_rs::{
|
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::io::ErrorKind;
|
||||||
use std::mem::size_of;
|
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]) {
|
fn handle_package(received: &mut [u8]) {
|
||||||
let header = match read_hdr_window(&received[..10]) {
|
let header = match read_header(&received[..10]) {
|
||||||
Err(ReadHdrWindowError::BufferTooSmall) => {
|
Err(ReadHeaderError::BufferTooSmall) => {
|
||||||
error!("received a packet that is too small");
|
error!("received a packet that is too small");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
Err(ReadHdrWindowError::InvalidCommand(command_u16)) => {
|
Err(ReadHeaderError::InvalidCommand(command_u16)) => {
|
||||||
error!("received invalid command {}", command_u16);
|
error!("received invalid command {}", command_u16);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
Err(ReadHdrWindowError::WrongCommandEndianness(command_u16, command_swapped)) => {
|
Err(ReadHeaderError::WrongCommandEndianness(command_u16, command_swapped)) => {
|
||||||
error!(
|
error!(
|
||||||
"The reversed byte order of {} matches command {:?}, you are probably sending the wrong endianness",
|
"The reversed byte order of {} matches command {:?}, you are probably sending the wrong endianness",
|
||||||
command_u16, command_swapped
|
command_u16, command_swapped
|
||||||
|
|
Loading…
Reference in a new issue