feat(px4): support Windows daemon and shell runtime

Make PX4 startup, daemon command handling, shell I/O, shutdown, logging, getopt, and instance state work across POSIX and native Windows runtime boundaries.

Keep command-client behavior explicit by routing shell output through shared logger paths and preserving socket protocol return markers during shutdown.
This commit is contained in:
Nuno Marques
2026-05-11 10:31:25 -07:00
parent be01eb648b
commit 3e37a74173
24 changed files with 2346 additions and 133 deletions
+14 -1
View File
@@ -2,6 +2,7 @@
#include <px4_platform_common/time.h>
#include <px4_platform_common/posix.h>
#include <px4_platform_common/log.h>
#include <px4_platform_common/exit.h>
#include <uORB/uORB.h>
#include "apps.h"
@@ -43,9 +44,21 @@ void list_builtins(apps_map_type &apps)
int shutdown_main(int argc, char *argv[])
{
// Reject any leftover positional arguments (e.g. "status", "start", "stop").
// shutdown takes no flags or subcommands -- it always tears the daemon
// down -- so silently ignoring extra args would terminate the daemon when
// the user almost certainly meant a different module (e.g.
// "<module> status"). Print usage and exit non-zero instead.
if (argc > 1) {
PX4_ERR("unrecognized argument: %s", argv[1]);
printf("Usage:\n shutdown\n");
return 1;
}
printf("Exiting NOW.\n");
uorb_shutdown();
system_exit(0);
px4_platform_exit(0);
return 0;
}
int list_tasks_main(int argc, char *argv[])