This commit is contained in:
cfif 2025-06-02 13:26:40 +03:00
commit 27d2d6a411
3 changed files with 128 additions and 0 deletions

View File

@ -0,0 +1,38 @@
//
// Created by zemon on 20.12.22.
//
#ifndef UVEOS_ON_NATION_ECOOLSIMULATION_H
#define UVEOS_ON_NATION_ECOOLSIMULATION_H
#include "UveosEmergencyEventInterface.h"
#include "SystemDelayInterface.h"
#include "UserInputButtonWatcher.h"
#include "CliCmd.h"
#include "GsmWithGnss.h"
typedef struct {
tUveosEmergencySimulationInterface *uveosEmergSimulInter;
tUserInputButtonWatcher *userInpButtWatch;
float asi15;
float flipAngle;
tGsmWithGnss *gsmWithGnss
} tEcoolSimulation;
void CliCmd_EcoolSimulationHelp(tCliCmd *cli);
void CliCmd_EcoolSimulationInit(
tEcoolSimulation *envEmSim,
tUveosEmergencySimulationInterface *envEmSimExt,
tUserInputButtonWatcher *userInpButtWatch,
float asi15Ext,
float angleExt,
tGsmWithGnss *gsmWithGnss
);
uint8_t CliCmd_EcoolSimulation(tEcoolSimulation *envEmSim, tCliCmd *cli);
#endif //UVEOS_ON_NATION_ECOOLSIMULATION_H

View File

@ -0,0 +1,67 @@
//
// Created by zemon on 20.12.22.
//
#include "CliCmd/EcoolSimulation.h"
#include "UserInput.h"
void CliCmd_EcoolSimulationHelp(tCliCmd *cli) {
CliCmd_PrintLnStatic(cli, " access sub commands:");
CliCmd_PrintLnStatic(cli, " command [ sendAsi ] - Call, and sending ASI15 info");
CliCmd_PrintLnStatic(cli, " command [ sendFlip ] - Call, and sending flip angle info");
CliCmd_PrintLnStatic(cli, " command [ sendFull ] - Call, and sending full crash info");
CliCmd_PrintLnStatic(cli, " command [ help ] - help this as sub mode");
CliCmd_PrintLnStatic(cli, " command [ exit ] - exit as this sub mode");
CliCmd_PrintLnStatic(cli, "");
}
void CliCmd_EcoolSimulationInit(
tEcoolSimulation *envEmSim,
tUveosEmergencySimulationInterface *envEmSimExt,
tUserInputButtonWatcher *userInpButtWatch,
float asi15Ext,
float angleExt,
tGsmWithGnss *gsmWithGnss
){
envEmSim->uveosEmergSimulInter = envEmSimExt;
envEmSim->userInpButtWatch = userInpButtWatch;
envEmSim->asi15 = asi15Ext;
envEmSim->flipAngle = angleExt;
envEmSim->gsmWithGnss = gsmWithGnss;
}
uint8_t CliCmd_EcoolSimulation(tEcoolSimulation *envEmSim, tCliCmd *cli){
CliCmd_PrintLnStatic(cli, "THIS MODE EMERGENCY MANUAL CALL");
CliCmd_EcoolSimulationHelp(cli);
while (1) {
CliCmd_WaitLineDelay(cli, 1500);
if (CliCmd_RxStartsWithStatic(cli, "exit")) {
CliCmd_PrintLnStatic(cli, "EXIT IN BASE MODE...");
return 0;
}
if (CliCmd_RxStartsWithStatic(cli, "help")) {
CliCmd_EcoolSimulationHelp(cli);
CliCmd_WaitLine(cli);
}
if (CliCmd_RxStartsWithStatic(cli, "sendAsi")) {
CliCmd_PrintLnStatic(cli, "Ручная отправка данных ASI15");
UveosEmergencySimulationInterface_ASI15(envEmSim->uveosEmergSimulInter, envEmSim->asi15)
}
if (CliCmd_RxStartsWithStatic(cli, "sendFlip")) {
CliCmd_PrintLnStatic(cli, "Ручная отправка данных переворота");
UveosEmergencySimulationInterface_Flip(envEmSim->uveosEmergSimulInter, envEmSim->flipAngle)
}
if (CliCmd_RxStartsWithStatic(cli, "sendFull")) {
CliCmd_PrintLnStatic(cli, "Ручной вызов отправки полных данный экстренной ситуации");
UserInputButtonWatcher_SimulateButton(envEmSim->userInpButtWatch, UI_VIRT_BUTTON_EMERGENCY);
}
SystemDelayMs(4);
}
}

23
modular.json Normal file
View File

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