data/edge5cdab/modbus & logging

This commit is contained in:
2026-07-02 18:39:43 +05:00
parent f5dd5a7f7f
commit d7bfaa678e
12 changed files with 117 additions and 39 deletions

View File

@@ -1,14 +1,8 @@
import { log } from '../helpers/log.js'
import { onEdgeChunk } from '../stream/edge-chunk-relay.js'
import type { TopicHandler } from '../types.js'
const BEACON_MS = 3000
let lastBeacon = 0
export const handleEdge5Video: TopicHandler = async (_topic, payload) => {
const now = Date.now()
if (now - lastBeacon >= BEACON_MS) {
console.log(`edge5.video ↑ ${payload.length}B`)
lastBeacon = now
}
onEdgeChunk(payload)
log(`edge5.video ↑ ${payload.length}B`);
onEdgeChunk(payload);
}