feat(hid): 增加 HID 后端健康检查与错误码上报,完善前端掉线恢复状态同步及错误提示展示

This commit is contained in:
mofeng-git
2026-02-20 20:30:12 +08:00
parent 016c0d5dbb
commit 486db7b4aa
10 changed files with 378 additions and 24 deletions

View File

@@ -361,6 +361,17 @@ export default {
reconnectingDesc: 'Attempting to reconnect (attempt {attempt})',
recovered: 'HID Recovered',
recoveredDesc: '{backend} HID device reconnected successfully',
errorHints: {
udcNotConfigured: 'Target host has not finished USB enumeration yet',
hidDeviceMissing: 'HID gadget device node is missing, try restarting HID service',
portNotFound: 'Serial port not found, check CH9329 wiring and device path',
noResponse: 'No response from CH9329, check baud rate and power',
protocolError: 'CH9329 replied with invalid protocol data',
healthCheckFailed: 'Background health check failed',
ioError: 'I/O communication error detected',
otgIoError: 'OTG link is unstable, check USB cable and host port',
ch9329IoError: 'CH9329 serial link is unstable, check wiring and power',
},
},
audio: {
// Device monitoring
@@ -812,6 +823,7 @@ export default {
networkError: 'Network Error',
disconnected: 'Disconnected',
availability: 'Availability',
errorCode: 'Error Code',
hidUnavailable: 'HID Unavailable',
sampleRate: 'Sample Rate',
channels: 'Channels',

View File

@@ -361,6 +361,17 @@ export default {
reconnectingDesc: '正在尝试重连(第 {attempt} 次)',
recovered: 'HID 已恢复',
recoveredDesc: '{backend} HID 设备已成功重连',
errorHints: {
udcNotConfigured: '被控机尚未完成 USB 枚举',
hidDeviceMissing: '未找到 HID 设备节点,可尝试重启 HID 服务',
portNotFound: '找不到串口设备,请检查 CH9329 接线与设备路径',
noResponse: 'CH9329 无响应,请检查波特率与供电',
protocolError: 'CH9329 返回了无效协议数据',
healthCheckFailed: '后台健康检查失败',
ioError: '检测到 I/O 通信异常',
otgIoError: 'OTG 链路不稳定,请检查 USB 线和被控机接口',
ch9329IoError: 'CH9329 串口链路不稳定,请检查接线与供电',
},
},
audio: {
// 设备监控
@@ -812,6 +823,7 @@ export default {
networkError: '网络错误',
disconnected: '已断开',
availability: '可用性',
errorCode: '错误码',
hidUnavailable: 'HID不可用',
sampleRate: '采样率',
channels: '声道',