From be78cdf6434cb2a3bb330beb5a55331457e51c5e Mon Sep 17 00:00:00 2001 From: cfif Date: Fri, 24 Jan 2025 13:22:32 +0300 Subject: [PATCH] =?UTF-8?q?=D0=9F=D0=B5=D1=80=D0=B5=D0=BD=D0=BE=D1=81=20?= =?UTF-8?q?=D0=BD=D0=B0=20=D0=BD=D0=BE=D0=B2=D1=83=D1=8E=20=D0=BE=D1=80?= =?UTF-8?q?=D0=B3=D0=B0=D0=BD=D0=B8=D0=B7=D0=B0=D1=86=D0=B8=D1=8E=20GONEC?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Inc/AlmanahParser.h | 55 +++++++++++++++++++++++++++++++++++++++++++++ Src/AlmanahParser.c | 10 +++++++++ modular.json | 10 +++++++++ 3 files changed, 75 insertions(+) create mode 100644 Inc/AlmanahParser.h create mode 100644 Src/AlmanahParser.c create mode 100644 modular.json diff --git a/Inc/AlmanahParser.h b/Inc/AlmanahParser.h new file mode 100644 index 0000000..cfe0e06 --- /dev/null +++ b/Inc/AlmanahParser.h @@ -0,0 +1,55 @@ +// +// Created by xemon on 01.09.22. +// + +#ifndef ALMANAH_PARSER_H +#define ALMANAH_PARSER_H +#include "stdint.h" +#include "ModemMain.h" + +typedef struct __attribute__ ((packed)) { + uint8_t packetType; // Тип пакета + uint16_t sizeTransportPacket; // Размер транспортного служебного пакета + uint8_t numberRecipient[3]; // Номер получателя + uint8_t idArray; // Идентификатор массива + uint16_t offsetByteArray; // Смещение первого байта сегмента в массиве + uint8_t isEndSegment; // Признак последнего сегмент в массиве + uint8_t typeArray; // Тип массива +} tStructTransport_Packet; + +typedef struct { + uint8_t numberKA; // Номер КА + uint16_t numberCoil; // Номер витка + + struct { + uint8_t year; + uint8_t month; + uint8_t day; + } beginWorkAlmanah; // Начало работы альманаха + + struct { + uint64_t seconds; + uint8_t minutes; + uint8_t hours; + } equatorTime; // Время экватора + + uint64_t bigAxisOrbit; // Большая полуось орбиты + uint64_t averageValue1; + uint64_t averageValue2; + uint64_t averageValue3; + uint64_t averageValue4; + uint64_t averageValue5; + uint64_t averageValue6; + uint64_t averageValue7; + uint64_t averageValue8; + uint64_t averageValue9; + + struct { + uint8_t year; + uint8_t month; + uint8_t day; + } endWorkAlmanah; // Конец работы альманаха + +} tStructAlmanahTransportPacket; + +#endif //ALMANAH_PARSER_H diff --git a/Src/AlmanahParser.c b/Src/AlmanahParser.c new file mode 100644 index 0000000..7968af1 --- /dev/null +++ b/Src/AlmanahParser.c @@ -0,0 +1,10 @@ +// +// Created by xemon on 01.09.22. +// +#include "AlmanahParser.h" + + +void ParseTransportPacket(uint8_t *buf, tStructTransport_Packet *structTransportPacket) { + + +} \ No newline at end of file diff --git a/modular.json b/modular.json new file mode 100644 index 0000000..71971cd --- /dev/null +++ b/modular.json @@ -0,0 +1,10 @@ +{ + "cmake": { + "inc_dirs": [ + "Inc" + ], + "srcs": [ + "Src/**.c" + ] + } +} \ No newline at end of file