client server hid stream fix
This commit is contained in:
parent
ffb5761cc9
commit
42f9a0f4ff
@ -10,7 +10,6 @@ use tonic::Request;
|
|||||||
use tracing::{debug, error, info, warn};
|
use tracing::{debug, error, info, warn};
|
||||||
use winit::{
|
use winit::{
|
||||||
event_loop::EventLoopBuilder,
|
event_loop::EventLoopBuilder,
|
||||||
// platform::x11::EventLoopBuilderExtX11,
|
|
||||||
platform::wayland::EventLoopBuilderExtWayland,
|
platform::wayland::EventLoopBuilderExtWayland,
|
||||||
event::Event,
|
event::Event,
|
||||||
};
|
};
|
||||||
|
|||||||
@ -45,7 +45,12 @@ impl KeyboardAggregator {
|
|||||||
|
|
||||||
let report = self.build_report();
|
let report = self.build_report();
|
||||||
if self.dev_mode { debug!(?report, "kbd"); }
|
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() {
|
if self.is_magic() {
|
||||||
warn!("🧙 magic chord – exiting 🪄 AVADA KEDAVRA!!! 💥💀");
|
warn!("🧙 magic chord – exiting 🪄 AVADA KEDAVRA!!! 💥💀");
|
||||||
|
|||||||
@ -104,7 +104,7 @@ After=network.target lesavka-core.service
|
|||||||
[Service]
|
[Service]
|
||||||
ExecStart=/usr/local/bin/lesavka-server
|
ExecStart=/usr/local/bin/lesavka-server
|
||||||
Restart=always
|
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
|
Environment=RUST_BACKTRACE=1
|
||||||
Restart=always
|
Restart=always
|
||||||
RestartSec=5
|
RestartSec=5
|
||||||
|
|||||||
@ -33,7 +33,7 @@ fn init_tracing() -> anyhow::Result<WorkerGuard> {
|
|||||||
|
|
||||||
// 2. build subscriber once
|
// 2. build subscriber once
|
||||||
let env = EnvFilter::try_from_default_env()
|
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()
|
let console_layer = fmt::layer()
|
||||||
.with_target(true)
|
.with_target(true)
|
||||||
.with_thread_ids(true);
|
.with_thread_ids(true);
|
||||||
@ -163,6 +163,7 @@ impl Relay for Handler {
|
|||||||
Some(libc::EBUSY) | // still opening
|
Some(libc::EBUSY) | // still opening
|
||||||
Some(libc::ENODEV) | // gadget not‑yet configured
|
Some(libc::ENODEV) | // gadget not‑yet configured
|
||||||
Some(libc::EPIPE) | // host vanished
|
Some(libc::EPIPE) | // host vanished
|
||||||
|
Some(libc::EINVAL) | // host hasn’t accepted EP config yet
|
||||||
Some(libc::EAGAIN)) // non‑blocking
|
Some(libc::EAGAIN)) // non‑blocking
|
||||||
=> {
|
=> {
|
||||||
tokio::time::sleep(Duration::from_millis(10)).await;
|
tokio::time::sleep(Duration::from_millis(10)).await;
|
||||||
@ -202,6 +203,7 @@ impl Relay for Handler {
|
|||||||
Some(libc::EBUSY) | // still opening
|
Some(libc::EBUSY) | // still opening
|
||||||
Some(libc::ENODEV) | // gadget not‑yet configured
|
Some(libc::ENODEV) | // gadget not‑yet configured
|
||||||
Some(libc::EPIPE) | // host vanished
|
Some(libc::EPIPE) | // host vanished
|
||||||
|
Some(libc::EINVAL) | // host hasn’t accepted EP config yet
|
||||||
Some(libc::EAGAIN)) // non‑blocking
|
Some(libc::EAGAIN)) // non‑blocking
|
||||||
=> {
|
=> {
|
||||||
tokio::time::sleep(Duration::from_millis(10)).await;
|
tokio::time::sleep(Duration::from_millis(10)).await;
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user