67 lines
2.5 KiB
C
67 lines
2.5 KiB
C
//
|
|
// 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_BUTTON_EMERGENCY);
|
|
}
|
|
|
|
SystemDelayMs(4);
|
|
}
|
|
} |