timeserver(experimental)
This commit is contained in:
1 parent
b742f888fd
commit
f9f5f499ff
9 files changed
+77
-81
No files matched your search
@@ -66,14 +66,10 @@ function Decoder(bytes, port) {
|
||||
if (port === 9) {
|
||||
// timesync request
|
||||
if (bytes.length === 1) {
|
||||
decoded.timesync_opcode = bytes[0];
|
||||
}
|
||||
if (bytes.length === 2) {
|
||||
decoded.timesync_opcode = bytes[0];
|
||||
decoded.timesync_seqno = bytes[1];
|
||||
decoded.timesync_seqno = bytes[0];
|
||||
}
|
||||
return decoded;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
@@ -67,6 +67,12 @@ function Decoder(bytes, port) {
|
||||
decoded.battery = (bytes[i++] << 8) | bytes[i++];}
|
||||
}
|
||||
|
||||
if (port === 9) {
|
||||
if (bytes.length === 1) {
|
||||
decoded.timesync_seqno = bytes[0];
|
||||
}
|
||||
}
|
||||
|
||||
return decoded;
|
||||
|
||||
}
|
||||
Reference in new issue
Block a user