mirror of
https://github.com/mofeng-git/One-KVM.git
synced 2026-09-13 11:04:25 +08:00
feat(bluetooth-hid): 支持经典蓝牙 HID 后端
This commit is contained in:
@@ -5,7 +5,7 @@ use crate::error::Result;
|
||||
use crate::web::state::UsbApiState;
|
||||
|
||||
use super::types::HidConfigUpdate;
|
||||
use super::usb_update::{stage_hid_config_update, update_usb_config};
|
||||
use super::usb_update::{stage_hid_config_update, update_usb_config_with_reset};
|
||||
|
||||
pub async fn get_hid_config(State(state): State<UsbApiState>) -> Json<HidConfig> {
|
||||
Json(state.config.get().hid.clone())
|
||||
@@ -15,7 +15,8 @@ pub async fn update_hid_config(
|
||||
State(state): State<UsbApiState>,
|
||||
Json(req): Json<HidConfigUpdate>,
|
||||
) -> Result<Json<HidConfig>> {
|
||||
let config = update_usb_config(&state, move |staged| {
|
||||
let reset = req.bluetooth_reset_pairing.unwrap_or(false);
|
||||
let config = update_usb_config_with_reset(&state, reset, move |staged| {
|
||||
stage_hid_config_update(&mut staged.hid, &req)
|
||||
})
|
||||
.await?;
|
||||
|
||||
Reference in New Issue
Block a user