mirror of
https://github.com/RIOT-OS/RIOT.git
synced 2024-12-29 04:50:03 +01:00
sys/shell/commands: add interactive_sync commands
This commit is contained in:
parent
dbbdd703ea
commit
838a88f122
@ -96,6 +96,12 @@
|
|||||||
#include "schedstatistics.h"
|
#include "schedstatistics.h"
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#ifdef MODULE_TEST_UTILS_INTERACTIVE_SYNC
|
||||||
|
#ifndef MODULE_SHELL_COMMANDS
|
||||||
|
#include "test_utils/interactive_sync.h"
|
||||||
|
#endif
|
||||||
|
#endif
|
||||||
|
|
||||||
#define ENABLE_DEBUG (0)
|
#define ENABLE_DEBUG (0)
|
||||||
#include "debug.h"
|
#include "debug.h"
|
||||||
|
|
||||||
@ -597,4 +603,10 @@ void auto_init(void)
|
|||||||
extern void suit_init_conditions(void);
|
extern void suit_init_conditions(void);
|
||||||
suit_init_conditions();
|
suit_init_conditions();
|
||||||
#endif /* MODULE_SUIT */
|
#endif /* MODULE_SUIT */
|
||||||
|
|
||||||
|
#ifdef MODULE_TEST_UTILS_INTERACTIVE_SYNC
|
||||||
|
#ifndef MODULE_SHELL_COMMANDS
|
||||||
|
test_utils_interactive_sync();
|
||||||
|
#endif
|
||||||
|
#endif /* MODULE_TEST_UTILS_INTERACTIVE_SYNC */
|
||||||
}
|
}
|
||||||
|
@ -95,4 +95,8 @@ ifneq (,$(filter nimble_netif,$(USEMODULE)))
|
|||||||
SRC += sc_nimble_netif.c
|
SRC += sc_nimble_netif.c
|
||||||
endif
|
endif
|
||||||
|
|
||||||
|
ifneq (,$(filter test_utils_interactive_sync,$(USEMODULE)))
|
||||||
|
SRC += sc_interactive_sync.c
|
||||||
|
endif
|
||||||
|
|
||||||
include $(RIOTBASE)/Makefile.base
|
include $(RIOTBASE)/Makefile.base
|
||||||
|
39
sys/shell/commands/sc_interactive_sync.c
Normal file
39
sys/shell/commands/sc_interactive_sync.c
Normal file
@ -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 <francois-xavier.molina@inria.fr>
|
||||||
|
* @}
|
||||||
|
*/
|
||||||
|
|
||||||
|
#include <stdio.h>
|
||||||
|
#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;
|
||||||
|
}
|
@ -163,6 +163,11 @@ extern int _loramac_handler(int argc, char **argv);
|
|||||||
extern int _nimble_netif_handler(int argc, char **argv);
|
extern int _nimble_netif_handler(int argc, char **argv);
|
||||||
#endif
|
#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[] = {
|
const shell_command_t _shell_command_list[] = {
|
||||||
{"reboot", "Reboot the node", _reboot_handler},
|
{"reboot", "Reboot the node", _reboot_handler},
|
||||||
#ifdef MODULE_CONFIG
|
#ifdef MODULE_CONFIG
|
||||||
@ -267,6 +272,10 @@ const shell_command_t _shell_command_list[] = {
|
|||||||
#endif
|
#endif
|
||||||
#ifdef MODULE_NIMBLE_NETIF
|
#ifdef MODULE_NIMBLE_NETIF
|
||||||
{ "ble", "Manage BLE connections for NimBLE", _nimble_netif_handler },
|
{ "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
|
#endif
|
||||||
{NULL, NULL, NULL}
|
{NULL, NULL, NULL}
|
||||||
};
|
};
|
||||||
|
@ -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 <gaetan.harter@fu-berlin.de>
|
||||||
|
*/
|
||||||
|
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
#include "test_utils/interactive_sync.h"
|
#include "test_utils/interactive_sync.h"
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user