sys/shell: Add shell command for app_metadata

This make an easily accessable shell command to print app_metadata
This commit is contained in:
MrKevinWeiss 2019-03-05 14:19:59 +01:00
parent fc80ae7724
commit 7a220d16a8
3 changed files with 39 additions and 0 deletions

View File

@ -2,6 +2,9 @@ MODULE = shell_commands
SRC = shell_commands.c sc_sys.c
ifneq (,$(filter app_metadata,$(USEMODULE)))
SRC += sc_app_metadata.c
endif
ifneq (,$(filter mci,$(USEMODULE)))
SRC += sc_disk.c
endif

View File

@ -0,0 +1,29 @@
/*
* Copyright (C) 2019 HAW Hamburg
*
* 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 command for getting application metadata.
*
* @author Kevin Weiss <kevin.weiss@haw-hamburg.de>
* @}
*/
#include "app_metadata.h"
int _app_metadata_handler(int argc, char **argv)
{
(void) argc;
(void) argv;
app_metadata_print_json();
return 0;
}

View File

@ -141,6 +141,10 @@ extern int _can_handler(int argc, char **argv);
extern int _cord_ep_handler(int argc, char **argv);
#endif
#ifdef MODULE_APP_METADATA
extern int _app_metadata_handler(int argc, char **argv);
#endif
const shell_command_t _shell_command_list[] = {
{"reboot", "Reboot the node", _reboot_handler},
#ifdef MODULE_CONFIG
@ -230,6 +234,9 @@ const shell_command_t _shell_command_list[] = {
#endif
#ifdef MODULE_CORD_EP
{"cord_ep", "Resource directory endpoint commands", _cord_ep_handler },
#endif
#ifdef MODULE_APP_METADATA
{"app_metadata", "Returns application metadata", _app_metadata_handler },
#endif
{NULL, NULL, NULL}
};