restart counter added
This commit is contained in:
1 parent
cc4daa0954
commit
385c5a1b9b
8 files changed
+19
-16
No files matched your search
@@ -38,8 +38,8 @@ function Decoder(bytes, port) {
|
||||
|
||||
if (port === 2) {
|
||||
// device status data
|
||||
if (bytes.length === 17) {
|
||||
return decode(bytes, [uint16, uptime, uint8, uint32, uint8, uint8], ['voltage', 'uptime', 'cputemp', 'memory', 'reset0', 'reset1']);
|
||||
if (bytes.length === 20) {
|
||||
return decode(bytes, [uint16, uptime, uint8, uint32, uint8, uint32], ['voltage', 'uptime', 'cputemp', 'memory', 'reset0', 'restarts']);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -32,7 +32,7 @@ function Decoder(bytes, port) {
|
||||
decoded.temp = bytes[i++];
|
||||
decoded.memory = ((bytes[i++] << 24) | (bytes[i++] << 16) | (bytes[i++] << 8) | bytes[i++]);
|
||||
decoded.reset0 = bytes[i++];
|
||||
decoded.reset1 = bytes[i++];
|
||||
decoded.restarts = ((bytes[i++] << 24) | (bytes[i++] << 16) | (bytes[i++] << 8) | bytes[i++]);
|
||||
}
|
||||
|
||||
if (port === 4) {
|
||||
|
||||
Reference in new issue
Block a user