diff --git a/MainModesArbiter.c b/MainModesArbiter.c index f8aaefd..7a8bce5 100644 --- a/MainModesArbiter.c +++ b/MainModesArbiter.c @@ -19,23 +19,29 @@ #ifdef UVEOS_ADD_TELEMATICA void TELEMATICA_START(tMma *env) { - env->storage.runtime.EGTS_FLEET_ON = true; + + if (env->storage.nvm.deviceTeledataStorageData.telematica.telematicaIsActive) { + env->storage.runtime.EGTS_FLEET_ON = true; + } } void TELEMATICA_STOP(tMma *env) { - if (env->storage.runtime.EGTS_FLEET_ON == true) { + if (env->storage.runtime.EGTS_FLEET_ON) { - env->storage.runtime.EGTS_FLEET_ON = false; + if (env->storage.runtime.EGTS_FLEET_ON == true) { - for (uint8_t i = 0; i < 30; ++i) { - if (env->storage.runtime.telematicaCloseConnect) - break; + env->storage.runtime.EGTS_FLEET_ON = false; - SystemDelayMs(100); + for (uint8_t i = 0; i < 30; ++i) { + if (env->storage.runtime.telematicaCloseConnect) + break; + + SystemDelayMs(100); + } } - } + } } #endif