client server hid stream fix

This commit is contained in:
Brad Stein 2025-06-26 03:49:01 -05:00
parent ffb5761cc9
commit 42f9a0f4ff
4 changed files with 10 additions and 4 deletions

View File

@ -10,7 +10,6 @@ use tonic::Request;
use tracing::{debug, error, info, warn};
use winit::{
event_loop::EventLoopBuilder,
// platform::x11::EventLoopBuilderExtX11,
platform::wayland::EventLoopBuilderExtWayland,
event::Event,
};

View File

@ -45,7 +45,12 @@ impl KeyboardAggregator {
let report = self.build_report();
if self.dev_mode { debug!(?report, "kbd"); }
let _ = self.tx.send(KeyboardReport { data: report.to_vec() });
static COUNTER: AtomicU32 = AtomicU32::new(0);
let id = COUNTER.fetch_add(1, Ordering::Relaxed);
let _ = self.tx.send(KeyboardReport {
seq: id,
data: report.to_vec()
});
if self.is_magic() {
warn!("🧙 magic chord exiting 🪄 AVADA KEDAVRA!!! 💥💀");

View File

@ -104,7 +104,7 @@ After=network.target lesavka-core.service
[Service]
ExecStart=/usr/local/bin/lesavka-server
Restart=always
Environment=RUST_LOG=lesavka_server=debug,lesavka_server::usb_gadget=info
Environment=RUST_LOG=lesavka_server=trace,lesavka_server::usb_gadget=info
Environment=RUST_BACKTRACE=1
Restart=always
RestartSec=5

View File

@ -33,7 +33,7 @@ fn init_tracing() -> anyhow::Result<WorkerGuard> {
// 2. build subscriber once
let env = EnvFilter::try_from_default_env()
.unwrap_or_else(|_| EnvFilter::new("lesavka_server=info"));
.unwrap_or_else(|_| {EnvFilter::new("lesavka_server=trace")});
let console_layer = fmt::layer()
.with_target(true)
.with_thread_ids(true);
@ -163,6 +163,7 @@ impl Relay for Handler {
Some(libc::EBUSY) | // still opening
Some(libc::ENODEV) | // gadget notyet configured
Some(libc::EPIPE) | // host vanished
Some(libc::EINVAL) | // host hasnt accepted EP config yet
Some(libc::EAGAIN)) // nonblocking
=> {
tokio::time::sleep(Duration::from_millis(10)).await;
@ -202,6 +203,7 @@ impl Relay for Handler {
Some(libc::EBUSY) | // still opening
Some(libc::ENODEV) | // gadget notyet configured
Some(libc::EPIPE) | // host vanished
Some(libc::EINVAL) | // host hasnt accepted EP config yet
Some(libc::EAGAIN)) // nonblocking
=> {
tokio::time::sleep(Duration::from_millis(10)).await;