This commit is contained in:
cfif 2025-06-02 13:26:41 +03:00
commit 7af427ea38
5 changed files with 84 additions and 0 deletions

17
Inc/ComIntCmd/Tests.h Normal file
View File

@ -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

9
Src/ComIntCmd/Tests.c Normal file
View File

@ -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);
}

24
Src/ComIntCmd/TestsGet.c Normal file
View File

@ -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;
}

View File

@ -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;
}

22
modular.json Normal file
View File

@ -0,0 +1,22 @@
{
"dep": [
{
"type": "git",
"provider": "Smart_Components_Aurus",
"repo": "XfcTransportProtocol"
},
{
"type": "git",
"provider": "Smart_Components_Aurus",
"repo": "DeviceTestsTable"
}
],
"cmake": {
"inc_dirs": [
"Inc"
],
"srcs": [
"Src/**.c"
]
}
}