commit 9a0c34e9f9ee88d0fa180d61655bb27f63ec1469 Author: cfif Date: Mon Jun 2 13:26:40 2025 +0300 Init diff --git a/DataRuntime.c b/DataRuntime.c new file mode 100644 index 0000000..f333da6 --- /dev/null +++ b/DataRuntime.c @@ -0,0 +1,49 @@ +// +// Created by xemon on 19.12.22. +// + +#include "DataRuntime.h" +//#include "FirmwareMetadataSection.h" +#include "FirmwareUveosMetadataSection.h" + +void DeviceDataRuntime_InitDefaults(tDeviceDataRuntime *env) { + env->enableGnssUpdate = true; + env->EGTS_FLEET_ON = false; + env->disallowWrite = 0; + env->telematicaServerIsActive = false; + env->telematicaCloseConnect = false; + env->telematicaWaitConnect = false; +} + + +#define ADD_VAR_SIZE(TYPE, NAME, VALUE, LEN, GROUP) \ + VariablesTableAdd( \ + variablesTable, \ + #NAME, \ + sizeof (#NAME)-1, \ + VARIABLE_TYPE_##TYPE, \ + (VALUE), \ + (LEN), \ + 0, \ + GROUP \ + ) + +#define ADD_VAR(TYPE, NAME, VALUE) ADD_VAR_SIZE(TYPE, NAME, VALUE, 0, VARIABLES_GROUP) +#define ADD_VAR_STR_OBJ(TYPE, NAME, VALUE) ADD_VAR_SIZE(TYPE, NAME, &(VALUE).data, &(VALUE).length,VARIABLES_GROUP) + +// Добавление переменных в таблицу +void DeviceDataRuntime_AddToVarTab( + tDeviceDataRuntime *env, + tVariablesTable *variablesTable, + uint32_t VARIABLES_GROUP +) { + ADD_VAR(BOOL, ENABLE_GNSS_UPDATE, &env->enableGnssUpdate); + ADD_VAR(BOOL, EGTS_FLEET_ON, &env->EGTS_FLEET_ON); + ADD_VAR(BOOL, TELEMATICA_SERVER_IS_ACTIVE, &env->telematicaServerIsActive); + ADD_VAR_SIZE(STRING, DEV_VERSION, (void *) META_FW_NAME, (void *) &META_FW_NAME_SIZE, VARIABLES_GROUP); + VariablesTable_GetLast(variablesTable)->writeAttempts = &env->disallowWrite; +} + +#undef ADD_VAR_SIZE +#undef ADD_VAR +#undef ADD_VAR_STR_OBJ \ No newline at end of file diff --git a/DataRuntime.h b/DataRuntime.h new file mode 100644 index 0000000..63421d4 --- /dev/null +++ b/DataRuntime.h @@ -0,0 +1,30 @@ +// +// Created by zemon on 20.02.24. +// + +#ifndef HEAVY_TERMINAL_DEVICEDATARUNTIME_H +#define HEAVY_TERMINAL_DEVICEDATARUNTIME_H + +#include +#include +#include +#include + +typedef struct { + bool enableGnssUpdate; + bool EGTS_FLEET_ON; // Флаг включения функции мониторинга + bool telematicaServerIsActive; + bool telematicaCloseConnect; + bool telematicaWaitConnect; + uint16_t disallowWrite; + tCarFlipDetectionSettings flip; +} tDeviceDataRuntime; + +void DeviceDataRuntime_InitDefaults(tDeviceDataRuntime *env); + +void DeviceDataRuntime_AddToVarTab( + tDeviceDataRuntime *env, + tVariablesTable *variablesTable, + uint32_t VARIABLES_GROUP +); +#endif //HEAVY_TERMINAL_DEVICEDATARUNTIME_H diff --git a/modular.json b/modular.json new file mode 100644 index 0000000..c9dfdf3 --- /dev/null +++ b/modular.json @@ -0,0 +1,17 @@ +{ + "dep": [ + { + "type": "git", + "provider": "Smart_Components_Aurus", + "repo": "VariablesTable" + } + ], + "cmake": { + "inc_dirs": [ + "./" + ], + "srcs": [ + "./**.c" + ] + } +} \ No newline at end of file