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,8 +30,14 @@ function Decoder(bytes, port) {
if (port === 2) { if (port === 2) {
// device status data // device status data
if (bytes.length === 17) {
return decode(bytes, [uint16, uptime, uint8, uint32, uint8, uint8], ['voltage', 'uptime', 'cputemp', 'memory', 'reset0', 'reset1']); 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) { if (port === 3) {
// device config data // device config data