Merge pull request #336 from cyberman54/development
update payload decoder for rcommand 0x86
This commit is contained in:
commit
86f7e91751
18
README.md
18
README.md
@ -389,9 +389,21 @@ Note: all settings are stored in NVRAM and will be reloaded when device starts.
|
|||||||
|
|
||||||
0x86 get time/date
|
0x86 get time/date
|
||||||
|
|
||||||
Device answers with it's local time/date (UTC Unix epoch) on Port 2:
|
Device answers with it's current time on Port 2:
|
||||||
bytes 1..4 = local time/date in UTC epoch seconds
|
|
||||||
byte 5 = bits 0..3 timeSource, bits 4..7 timeStatus
|
bytes 1..4 = time/date in UTC epoch seconds (LSB)
|
||||||
|
byte 5 = time source & status, see below
|
||||||
|
|
||||||
|
bits 0..3 time source
|
||||||
|
0x00 = GPS
|
||||||
|
0x01 = RTC
|
||||||
|
0x02 = LORA
|
||||||
|
0x03 = unsynched
|
||||||
|
|
||||||
|
bits 4..7 time status
|
||||||
|
0x00 = timeNotSet (never synched)
|
||||||
|
0x10 = timeNeedsSync (last sync failed)
|
||||||
|
0x20 = timeSet (synched)
|
||||||
|
|
||||||
0x87 set time/date
|
0x87 set time/date
|
||||||
|
|
||||||
|
@ -34,8 +34,8 @@ function Decoder(bytes, port) {
|
|||||||
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
|
// epoch time answer
|
||||||
if (bytes.length === 4) {
|
if (bytes.length === 5) {
|
||||||
return decode(bytes, [uint32], ['time']);
|
return decode(bytes, [uint32, uint8], ['time', 'timestatus']);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user