forked from Archive/PX4-Autopilot
mavlink: add 'verbose [on|off]' command
This commit is contained in:
parent
371586be2c
commit
cf3b068179
|
@ -506,7 +506,7 @@ Mavlink::set_verbose(bool v)
|
||||||
}
|
}
|
||||||
|
|
||||||
int
|
int
|
||||||
Mavlink::set_verbose_all_instances()
|
Mavlink::set_verbose_all_instances(bool enabled)
|
||||||
{
|
{
|
||||||
Mavlink *inst = ::_mavlink_instances;
|
Mavlink *inst = ::_mavlink_instances;
|
||||||
|
|
||||||
|
@ -514,7 +514,7 @@ Mavlink::set_verbose_all_instances()
|
||||||
|
|
||||||
while (inst != nullptr) {
|
while (inst != nullptr) {
|
||||||
|
|
||||||
inst->set_verbose(true);
|
inst->set_verbose(enabled);
|
||||||
|
|
||||||
/* move on */
|
/* move on */
|
||||||
inst = inst->next;
|
inst = inst->next;
|
||||||
|
@ -2834,7 +2834,13 @@ int mavlink_main(int argc, char *argv[])
|
||||||
return Mavlink::get_status_all_instances();
|
return Mavlink::get_status_all_instances();
|
||||||
|
|
||||||
} else if (!strcmp(argv[1], "verbose")) {
|
} else if (!strcmp(argv[1], "verbose")) {
|
||||||
return Mavlink::set_verbose_all_instances();
|
bool on = true;
|
||||||
|
|
||||||
|
if (argc > 2 && !strcmp(argv[2], "off")) {
|
||||||
|
on = false;
|
||||||
|
}
|
||||||
|
|
||||||
|
return Mavlink::set_verbose_all_instances(on);
|
||||||
|
|
||||||
} else if (!strcmp(argv[1], "stream")) {
|
} else if (!strcmp(argv[1], "stream")) {
|
||||||
return Mavlink::stream_command(argc, argv);
|
return Mavlink::stream_command(argc, argv);
|
||||||
|
|
|
@ -138,7 +138,7 @@ public:
|
||||||
* This is primarily intended for analysis and
|
* This is primarily intended for analysis and
|
||||||
* not intended for normal operation
|
* not intended for normal operation
|
||||||
*/
|
*/
|
||||||
static int set_verbose_all_instances();
|
static int set_verbose_all_instances(bool enabled);
|
||||||
|
|
||||||
static bool instance_exists(const char *device_name, Mavlink *self);
|
static bool instance_exists(const char *device_name, Mavlink *self);
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue