feat(decoder): alarm banner and warning sound when the decoder drops or goes silent during a heat (1.89.25)

This commit is contained in:
larssand committed 2026-11-14 15:20:31 +01:00
1 parent 259945799d
commit 239cac8033
18 files changed
+225 -5

No files matched your search

+3 -2
View File
@@ -13,8 +13,9 @@ export async function freePort() {
// Accepts the WebSocket upgrade handshake so the frontend's real decoder-connect path
// (src/decoder_runtime.js) reaches `connected: true` without a physical AMMC decoder.
// sendPassing() pushes a PASSING frame for scenarios that need the app to see a transponder.
export async function startFakeDecoder() {
const port = await freePort();
// `fixedPort`: listen on a port used before (a decoder coming back on the same address).
export async function startFakeDecoder(fixedPort = 0) {
const port = fixedPort || await freePort();
const server = createServer();
// The upgraded sockets are intentionally left open (no decoder frames needed), so a
// plain server.close() would wait forever for them to end; track and destroy them