Skip to content
Snippets Groups Projects
Commit b3b22b1c authored by Lorenz Meier's avatar Lorenz Meier
Browse files

Airspeed driver: Proper start handling

parent c32310b6
No related branches found
No related tags found
No related merge requests found
......@@ -561,7 +561,7 @@ info()
static void
meas_airspeed_usage()
{
PX4_WARN("usage: meas_airspeed_sim command [options]");
PX4_WARN("usage: measairspeedsim command [options]");
PX4_WARN("options:");
PX4_WARN("\t-b --bus i2cbus (%d)", 1);
PX4_WARN("command:");
......@@ -583,41 +583,41 @@ measairspeedsim_main(int argc, char *argv[])
}
}
int ret = 0;
int ret = 1;
/*
* Start/load the driver.
*/
if (!strcmp(argv[1], "start")) {
ret = meas_airspeed_sim::start(i2c_bus);
return meas_airspeed_sim::start(i2c_bus);
}
/*
* Stop the driver
*/
if (!strcmp(argv[1], "stop")) {
ret = meas_airspeed_sim::stop();
return meas_airspeed_sim::stop();
}
/*
* Test the driver/device.
*/
if (!strcmp(argv[1], "test")) {
ret = meas_airspeed_sim::test();
return meas_airspeed_sim::test();
}
/*
* Reset the driver.
*/
if (!strcmp(argv[1], "reset")) {
ret = meas_airspeed_sim::reset();
return meas_airspeed_sim::reset();
}
/*
* Print driver information.
*/
if (!strcmp(argv[1], "info") || !strcmp(argv[1], "status")) {
ret = meas_airspeed_sim::info();
return meas_airspeed_sim::info();
}
meas_airspeed_usage();
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment