Skip to content

Commit 6c3c5db

Browse files
Fix: update devite type on DINFO, add serial number to STAT
1 parent 1291483 commit 6c3c5db

2 files changed

Lines changed: 11 additions & 0 deletions

File tree

src/ApplicationRuntime.cs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -215,6 +215,7 @@ public async Task InitializeAsync(string[] args)
215215
_logger?.Write("[WEB] Server started on port 8080");
216216

217217
_azmManager.OnLineGenerated += line => _webServer?.Broadcast(line);
218+
_azmPort.DeviceInfoValidChanged += (_, _) => { _webServer?.Broadcast("!DINFO_UPDATED"); };
218219
}
219220

220221
await TryLoadInitScript();
@@ -642,6 +643,7 @@ public Dictionary<string, string> GetSystemState()
642643
["antenna_y"] = AntennaYOffset.ToString("F2"),
643644
["antenna_phi"] = AntennaPhi.ToString("F1"),
644645
["device_type"] = _azmManager?.DeviceType.ToString() ?? "unknown",
646+
["serial_number"] = _azmPort?.SerialNumber ?? "",
645647
["location_override"] = LocationOverrideActive.ToString(),
646648
};
647649
}

src/wwwroot/script.js

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -539,6 +539,11 @@ function handleAzimuthLine(line) {
539539
if (typeof line !== 'string') return;
540540
line = line.trim();
541541

542+
if (line === '!DINFO_UPDATED') {
543+
requestSystemInfo();
544+
return;
545+
}
546+
542547
addLogEntry(line);
543548

544549
if (line.startsWith('@AZMREM,')) {
@@ -610,6 +615,7 @@ function handleCommandResponse(line) {
610615
else if (p.startsWith('antenna_y=')) currentSettings.offsY = p.split('=')[1];
611616
else if (p.startsWith('antenna_phi=')) currentSettings.offsPhi = p.split('=')[1];
612617
else if (p.startsWith('device_type=')) currentMode = p.split('=')[1].toLowerCase();
618+
else if (p.startsWith('serial_number=')) systemInfo.serialNumber = p.split('=')[1];
613619
}
614620
updateSystemInfo();
615621
}
@@ -1507,6 +1513,9 @@ function updateSystemInfo() {
15071513

15081514
html += `<div class="sys-header">`;
15091515
html += `<strong>${currentMode.toUpperCase()}</strong> `;
1516+
if (systemInfo?.serialNumber) {
1517+
html += `<div style="font-size:9px; color:#888;">S/N: ${systemInfo.serialNumber}</div>`;
1518+
}
15101519

15111520
const localAge = localDevice?.dataAge ?? 0;
15121521
let ageColor = '#28a745';

0 commit comments

Comments
 (0)