diff --git a/sys/auto_init/auto_init.c b/sys/auto_init/auto_init.c index 0e09305184..60eb331670 100644 --- a/sys/auto_init/auto_init.c +++ b/sys/auto_init/auto_init.c @@ -96,6 +96,12 @@ #include "schedstatistics.h" #endif +#ifdef MODULE_TEST_UTILS_INTERACTIVE_SYNC +#ifndef MODULE_SHELL_COMMANDS +#include "test_utils/interactive_sync.h" +#endif +#endif + #define ENABLE_DEBUG (0) #include "debug.h" @@ -597,4 +603,10 @@ void auto_init(void) extern void suit_init_conditions(void); suit_init_conditions(); #endif /* MODULE_SUIT */ + +#ifdef MODULE_TEST_UTILS_INTERACTIVE_SYNC +#ifndef MODULE_SHELL_COMMANDS + test_utils_interactive_sync(); +#endif +#endif /* MODULE_TEST_UTILS_INTERACTIVE_SYNC */ } diff --git a/sys/shell/commands/Makefile b/sys/shell/commands/Makefile index 5688c51885..6c03471bab 100644 --- a/sys/shell/commands/Makefile +++ b/sys/shell/commands/Makefile @@ -95,4 +95,8 @@ ifneq (,$(filter nimble_netif,$(USEMODULE))) SRC += sc_nimble_netif.c endif +ifneq (,$(filter test_utils_interactive_sync,$(USEMODULE))) + SRC += sc_interactive_sync.c +endif + include $(RIOTBASE)/Makefile.base diff --git a/sys/shell/commands/sc_interactive_sync.c b/sys/shell/commands/sc_interactive_sync.c new file mode 100644 index 0000000000..63816f9401 --- /dev/null +++ b/sys/shell/commands/sc_interactive_sync.c @@ -0,0 +1,39 @@ +/* + * Copyright (C) 2019 Inria + * + * This file is subject to the terms and conditions of the GNU Lesser + * General Public License v2.1. See the file LICENSE in the top level + * directory for more details. + */ + +/** + * @ingroup sys_shell_commands + * @{ + * + * @file + * @brief Shell commands interactive sync util + * + * @author Francisco Molina + * @} + */ + +#include +#include "test_utils/interactive_sync.h" + +int _test_start(int argc, char **argv) +{ + (void) argc; + (void) argv; + puts("START"); + + return 0; +} + + +int _test_ready(int argc, char **argv) +{ + (void) argc; + (void) argv; + puts("READY"); + return 0; +} diff --git a/sys/shell/commands/shell_commands.c b/sys/shell/commands/shell_commands.c index 85a314575f..e111ce9bb1 100644 --- a/sys/shell/commands/shell_commands.c +++ b/sys/shell/commands/shell_commands.c @@ -163,6 +163,11 @@ extern int _loramac_handler(int argc, char **argv); extern int _nimble_netif_handler(int argc, char **argv); #endif +#ifdef MODULE_TEST_UTILS_INTERACTIVE_SYNC +extern int _test_start(int argc, char **argv); +extern int _test_ready(int argc, char **argv); +#endif + const shell_command_t _shell_command_list[] = { {"reboot", "Reboot the node", _reboot_handler}, #ifdef MODULE_CONFIG @@ -267,6 +272,10 @@ const shell_command_t _shell_command_list[] = { #endif #ifdef MODULE_NIMBLE_NETIF { "ble", "Manage BLE connections for NimBLE", _nimble_netif_handler }, +#endif +#ifdef MODULE_TEST_UTILS_INTERACTIVE_SYNC + { "r", "Test sync, Ready query", _test_ready }, + { "s", "Test sync, Start test trigger", _test_start }, #endif {NULL, NULL, NULL} }; diff --git a/sys/test_utils/interactive_sync/interactive_sync.c b/sys/test_utils/interactive_sync/interactive_sync.c index 6dba6ed425..56e11afe23 100644 --- a/sys/test_utils/interactive_sync/interactive_sync.c +++ b/sys/test_utils/interactive_sync/interactive_sync.c @@ -1,3 +1,22 @@ +/* + * Copyright (C) 2019 Freie Universität Berlin + * + * This file is subject to the terms and conditions of the GNU Lesser + * General Public License v2.1. See the file LICENSE in the top level + * directory for more details. + */ + +/** + * @ingroup sys + * @{ + * + * @file + * @brief Interactive Sync implementation + * + * + * @author Gaëtan Harter + */ + #include #include "test_utils/interactive_sync.h"