From 90c8f12c53428b1b334ac0f4c14f761506788614 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=D0=94=D0=B5=D0=BD=D0=B8=D1=81=20=D0=9A=D1=83=D0=B7=D0=BD?= =?UTF-8?q?=D0=B5=D1=86=D0=BE=D0=B2?= Date: Thu, 24 Aug 2023 16:55:09 +0300 Subject: [PATCH] =?UTF-8?q?=D0=B8=D1=81=D0=BF=D1=80=D0=B0=D0=B2=D0=BB?= =?UTF-8?q?=D0=B5=D0=BD=20rtp.cs?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- rtp.cs | 32 ++++++++++++++++++++++---------- 1 file changed, 22 insertions(+), 10 deletions(-) diff --git a/rtp.cs b/rtp.cs index df8e970..053bf82 100644 --- a/rtp.cs +++ b/rtp.cs @@ -9,6 +9,8 @@ namespace nRTP public static class RTP { //RTPMsgHeader + private const UInt32 _len_pack = 50; + private static Byte _VerPXCC = 2; private static Byte _Ver = 2; // версия протокола (текущая версия 2) private static Byte _P = 0; // = 0 (не используется заполнение в конце пакета) @@ -88,6 +90,11 @@ namespace nRTP public static UInt16 SD_Height; // Высота (пиксели) public static float SD_AzUpr; // (град) public static float SD_ElUpr; // (град) + + public static Int32 SD_Shirota; // Широта БЛА (1е-7 град) + public static Int32 SD_Dolgota; // Долгота БЛА (1е-7 град) + public static Int32 SD_Vysota; // Высота БЛА (0,01 м) + public static Int16 SD_Course; // Курс БЛА (0,01 град) public static Int16 SD_Roll; // Крен БЛА (0,01 град) public static Int16 SD_Pitch; // Тангаж БЛА (0,01 град) @@ -112,7 +119,7 @@ namespace nRTP } } - public static Byte[] DataH0 = new Byte[56]; + public static Byte[] DataH0 = new Byte[68]; public static Byte[] DataH1 = new Byte[20]; public static void MakeDataH0() @@ -131,15 +138,20 @@ namespace nRTP Array.Copy(BitConverter.GetBytes(RTP.SD_Height), 0, DataH0, 22, 2); Array.Copy(BitConverter.GetBytes(RTP.SD_AzUpr), 0, DataH0, 24, 4); Array.Copy(BitConverter.GetBytes(RTP.SD_ElUpr), 0, DataH0, 28, 4); - Array.Copy(BitConverter.GetBytes(RTP.SD_Course), 0, DataH0, 32, 2); - Array.Copy(BitConverter.GetBytes(RTP.SD_Roll), 0, DataH0, 34, 2); - Array.Copy(BitConverter.GetBytes(RTP.SD_Pitch), 0, DataH0, 36, 2); - Array.Copy(BitConverter.GetBytes(RTP.SD_FrameId), 0, DataH0, 38, 2); - - Array.Copy(BitConverter.GetBytes(RTP.DE_TLV_X), 0, DataH0, 40, 4); - Array.Copy(BitConverter.GetBytes(RTP.DE_TLV_Y), 0, DataH0, 44, 4); - Array.Copy(BitConverter.GetBytes(RTP.DE_TLV_dX), 0, DataH0, 48, 4); - Array.Copy(BitConverter.GetBytes(RTP.DE_TLV_dY), 0, DataH0, 52, 4); + + Array.Copy(BitConverter.GetBytes(RTP.SD_Shirota), 0, DataH0, 32, 4); + Array.Copy(BitConverter.GetBytes(RTP.SD_Dolgota), 0, DataH0, 36, 4); + Array.Copy(BitConverter.GetBytes(RTP.SD_Vysota), 0, DataH0, 40, 4); + + Array.Copy(BitConverter.GetBytes(RTP.SD_Course), 0, DataH0, 44, 2); + Array.Copy(BitConverter.GetBytes(RTP.SD_Roll), 0, DataH0, 46, 2); + Array.Copy(BitConverter.GetBytes(RTP.SD_Pitch), 0, DataH0, 48, 2); + + Array.Copy(BitConverter.GetBytes(RTP.SD_FrameId), 0, DataH0, 50, 2); + Array.Copy(BitConverter.GetBytes(RTP.DE_TLV_X), 0, DataH0, 52, 4); + Array.Copy(BitConverter.GetBytes(RTP.DE_TLV_Y), 0, DataH0, 56, 4); + Array.Copy(BitConverter.GetBytes(RTP.DE_TLV_dX), 0, DataH0, 60, 4); + Array.Copy(BitConverter.GetBytes(RTP.DE_TLV_dY), 0, DataH0, 64, 4); } public static void MakeDataH1() {