From 523129c1d67761debaca44e8456668f03c379abb Mon Sep 17 00:00:00 2001 From: Ludwig Ortmann Date: Fri, 14 Feb 2014 17:17:25 +0100 Subject: [PATCH] add system calls to the shell --- sys/shell/commands/Makefile | 2 +- sys/shell/commands/sc_sys.c | 24 ++++++++++++++++++++++++ sys/shell/commands/shell_commands.c | 4 +++- 3 files changed, 28 insertions(+), 2 deletions(-) create mode 100644 sys/shell/commands/sc_sys.c diff --git a/sys/shell/commands/Makefile b/sys/shell/commands/Makefile index 13beb78fefe1..fd8c912492ba 100644 --- a/sys/shell/commands/Makefile +++ b/sys/shell/commands/Makefile @@ -1,4 +1,4 @@ -SRC = shell_commands.c sc_id.c +SRC = shell_commands.c sc_id.c sc_sys.c ifneq (,$(findstring transceiver,$(USEMODULE))) SRC += sc_transceiver.c diff --git a/sys/shell/commands/sc_sys.c b/sys/shell/commands/sc_sys.c new file mode 100644 index 000000000000..54ecaec49eaf --- /dev/null +++ b/sys/shell/commands/sc_sys.c @@ -0,0 +1,24 @@ +/** + * Shell commands for system calls + * + * Copyright (C) 2014 Ludwig Ortmann + * + * This file is subject to the terms and conditions of the GNU Lesser General + * Public License. See the file LICENSE in the top level directory for more + * details. + * + * @ingroup shell_commands + * @{ + * @file + * @brief shell commands for system calls + * @author Ludwig Ortmann + * @} + */ + +#include "kernel.h" + +void _reboot_handler(char *unused) +{ + (void) unused; + reboot(); +} diff --git a/sys/shell/commands/shell_commands.c b/sys/shell/commands/shell_commands.c index ac4356e053ab..38ac0a5199be 100644 --- a/sys/shell/commands/shell_commands.c +++ b/sys/shell/commands/shell_commands.c @@ -1,7 +1,7 @@ /** * Provides prototypes for available shell commands * - * Copyright (C) 2013 INRIA. + * Copyright (C) 2014 INRIA. * * This source code is licensed under the LGPLv2 license, * See the file LICENSE for more details. @@ -24,6 +24,7 @@ #include "shell_commands.h" extern void _id_handler(char *id); +extern void _reboot_handler(char *unused); extern void _heap_handler(char *unused); #ifdef MODULE_PS @@ -104,6 +105,7 @@ extern void _mersenne_get(char *str); const shell_command_t _shell_command_list[] = { {"id", "Gets or sets the node's id.", _id_handler}, + {"reboot", "Reboot the node", _reboot_handler}, #ifdef MODULE_LPC_COMMON {"heap", "Shows the heap state for the LPC2387 on the command shell.", _heap_handler}, #endif