mirror of
https://gitee.com/mirrors_PX4/PX4-Autopilot.git
synced 2026-10-15 08:13:33 +08:00
Linux: added builtins to show devices and topics
list_devices will list virtual devices starting with "/dev/".
list_topics will list topics ("/obj/")
Signed-off-by: Mark Charlebois <charlebm@gmail.com>
This commit is contained in:
@@ -63,6 +63,7 @@ print """
|
||||
static int shutdown_main(int argc, char *argv[]);
|
||||
static int list_tasks_main(int argc, char *argv[]);
|
||||
static int list_devices_main(int argc, char *argv[]);
|
||||
static int list_topics_main(int argc, char *argv[]);
|
||||
}
|
||||
|
||||
|
||||
@@ -78,6 +79,7 @@ for app in apps:
|
||||
print '\tapps["shutdown"] = shutdown_main;'
|
||||
print '\tapps["list_tasks"] = list_tasks_main;'
|
||||
print '\tapps["list_devices"] = list_devices_main;'
|
||||
print '\tapps["list_topics"] = list_topics_main;'
|
||||
print """
|
||||
return apps;
|
||||
}
|
||||
@@ -108,5 +110,11 @@ static int list_devices_main(int argc, char *argv[])
|
||||
px4_show_devices();
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int list_topics_main(int argc, char *argv[])
|
||||
{
|
||||
px4_show_topics();
|
||||
return 0;
|
||||
}
|
||||
"""
|
||||
|
||||
|
||||
Reference in New Issue
Block a user