made-bridge 0.2.2 → 0.2.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +1 -1
- package/src/board-link.mjs +4 -1
package/package.json
CHANGED
package/src/board-link.mjs
CHANGED
|
@@ -141,7 +141,10 @@ export function createBoardLink() {
|
|
|
141
141
|
const queues = new Map();
|
|
142
142
|
const audios = new Map();
|
|
143
143
|
const hits = new Map();
|
|
144
|
-
|
|
144
|
+
// 命令 id 用启动时间戳起算(固件 validCommandId 允许 ≤16 位纯数字):
|
|
145
|
+
// 板子的 delivered_command_ids_ 去重表跨重启持久,若桥接器重启后 id 从 1 重新
|
|
146
|
+
// 计数,会撞上表内旧 id 被当重复静默跳过(但照样 ack)。时间戳起点保证跨重启唯一。
|
|
147
|
+
const seq = { n: Math.floor(Date.now() / 1000) };
|
|
145
148
|
const dropAudio = (deviceId, id) => audios.delete(`${deviceId}\n${id}`);
|
|
146
149
|
const enqueue = (deviceId, command, allowed, audio) => enqueueCommand(queues, audios, catalogs, seq, deviceId, command, allowed, audio);
|
|
147
150
|
return {
|