mirror of
https://github.com/mofeng-git/One-KVM.git
synced 2026-02-01 10:31:54 +08:00
- 新增 Consumer Control HID 支持(播放/暂停、音量控制等) - 虚拟键盘支持 Windows/Mac/Android 三种布局切换 - 移除键盘 LED 反馈以节省 USB 端点(从 2 减至 1) - InfoBar 优化:按键名称友好显示,移除未实现的 Num/Scroll 指示器 - 更新 HID 模块文档
36 lines
1.2 KiB
Rust
36 lines
1.2 KiB
Rust
//! OTG USB Gadget unified management module
|
|
//!
|
|
//! This module provides unified management for USB Gadget functions:
|
|
//! - HID (Keyboard, Mouse)
|
|
//! - MSD (Mass Storage Device)
|
|
//!
|
|
//! Architecture:
|
|
//! ```text
|
|
//! OtgService (high-level coordination)
|
|
//! └── OtgGadgetManager (gadget lifecycle)
|
|
//! ├── EndpointAllocator (manages UDC endpoints)
|
|
//! ├── HidFunction (keyboard, mouse_rel, mouse_abs)
|
|
//! └── MsdFunction (mass storage)
|
|
//! ```
|
|
//!
|
|
//! The recommended way to use this module is through `OtgService`, which provides
|
|
//! a high-level interface for enabling/disabling HID and MSD functions independently.
|
|
//! Both `HidController` and `MsdController` should share the same `OtgService` instance.
|
|
|
|
pub mod configfs;
|
|
pub mod endpoint;
|
|
pub mod function;
|
|
pub mod hid;
|
|
pub mod manager;
|
|
pub mod msd;
|
|
pub mod report_desc;
|
|
pub mod service;
|
|
|
|
pub use endpoint::EndpointAllocator;
|
|
pub use function::{FunctionMeta, GadgetFunction};
|
|
pub use hid::{HidFunction, HidFunctionType};
|
|
pub use manager::{wait_for_hid_devices, OtgGadgetManager};
|
|
pub use msd::{MsdFunction, MsdLunConfig};
|
|
pub use report_desc::{KEYBOARD, MOUSE_ABSOLUTE, MOUSE_RELATIVE};
|
|
pub use service::{HidDevicePaths, OtgService, OtgServiceState};
|