This is an automated email from the ASF dual-hosted git repository. acassis pushed a commit to branch master in repository https://gitbox.apache.org/repos/asf/nuttx-apps.git
commit 8594627d8a235bec89ca967b0c5a75a1e3b1776e Author: wangjianyu3 <[email protected]> AuthorDate: Sat Aug 16 20:48:51 2025 +0800 system/nxinit: Add class start/stop for service Usage: class_start <classname> class_stop <classname> Signed-off-by: wangjianyu3 <[email protected]> --- system/nxinit/builtin.c | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/system/nxinit/builtin.c b/system/nxinit/builtin.c index 34a514bf3..032b3269f 100644 --- a/system/nxinit/builtin.c +++ b/system/nxinit/builtin.c @@ -57,6 +57,10 @@ static int cmd_stop(FAR struct action_manager_s *am, int argc, FAR char **argv); static int cmd_exec(FAR struct action_manager_s *am, int argc, FAR char **argv); +static int cmd_class_start(FAR struct action_manager_s *am, + int argc, FAR char **argv); +static int cmd_class_stop(FAR struct action_manager_s *am, + int argc, FAR char **argv); /**************************************************************************** * Private Data @@ -64,6 +68,8 @@ static int cmd_exec(FAR struct action_manager_s *am, static const struct cmd_map_s g_builtin[] = { + {"class_start", 2, 2, cmd_class_start}, + {"class_stop", 2, 2, cmd_class_stop}, {"exec", 3, 99, cmd_exec}, {"start", 2, 2, cmd_start}, {"stop", 2, 2, cmd_stop}, @@ -74,6 +80,18 @@ static const struct cmd_map_s g_builtin[] = * Private Functions ****************************************************************************/ +static int cmd_class_start(FAR struct action_manager_s *am, + int argc, FAR char **argv) +{ + return init_service_start_by_class(am->sm, argv[1]); +} + +static int cmd_class_stop(FAR struct action_manager_s *am, + int argc, FAR char **argv) +{ + return init_service_stop_by_class(am->sm, argv[1]); +} + static int cmd_start(FAR struct action_manager_s *am, int argc, FAR char **argv) {
