packed_decoder.js: added timesync port 2

This commit is contained in:
Verkehrsrot 2019-03-27 19:37:21 +01:00
parent 87d6d95726
commit 17a1ae2856

View File

@ -30,7 +30,13 @@ function Decoder(bytes, port) {
if (port === 2) {
// device status data
return decode(bytes, [uint16, uptime, uint8, uint32, uint8, uint8], ['voltage', 'uptime', 'cputemp', 'memory', 'reset0', 'reset1']);
if (bytes.length === 17) {
return decode(bytes, [uint16, uptime, uint8, uint32, uint8, uint8], ['voltage', 'uptime', 'cputemp', 'memory', 'reset0', 'reset1']);
}
// epoch time answer
if (bytes.length === 4) {
return decode(bytes, [uint32], ['time']);
}
}
if (port === 3) {