-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmain.cpp
More file actions
33 lines (26 loc) · 791 Bytes
/
main.cpp
File metadata and controls
33 lines (26 loc) · 791 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
#include "utils.h"
#include "runner.h"
int main(int argc, char* argv[]) {
printf_s("Boot TFP-VRUNNER...\n");
std::string fileName;
if (!parseArguments(argc, argv, fileName)) {
return 0;
}
if (!bootApplication(fileName)) {
printf_s("ERROR: failed to boot application\n");
return 0;
}
printf_s("Current pid%d\n", g_dwRunningPID);
while (1) {
if (!isProcessRunning(g_dwRunningPID)) {
printf_s("*** REBOOT application %s\n", fileName.c_str());
if (!bootApplication(fileName)) {
printf_s("ERROR: cannot restart file %s\n", fileName.c_str());
return 0;
}
}
platformSleep(5000);
}
printf_s("Shutdown TFP-VRUNNER...\n");
return 0;
}