poe-svelte-ui-lib 3.15.2 → 3.15.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/README.md +1 -1
- package/dist/protocols/can.js +8 -0
- package/package.json +1 -1
package/README.md
CHANGED
package/dist/protocols/can.js
CHANGED
|
@@ -77,6 +77,14 @@ export const createCanParser = ({ sessionTimeoutMs = 2000, maxPacketBytes = 8192
|
|
|
77
77
|
const dlc = parseInt(dlcHex, 16);
|
|
78
78
|
const size = Math.min(type === "T" ? Math.min(dlc, 8) : fdLength(dlc), dataHex.length >> 1);
|
|
79
79
|
const data = hexToBytes(dataHex.slice(0, size * 2));
|
|
80
|
+
/* Однокадровый пакет (frame 0 + last) самодостаточен: декодируем сразу, не трогая многокадровые сессии.
|
|
81
|
+
Иначе частые однокадровые пакеты (уставки 500 Гц) с тем же 3-битным counter сбрасывают сборку большого ответа того же отправителя */
|
|
82
|
+
if (id.frame === 0 && id.last) {
|
|
83
|
+
const parsed = decodeRecords(data);
|
|
84
|
+
if (parsed.status === "complete")
|
|
85
|
+
messages.push({ canId, priority: id.priority, srcBusID: id.srcBusID, counter: id.counter, data: data.subarray(0, parsed.length), timestamp: now });
|
|
86
|
+
return end + 1;
|
|
87
|
+
}
|
|
80
88
|
const key = (id.srcBusID << 3) | id.counter;
|
|
81
89
|
let session = sessions.get(key);
|
|
82
90
|
if (id.frame === 0 && session?.next !== 0)
|