From dd412aedc85f6f20bb4b70c961c97fb39baeb911 Mon Sep 17 00:00:00 2001 From: cfif Date: Wed, 4 Dec 2024 13:10:49 +0300 Subject: [PATCH] Init --- Inc/ComIntCmd/Tests.h | 17 +++++++++++++++++ Src/ComIntCmd/Tests.c | 9 +++++++++ Src/ComIntCmd/TestsGet.c | 24 ++++++++++++++++++++++++ Src/ComIntCmd/TestsSetRepeats.c | 12 ++++++++++++ modular.json | 22 ++++++++++++++++++++++ 5 files changed, 84 insertions(+) create mode 100644 Inc/ComIntCmd/Tests.h create mode 100644 Src/ComIntCmd/Tests.c create mode 100644 Src/ComIntCmd/TestsGet.c create mode 100644 Src/ComIntCmd/TestsSetRepeats.c create mode 100644 modular.json diff --git a/Inc/ComIntCmd/Tests.h b/Inc/ComIntCmd/Tests.h new file mode 100644 index 0000000..5f236e7 --- /dev/null +++ b/Inc/ComIntCmd/Tests.h @@ -0,0 +1,17 @@ +// +// Created by xemon on 10.11.22. +// + +#ifndef UVEOS_ON_NATION_TESTS_H +#define UVEOS_ON_NATION_TESTS_H + +#include "XfcProtProcessorUtilDefines.h" +#include "DeviceTestsTable.h" + +void XfcProtMethodsAdd_Tests(tXfcProtTable *protTab, tDeviceTestsTable *testsTab); + +uint8_t XfcProtMethod_TestsGet(tXfcArray *request, tXfcArray *response, tDeviceTestsTable *testsTab); + +uint8_t XfcProtMethod_TestsSetRepeats(tXfcArray *request, tXfcArray *response, tDeviceTestsTable *testsTab); + +#endif //UVEOS_ON_NATION_TESTS_H diff --git a/Src/ComIntCmd/Tests.c b/Src/ComIntCmd/Tests.c new file mode 100644 index 0000000..8fbc3e1 --- /dev/null +++ b/Src/ComIntCmd/Tests.c @@ -0,0 +1,9 @@ +// +// Created by xemon on 10.11.22. +// +#include "ComIntCmd/Tests.h" + +void XfcProtMethodsAdd_Tests(tXfcProtTable *protTab, tDeviceTestsTable *testsTab) { + XfcProtTable_AddStatic(protTab, "TESTS_GET_RESULTS", XfcProtMethod_TestsGet, testsTab); + XfcProtTable_AddStatic(protTab, "TESTS_SET_REPEATS", XfcProtMethod_TestsSetRepeats, testsTab); +} \ No newline at end of file diff --git a/Src/ComIntCmd/TestsGet.c b/Src/ComIntCmd/TestsGet.c new file mode 100644 index 0000000..ad4e30f --- /dev/null +++ b/Src/ComIntCmd/TestsGet.c @@ -0,0 +1,24 @@ +// +// Created by cfif on 14.10.22. +// + +#include "ComIntCmd/Tests.h" + + +uint8_t XfcProtMethod_TestsGet(tXfcArray *request, tXfcArray *response, tDeviceTestsTable *testsTab) { + + XFC_CMD_TX_ADD_RAW(testsTab->testProcessBegin); + XFC_CMD_TX_ADD_RAW(testsTab->testProcessEnd); + + XFC_CMD_TX_ADD_RAW(testsTab->currentProcessIterationsLeft); + + XFC_CMD_TX_ADD_RAW(testsTab->count); + + for (uint16_t count = 0; count < testsTab->count; ++count) { + XFC_CMD_TX_ADD_RAW(testsTab->items[count].name.length); + XFC_CMD_TX_ADD_ARR(testsTab->items[count].name.str, testsTab->items[count].name.length); + XFC_CMD_TX_ADD_RAW(testsTab->items[count].result); + } + + return XFC_TRANSPORT_PROTOCOL_RESPONSE_RESULT_OK; +} \ No newline at end of file diff --git a/Src/ComIntCmd/TestsSetRepeats.c b/Src/ComIntCmd/TestsSetRepeats.c new file mode 100644 index 0000000..10e896e --- /dev/null +++ b/Src/ComIntCmd/TestsSetRepeats.c @@ -0,0 +1,12 @@ +// +// Created by cfif on 17.10.22. +// + +#include "ComIntCmd/Tests.h" + +uint8_t XfcProtMethod_TestsSetRepeats(tXfcArray *request, tXfcArray *response, tDeviceTestsTable *testsTab) { + + XFC_CMD_RX_GET_RAW(testsTab->currentProcessIterationsLeft); + + return XFC_TRANSPORT_PROTOCOL_RESPONSE_RESULT_OK; +} diff --git a/modular.json b/modular.json new file mode 100644 index 0000000..6bdd79e --- /dev/null +++ b/modular.json @@ -0,0 +1,22 @@ +{ + "dep": [ + { + "type": "git", + "provider": "NAVIGATOR_UVEOS_NATION_TELIT", + "repo": "XfcTransportProtocol" + }, + { + "type": "git", + "provider": "NAVIGATOR_UVEOS_NATION_TELIT", + "repo": "DeviceTestsTable" + } + ], + "cmake": { + "inc_dirs": [ + "Inc" + ], + "srcs": [ + "Src/**.c" + ] + } +} \ No newline at end of file