mirror of
https://gitee.com/xiaohuolufeihua/bizhang_-obav.git
synced 2026-05-22 09:28:58 +00:00
Add a check command and fix error reporting
This commit is contained in:
@@ -286,15 +286,20 @@ int commander_main(int argc, char *argv[])
|
||||
exit(0);
|
||||
}
|
||||
|
||||
/* commands needing the app to run below */
|
||||
if (!thread_running) {
|
||||
warnx("\tcommander not started");
|
||||
exit(1);
|
||||
}
|
||||
|
||||
if (!strcmp(argv[1], "status")) {
|
||||
if (thread_running) {
|
||||
warnx("\tcommander is running");
|
||||
print_status();
|
||||
|
||||
} else {
|
||||
warnx("\tcommander not started");
|
||||
}
|
||||
print_status();
|
||||
exit(0);
|
||||
}
|
||||
|
||||
if (!strcmp(argv[1], "check")) {
|
||||
int checkres = prearm_check(&status, mavlink_fd);
|
||||
warnx("FINAL RESULT: %s", (checkres == 0) ? "OK" : "FAILED");
|
||||
exit(0);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user