mirror of
https://github.com/mofeng-git/One-KVM.git
synced 2026-10-28 16:30:48 +08:00
feat(hid): 支持 CH9329 + OTG 组合模式
CH9329 负责键鼠,OTG 提供虚拟媒体、USB 网络和音频;分别配置设备、报告运行状态,并在 OTG 配置变更和回滚时保留未变化的 CH9329 实例。 补齐双设备校验、串口冲突检查、初始化引导和功能入口,修复组合模式下鼠标兼容选项缺失。 验证:独立功能版本的 591 项 Rust 库测试、前端生产构建、3 项引导逻辑测试及 2 组浏览器回归通过。未进行目标 KVM 硬件验证。
This commit is contained in:
@@ -11,6 +11,9 @@ pub struct Ch9329DescriptorQuery {
|
||||
pub struct HidStatus {
|
||||
pub available: bool,
|
||||
pub backend: String,
|
||||
pub configured_backend: String,
|
||||
#[cfg(unix)]
|
||||
pub otg: crate::otg::service::OtgRuntimeStatus,
|
||||
pub initialized: bool,
|
||||
pub online: bool,
|
||||
pub supports_absolute_mouse: bool,
|
||||
@@ -34,9 +37,21 @@ pub async fn hid_otg_self_check(
|
||||
/// Get HID status
|
||||
pub async fn hid_status(State(state): State<Arc<AppState>>) -> Json<HidStatus> {
|
||||
let hid = state.hid.snapshot().await;
|
||||
let config = state.config.get();
|
||||
Json(HidStatus {
|
||||
available: hid.available,
|
||||
backend: hid.backend,
|
||||
configured_backend: config.hid.backend.as_str().to_string(),
|
||||
#[cfg(unix)]
|
||||
otg: state
|
||||
.otg_service
|
||||
.runtime_status(
|
||||
config.hid.backend.uses_otg_hid()
|
||||
|| config.msd.enabled
|
||||
|| config.otg_network.enabled
|
||||
|| config.uac.enabled,
|
||||
)
|
||||
.await,
|
||||
initialized: hid.initialized,
|
||||
online: hid.online,
|
||||
supports_absolute_mouse: hid.supports_absolute_mouse,
|
||||
|
||||
Reference in New Issue
Block a user