From 8899024fa149b62e2cf43153791c76b7c5753aa8 Mon Sep 17 00:00:00 2001 From: Michael Oborne Date: Fri, 10 Jan 2025 13:11:28 +1100 Subject: [PATCH] MavlinkParse: UtcNow update --- ExtLibs/Mavlink/MavlinkParse.cs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/ExtLibs/Mavlink/MavlinkParse.cs b/ExtLibs/Mavlink/MavlinkParse.cs index 8b3aef3bc4..b909e3f4a9 100644 --- a/ExtLibs/Mavlink/MavlinkParse.cs +++ b/ExtLibs/Mavlink/MavlinkParse.cs @@ -96,7 +96,7 @@ public static void ReadWithTimeout(Stream BaseStream, byte[] buffer, int offset, timeout = 60000; } - DateTime to = DateTime.Now.AddMilliseconds(timeout); + DateTime to = DateTime.UtcNow.AddMilliseconds(timeout); int toread = count; int pos = offset; @@ -112,12 +112,12 @@ public static void ReadWithTimeout(Stream BaseStream, byte[] buffer, int offset, // reset timeout if we get data if (read > 0) - to = DateTime.Now.AddMilliseconds(timeout); + to = DateTime.UtcNow.AddMilliseconds(timeout); if (toread == 0) break; - if (DateTime.Now > to) + if (DateTime.UtcNow > to) { throw new TimeoutException("Timeout waiting for data"); }