From 82f3d4e87773132acbeab47cf64f82533136034c Mon Sep 17 00:00:00 2001 From: Lorenz Meier Date: Mon, 22 Jun 2015 09:58:01 +0200 Subject: [PATCH] commander: Fix mavlink output --- src/modules/commander/commander.cpp | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/modules/commander/commander.cpp b/src/modules/commander/commander.cpp index d47b45d89f..eed18c95ad 100644 --- a/src/modules/commander/commander.cpp +++ b/src/modules/commander/commander.cpp @@ -360,7 +360,7 @@ int commander_main(int argc, char *argv[]) } if (!strcmp(argv[1], "check")) { - int mavlink_fd_local = open(MAVLINK_LOG_DEVICE, 0); + int mavlink_fd_local = px4_open(MAVLINK_LOG_DEVICE, 0); int checkres = prearm_check(&status, mavlink_fd_local); close(mavlink_fd_local); warnx("FINAL RESULT: %s", (checkres == 0) ? "OK" : "FAILED"); @@ -368,7 +368,7 @@ int commander_main(int argc, char *argv[]) } if (!strcmp(argv[1], "arm")) { - int mavlink_fd_local = open(MAVLINK_LOG_DEVICE, 0); + int mavlink_fd_local = px4_open(MAVLINK_LOG_DEVICE, 0); arm_disarm(true, mavlink_fd_local, "command line"); warnx("note: not updating home position on commandline arming!"); close(mavlink_fd_local); @@ -376,7 +376,7 @@ int commander_main(int argc, char *argv[]) } if (!strcmp(argv[1], "disarm")) { - int mavlink_fd_local = open(MAVLINK_LOG_DEVICE, 0); + int mavlink_fd_local = px4_open(MAVLINK_LOG_DEVICE, 0); arm_disarm(false, mavlink_fd_local, "command line"); close(mavlink_fd_local); return 0; @@ -933,7 +933,7 @@ int commander_thread_main(int argc, char *argv[]) mavlink_and_console_log_critical(mavlink_fd, "ERROR: BATTERY INIT FAIL"); } - mavlink_fd = open(MAVLINK_LOG_DEVICE, 0); + mavlink_fd = px4_open(MAVLINK_LOG_DEVICE, 0); /* vehicle status topic */ memset(&status, 0, sizeof(status)); @@ -1240,7 +1240,7 @@ int commander_thread_main(int argc, char *argv[]) if (mavlink_fd < 0 && counter % (1000000 / MAVLINK_OPEN_INTERVAL) == 0) { /* try to open the mavlink log device every once in a while */ - mavlink_fd = open(MAVLINK_LOG_DEVICE, 0); + mavlink_fd = px4_open(MAVLINK_LOG_DEVICE, 0); } arming_ret = TRANSITION_NOT_CHANGED;