From c9531818ecdce606a7da8d0bdc049f31637b5384 Mon Sep 17 00:00:00 2001 From: cfif Date: Tue, 30 Sep 2025 15:52:33 +0300 Subject: [PATCH] =?UTF-8?q?=D0=94=D0=BE=D0=B1=D0=B0=D0=B2=D0=BB=D0=B5?= =?UTF-8?q?=D0=BD=D1=8B=20=D0=B8=D0=BD=D1=82=D0=B5=D1=80=D1=84=D0=B5=D0=B9?= =?UTF-8?q?=D1=81=D1=8B=20=D0=B8=20=D0=B4=D1=80=D0=B0=D0=B9=D0=B2=D0=B5?= =?UTF-8?q?=D1=80=D1=8B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Inc/ComIntCmd/VersionsInfo.h | 15 ++++++++++++++ READMY.txt | 16 +++++++++++++++ Src/ComIntCmd/VersionsInfo.c | 38 ++++++++++++++++++++++++++++++++++++ modular.json | 22 +++++++++++++++++++++ 4 files changed, 91 insertions(+) create mode 100644 Inc/ComIntCmd/VersionsInfo.h create mode 100644 READMY.txt create mode 100644 Src/ComIntCmd/VersionsInfo.c create mode 100644 modular.json diff --git a/Inc/ComIntCmd/VersionsInfo.h b/Inc/ComIntCmd/VersionsInfo.h new file mode 100644 index 0000000..4aa4a53 --- /dev/null +++ b/Inc/ComIntCmd/VersionsInfo.h @@ -0,0 +1,15 @@ +// +// Created by xemon on 10.11.22. +// + +#ifndef UVEOS_ON_NATION_VERSIONSINFO_H +#define UVEOS_ON_NATION_VERSIONSINFO_H + +#include "VersionsInfoTable.h" +#include "XfcProtProcessorUtilDefines.h" + +void XfcProtMethodsAdd_VersionsInfo(tXfcProtTable *protTab, tVersionsInfoTable *versions); + +uint8_t XfcProtMethod_VersionsInfo(tXfcArray *request, tXfcArray *response, tVersionsInfoTable *versions); + +#endif //UVEOS_ON_NATION_VERSIONSINFO_H \ No newline at end of file diff --git a/READMY.txt b/READMY.txt new file mode 100644 index 0000000..fc7c180 --- /dev/null +++ b/READMY.txt @@ -0,0 +1,16 @@ + +обычный транспортный протокол XfcTransportProtocol: +Прописать в modular.json: + { + "type": "git", + "provider": "ficom_modules", + "repo": "XfcTransportProtocol" + }, + +Расширеный транспортный протокол XfcTransportProtocol_Extended. +Прописать в modular.json: + { + "type": "git", + "provider": "ficom_modules", + "repo": "XfcTransportProtocol_Extended" + }, \ No newline at end of file diff --git a/Src/ComIntCmd/VersionsInfo.c b/Src/ComIntCmd/VersionsInfo.c new file mode 100644 index 0000000..0d02a39 --- /dev/null +++ b/Src/ComIntCmd/VersionsInfo.c @@ -0,0 +1,38 @@ +// +// Created by cfif on 04.10.2022. +// + +#include "ComIntCmd/VersionsInfo.h" + +void XfcProtMethodsAdd_VersionsInfo(tXfcProtTable *protTab, tVersionsInfoTable *versions) { + XfcProtTable_AddStatic(protTab, "VERSIONS_INFO", XfcProtMethod_VersionsInfo, versions); +} + +uint8_t XfcProtMethod_VersionsInfo(tXfcArray *request, tXfcArray *response, tVersionsInfoTable *versions) { + + XFC_CMD_TX_ADD_RAW(versions->count); + + for (uint16_t versionIdx = 0; versionIdx < versions->count; ++versionIdx) { + tVersionPair *versionPair = versions->items + versionIdx; + + XFC_CMD_TX_ADD_RAW(versionPair->name.length); + XFC_CMD_TX_ADD_ARR(versionPair->name.data, versionPair->name.length); + + XFC_CMD_TX_ADD_RAW(*versionPair->value.length); + XFC_CMD_TX_ADD_ARR(versionPair->value.data, *versionPair->value.length); + } + +// XFC_CMD_TX_ADD_PSTR("FIRMWARE"); +// XFC_CMD_TX_ADD_RAW(versions->FIRMWARE_ID.length); +// XFC_CMD_TX_ADD_ARR(versions->FIRMWARE_ID.str, versions->FIRMWARE_ID.length); +// +// XFC_CMD_TX_ADD_PSTR("DEVICE_ID"); +// XFC_CMD_TX_ADD_RAW(versions->DEVICE_ID.length); +// XFC_CMD_TX_ADD_ARR(versions->DEVICE_ID.str, versions->DEVICE_ID.length); +// +// XFC_CMD_TX_ADD_PSTR("BOARD"); +// XFC_CMD_TX_ADD_RAW(versions->BOARD_ID.length); +// XFC_CMD_TX_ADD_ARR(versions->BOARD_ID.str, versions->BOARD_ID.length); + + return XFC_TRANSPORT_PROTOCOL_RESPONSE_RESULT_OK; +} diff --git a/modular.json b/modular.json new file mode 100644 index 0000000..c0a8433 --- /dev/null +++ b/modular.json @@ -0,0 +1,22 @@ +{ + "dep": [ + { + "type": "git", + "provider": "HVAC_M7", + "repo": "XfcTransportProtocol" + }, + { + "type": "git", + "provider": "HVAC_M7", + "repo": "VersionsInfoTable" + } + ], + "cmake": { + "inc_dirs": [ + "Inc" + ], + "srcs": [ + "Src/**.c" + ] + } +} \ No newline at end of file