Conversation
通过串口控制 BliSwitch / XH-HK4401 多路 KVM 切换器,遵循官方 BliSwitch v2 控制协议
(19200 波特率;发送 SW{N}\r\nAG{NN}gA 切换输入,解析 G{NN}gA 心跳帧获取当前通道)。
- 新增 src/switch:SwitchController(串口后台工作线程)与运行时类型
- config/schema/switch.rs:SwitchConfig 持久化配置
- runtime/builder.rs:build_switch() 接入 AppState
- REST API:/api/switch/status、/api/switch/channel、/api/config/switch、/api/devices/switch
- 前端:SwitchPopover(切换+配置)、API 类型与多语言文案
已验证:在 debian:trixie 上 cargo build --release 通过,并在真实 BliSwitch 上
验证切换与读取当前通道正常。
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
概述
为 One-KVM 增加 BliSwitch / XH-HK4401 多路 KVM 输入切换功能,遵循官方 BliSwitch v2 控制协议(19200 波特率;发送
SW{N}\r\nAG{NN}gA切换输入,解析G{NN}gA心跳帧获取当前通道)。改动
src/switch(SwitchController 串口后台线程 + 运行时类型)、config/schema/switch.rs(SwitchConfig 持久化)、runtime/builder.rs(build_switch 接入 AppState)/api/switch/status、/api/switch/channel、/api/config/switch、/api/devices/switchSwitchPopover(切换 + 配置)、API 类型与多语言文案验证
cargo build --release通过关联
参考官方文档:https://www.blikvm.com/zh-CN/docs/device-guides/BliSwitch-v2-guide