Expand description
The original rwhod protocol uses 32-bit integers for timestamps, which will cause overflow issues after 2038-01-19. To mitigate this, we decode timestamps by looking at the time the packet was received, comparing it to the current time or the time the packet was received, and ensuring any overflowed timestamps are corrected accordingly.
Structsยง
Constantsยง
- RWHOD_
TIMESTAMP_ ๐CORRECTION_ WINDOW - RWHOD_
TIMESTAMP_ ๐FORWARD_ ALLOWANCE - RWHOD_
TIMESTAMP_ ๐WRAP_ INCREMENT
Functionsยง
- decode_
rwhod_ timestamp - Decodes a raw rwhod timestamp (i32) into a DateTime
, adding a correction value to count for any detected overflows. - decode_
rwhod_ timestamp_ near_ time - Decodes a raw rwhod timestamp (i32) into a DateTime
using the default wrap-sized interval around the reference time. - decode_
rwhod_ timestamp_ near_ time_ with_ forward_ allowance - Decodes a raw rwhod timestamp (i32) into a DateTime
using a wrap-sized interval around the provided timereference. - decode_
rwhod_ timestamps - encode_
rwhod_ timestamp - Encodes a DateTime
into a raw rwhod timestamp (i32). - rwhod_
time_ correction - Calculates the correction value for a received rwhod timestamp (i32), based on the current time (now) and the received timestamp (recvtime).