SMART_COMPONENTS_DeviceStor.../DeviceStorage.c

25 lines
750 B
C

//
// Created by cfif on 07.10.22.
//
#include "DeviceStorage.h"
#include "StorageOnFlashArtery.h"
#include "InternalFlashPage.h"
bool DeviceStorage_Init(tDeviceStorage *env, tStorageInterface *storageInterface) {
tStorageOnFlashArtery *store = (tStorageOnFlashArtery *) storageInterface->env;
sInternalFlashPage_Read(store->mainFlashPageAddress, 0x0, (uint8_t *) &env->nvm, sizeof(env->nvm));
/*
if ((env->nvm.SettingsServerConnection.EGTS_SERVER_ADDRESS.length > 32) ||
(env->nvm.SettingsServerConnection.EGTS_ALT_SERVER_ADDRESS.length > 32) ||
(env->nvm.SettingsServerConnection.EGTS_GPRS_APN.length > 32)) {
DeviceDataNonVolatile_InitDefaults(&env->nvm);
return false;
}
*/
return true;
}