From b34c536c686e06e589dc832d8289022c50a19c79 Mon Sep 17 00:00:00 2001 From: Pascal Serrarens Date: Sat, 14 Dec 2024 12:42:14 +0100 Subject: [PATCH] Fixed field order in spherical values in messages --- LowLevelMessages.cs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/LowLevelMessages.cs b/LowLevelMessages.cs index ad6dbe6..9d7c77c 100644 --- a/LowLevelMessages.cs +++ b/LowLevelMessages.cs @@ -5,16 +5,16 @@ public class LowLevelMessages public static void SendSpherical(byte[] buffer, ref byte ix, Spherical v) { + SendFloat16(buffer, ref ix, new float16(v.distance)); SendAngle8(buffer, ref ix, v.horizontal); SendAngle8(buffer, ref ix, v.vertical); - SendFloat16(buffer, ref ix, new float16(v.distance)); } public static Spherical ReceiveSpherical(byte[] data, ref byte ix) { + float distance = ReceiveFloat16(data, ref ix); float horizontal = ReceiveAngle8(data, ref ix); float vertical = ReceiveAngle8(data, ref ix); - float distance = ReceiveFloat16(data, ref ix); Spherical v = new(distance, horizontal, vertical); return v; }