From d9a377ad8e607a993dcbde4ef9cd17ee589a655f 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 --- DeviceDataNonVolatile.c | 30 +++++++++++++ DeviceDataNonVolatile.h | 75 +++++++++++++++++++++++++++++++++ DeviceDataNonVolatilePrivate.h | 14 ++++++ DeviceData_InitDeviceSettings.c | 10 +++++ modular.json | 12 ++++++ 5 files changed, 141 insertions(+) create mode 100644 DeviceDataNonVolatile.c create mode 100644 DeviceDataNonVolatile.h create mode 100644 DeviceDataNonVolatilePrivate.h create mode 100644 DeviceData_InitDeviceSettings.c create mode 100644 modular.json diff --git a/DeviceDataNonVolatile.c b/DeviceDataNonVolatile.c new file mode 100644 index 0000000..40fa60b --- /dev/null +++ b/DeviceDataNonVolatile.c @@ -0,0 +1,30 @@ +// +// Created by xemon on 19.12.22. +// +#include "DeviceDataNonVolatilePrivate.h" + + + +void DeviceDataNonVolatile_InitDefaults(tDeviceDataNonVolatile *env) { + DeviceStorageInitDeviceSettings(&env->device); +// vUveosGostSettingsInitDefaults(&env->gost); + // DeviceStorageInitCodec(&env->audioCodec); +// CarFlipDetection_InitSettings(&env->flip); +// EraGlonassMsdTable_Init(&env->msdTable); + vSettings_Basic_AccessInitDefaults(&env->Settings_Basic_Access); + vSettings_Settings_Date_TimeInitDefaults(&env->Settings_Date_Time); + vSettings_Frequency_SpeedInitDefaults(&env->Settings_Frequency_Speed); + vSettings_GeneralInitDefaults(&env->Settings_General); + vSettings_NetworkInitDefaults(&env->Settings_Network); + vSettings_RS485_BluetoothInitDefaults(&env->Settings_RS485_Bluetooth); + vSettings_TracertInitDefaults(&env->Settings_Tracert); + vSettings_TransceiverInitDefaults(&env->Settings_Transceiver); + vSettings_GSMInitDefaults(&env->Settings_GSM); +// InitKeys(env->Keys); + + //проверка соответствия версии хранилища + //позволяет принудительно сбросить хранилище + //к значениям по умолчанию вслучае установки + //значения большее чем в придыдущих прошивках + env->version = DEVICE_DATA_NO_VOLATILE_VERSION; +} \ No newline at end of file diff --git a/DeviceDataNonVolatile.h b/DeviceDataNonVolatile.h new file mode 100644 index 0000000..3b509d7 --- /dev/null +++ b/DeviceDataNonVolatile.h @@ -0,0 +1,75 @@ +// +// Created by xemon on 19.10.22. +// + +#ifndef UVEOS_ON_NATION_DEVICEDATANONVOLATILE_H +#define UVEOS_ON_NATION_DEVICEDATANONVOLATILE_H + +//#include +//#include +//#include +//#include +//#include + +#include +#include "Settings_General.h" +#include "Settings_Basic_Access.h" +#include "Settings_Frequency_Speed.h" +#include "Settings_Tracert.h" +#include "Settings_Network.h" +#include "Settings_Transceiver.h" +#include "Settings_RS485_Bluetooth.h" +#include "Settings_Date_Time.h" +#include "Settings_GSM.h" +#include "Settings_Transmitter.h" +#include "Settings_Msd.h" +#include "Settings_Ams_Radar.h" +#include "Settings_LoRaWan.h" + +#define DEVICE_DATA_NO_VOLATILE_VERSION 0x10 + +typedef struct { + bool useInternalAnt; + struct { + tString16 value; + uint16_t writeAccess; + } serialNumber; + tString16 smsServiceCenter; +} tDeviceSettings; + +typedef struct { + uint32_t version; +// tUveosGostSettings gost; +// MAX9860_ComplexAudioConfig audioCodec; +// tCarFlipDetectionSettings flip; + tDeviceSettings device; +// tEraGlonassMsdTable msdTable; + + tSettings_General Settings_General; + tSettings_Basic_Access Settings_Basic_Access; + tSettings_Frequency_Speed Settings_Frequency_Speed; + tSettings_Tracert Settings_Tracert; + tSettings_Network Settings_Network; + tSettings_Transceiver Settings_Transceiver; + tSettings_Date_Time Settings_Date_Time; + tSettings_GSM Settings_GSM; + tSettings_RS485_Bluetooth Settings_RS485_Bluetooth; + tSettings_Transmitter Settings_Transmitter; + tSettings_Msd Settings_Msd; + tSettings_AmsRadar Settings_AmsRadar; + tSettings_LoRaWan Settings_LoRaWan; + + uint32_t maxId_OutBox; + uint32_t maxId_InBox; + uint32_t routing; + uint32_t dist; + uint32_t timeZoneInSat; + uint32_t flagSos; + +} tDeviceDataNonVolatile; + +void DeviceDataNonVolatile_InitDefaults(tDeviceDataNonVolatile *env); + + + +#endif //UVEOS_ON_NATION_DEVICEDATANONVOLATILE_H diff --git a/DeviceDataNonVolatilePrivate.h b/DeviceDataNonVolatilePrivate.h new file mode 100644 index 0000000..34fa8f9 --- /dev/null +++ b/DeviceDataNonVolatilePrivate.h @@ -0,0 +1,14 @@ +// +// Created by xemon on 19.12.22. +// + +#ifndef UVEOS_ON_NATION_DEVICEDATANONVOLATILEPRIVATE_H +#define UVEOS_ON_NATION_DEVICEDATANONVOLATILEPRIVATE_H + +#include "DeviceDataNonVolatile.h" + +//void DeviceStorageInitCodec(MAX9860_ComplexAudioConfig *audioConfig); + +void DeviceStorageInitDeviceSettings(tDeviceSettings *env); + +#endif //UVEOS_ON_NATION_DEVICEDATANONVOLATILEPRIVATE_H diff --git a/DeviceData_InitDeviceSettings.c b/DeviceData_InitDeviceSettings.c new file mode 100644 index 0000000..ea27731 --- /dev/null +++ b/DeviceData_InitDeviceSettings.c @@ -0,0 +1,10 @@ +// +// Created by xemon on 19.10.22. +// +#include "DeviceDataNonVolatilePrivate.h" + +void DeviceStorageInitDeviceSettings(tDeviceSettings *env) { + String16CopyStatic(&env->serialNumber.value, "Нет ID!"); + String16CopyStatic(&env->smsServiceCenter, "+79418100013"); + env->serialNumber.writeAccess = 1; +} diff --git a/modular.json b/modular.json new file mode 100644 index 0000000..5e4ed34 --- /dev/null +++ b/modular.json @@ -0,0 +1,12 @@ +{ + "dep": [ + ], + "cmake": { + "inc_dirs": [ + "./" + ], + "srcs": [ + "./**.c" + ] + } +} \ No newline at end of file