aboutsummaryrefslogtreecommitdiff
path: root/apps/drivers/px4io/px4io.cpp
diff options
context:
space:
mode:
authorJulian Oes <joes@student.ethz.ch>2012-12-23 13:23:28 -0800
committerJulian Oes <joes@student.ethz.ch>2013-01-10 15:49:53 -0800
commitb5eccef69ead2efb1f5469c6f6f0e4171edc3c95 (patch)
tree0e5f71757d1fba640b6f5c7c8a726242aecb95e4 /apps/drivers/px4io/px4io.cpp
parent5e20dd173612611724dcbd5ab5c9a15dfb0a33e1 (diff)
downloadpx4-firmware-b5eccef69ead2efb1f5469c6f6f0e4171edc3c95.tar.gz
px4-firmware-b5eccef69ead2efb1f5469c6f6f0e4171edc3c95.tar.bz2
px4-firmware-b5eccef69ead2efb1f5469c6f6f0e4171edc3c95.zip
Started with px4io stop implementation
Diffstat (limited to 'apps/drivers/px4io/px4io.cpp')
-rw-r--r--apps/drivers/px4io/px4io.cpp31
1 files changed, 30 insertions, 1 deletions
diff --git a/apps/drivers/px4io/px4io.cpp b/apps/drivers/px4io/px4io.cpp
index fd531a327..c0a20c133 100644
--- a/apps/drivers/px4io/px4io.cpp
+++ b/apps/drivers/px4io/px4io.cpp
@@ -825,9 +825,38 @@ px4io_main(int argc, char *argv[])
exit(0);
}
+ if (!strcmp(argv[1], "stop")) {
+
+ if (g_dev != nullptr) {
+ /* stop the driver */
+ delete g_dev;
+ } else {
+ errx(1, "not loaded");
+ }
+ exit(0);
+ }
+
+
+ if (!strcmp(argv[1], "status")) {
+
+ if (g_dev != nullptr)
+ printf("[px4io] loaded\n");
+ else
+ printf("[px4io] not loaded\n");
+
+ exit(0);
+ }
+
/* note, stop not currently implemented */
if (!strcmp(argv[1], "update")) {
+
+ if (g_dev != nullptr) {
+ printf("[px4io] loaded, detaching first\n");
+ /* stop the driver */
+ delete g_dev;
+ }
+
PX4IO_Uploader *up;
const char *fn[3];
@@ -883,5 +912,5 @@ px4io_main(int argc, char *argv[])
if (!strcmp(argv[1], "monitor"))
monitor();
- errx(1, "need a command, try 'start', 'test', 'monitor' or 'update'");
+ errx(1, "need a command, try 'start', 'stop', 'status', 'test', 'monitor' or 'update'");
}