packed_decoder.js: added timesync port 2
This commit is contained in:
parent
87d6d95726
commit
17a1ae2856
@ -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
|
||||||
|
Loading…
Reference in New Issue
Block a user