feat: 添加局域网设备发现功能和链路胶囊优化
- 实现局域网设备发现面板,支持探测ESP32中继板并自动切换端点 - 添加POST /api/lan/probe接口用于设备探测,返回三态判决结果 - 实现快扫和全段扫描两种模式,支持种子地址优先探测 - 添加端点唯一写手机制,防止多处同时修改设备IP - 优化链路胶囊UI显示WiFi/EtherCAT/BLE连接状态和设备名称 - 修复EtherCAT链路OTA刷写期间PDO循环暂停和AL状态处理问题 - 调整PDO周期设置范围为0.125-4ms,支持亚毫秒显示为微秒 - 添加ESP32 WiFi使能开关控件样式和数据来源角标显示
This commit is contained in:
+8
-2
@@ -84,8 +84,14 @@ export async function connectBle() {
|
||||
state.device = device;
|
||||
state.device.addEventListener('gattserverdisconnected', onDisconnected, { once: true });
|
||||
if (typeof connectionMode === 'undefined' || connectionMode === 'ble') {
|
||||
els.deviceName.textContent = device.name || '未知设备';
|
||||
els.deviceId.textContent = device.id || '-';
|
||||
window.__bleDeviceName = device.name || '未知设备';
|
||||
window.__bleDeviceId = device.id || '-';
|
||||
/* 顶栏 BLE 胶囊:连接后直接显示「设备名 · 设备ID」(替代未连接) */
|
||||
try {
|
||||
var pct = document.getElementById('pillBleTxt');
|
||||
if (pct) pct.textContent = window.__bleDeviceName + ' · ' + window.__bleDeviceId;
|
||||
if (window.updateLinkPills) window.updateLinkPills(null, true);
|
||||
} catch (_) {}
|
||||
}
|
||||
|
||||
setBleStage(1, '已选择', null);
|
||||
|
||||
Reference in New Issue
Block a user