1
0
mirror of https://github.com/RIOT-OS/RIOT.git synced 2024-12-29 04:50:03 +01:00
RIOT/sys/shell/commands/shell_commands.c

199 lines
5.7 KiB
C
Raw Normal View History

/*
2014-02-14 17:17:25 +01:00
* Copyright (C) 2014 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 Provides prototypes and sets up available shell commands
*
* @author Oliver Hahm <oliver.hahm@inria.fr>
* @author Zakaria Kasmi <zkasmi@inf.fu-berlin.de>
* @author Ludwig Knüpfer <ludwig.knuepfer@fu-berlin.de>
*
* @}
*/
2010-11-04 14:24:31 +01:00
#include <stdlib.h>
2013-12-16 17:54:58 +01:00
#include "shell_commands.h"
extern int _reboot_handler(int argc, char **argv);
#ifdef MODULE_CONFIG
extern int _id_handler(int argc, char **argv);
#endif
#ifdef MODULE_LPC_COMMON
extern int _heap_handler(int argc, char **argv);
#endif
#ifdef MODULE_PS
extern int _ps_handler(int argc, char **argv);
#endif
#ifdef MODULE_SHT11
extern int _get_temperature_handler(int argc, char **argv);
extern int _get_humidity_handler(int argc, char **argv);
extern int _get_weather_handler(int argc, char **argv);
extern int _set_offset_handler(int argc, char **argv);
#endif
#ifdef MODULE_LTC4150
extern int _get_current_handler(int argc, char **argv);
extern int _reset_current_handler(int argc, char **argv);
#endif
#ifdef MODULE_AT30TSE75X
extern int _at30tse75x_handler(int argc, char **argv);
#endif
#ifdef MODULE_SAUL_REG
extern int _saul(int argc, char **argv);
#endif
#if FEATURE_PERIPH_RTC
extern int _rtc_handler(int argc, char **argv);
#endif
#ifdef CPU_X86
extern int _x86_lspci(int argc, char **argv);
#endif
#ifdef MODULE_MCI
extern int _get_sectorsize(int argc, char **argv);
extern int _get_blocksize(int argc, char **argv);
extern int _get_sectorcount(int argc, char **argv);
extern int _read_sector(int argc, char **argv);
extern int _read_bytes(int argc, char **argv);
#endif
#ifdef MODULE_GNRC_ICMPV6_ECHO
2015-11-02 16:53:56 +01:00
#ifdef MODULE_XTIMER
2015-04-01 17:40:36 +02:00
extern int _icmpv6_ping(int argc, char **argv);
#endif
#endif
#ifdef MODULE_RANDOM
extern int _random_init(int argc, char **argv);
extern int _random_get(int argc, char **argv);
#endif
#ifdef MODULE_GNRC_NETIF
extern int _netif_config(int argc, char **argv);
extern int _netif_send(int argc, char **argv);
2015-03-11 22:54:52 +01:00
#endif
#ifdef MODULE_FIB
extern int _fib_route_handler(int argc, char **argv);
#endif
#ifdef MODULE_GNRC_IPV6_NC
extern int _ipv6_nc_manage(int argc, char **argv);
2015-04-02 15:35:56 +02:00
extern int _ipv6_nc_routers(int argc, char **argv);
#endif
#ifdef MODULE_GNRC_IPV6_WHITELIST
extern int _whitelist(int argc, char **argv);
#endif
#ifdef MODULE_GNRC_ZEP
2015-08-10 00:26:36 +02:00
#ifdef MODULE_IPV6_ADDR
2015-03-17 14:42:35 +01:00
extern int _zep_init(int argc, char **argv);
#endif
#endif
#ifdef MODULE_GNRC_RPL
extern int _gnrc_rpl(int argc, char **argv);
2015-05-22 21:48:30 +02:00
#endif
#ifdef MODULE_GNRC_SIXLOWPAN_CTX
#ifdef MODULE_GNRC_SIXLOWPAN_ND_BORDER_ROUTER
extern int _gnrc_6ctx(int argc, char **argv);
#endif
#endif
const shell_command_t _shell_command_list[] = {
2014-02-14 17:17:25 +01:00
{"reboot", "Reboot the node", _reboot_handler},
#ifdef MODULE_CONFIG
{"id", "Gets or sets the node's id.", _id_handler},
#endif
#ifdef MODULE_LPC_COMMON
{"heap", "Shows the heap state for the LPC2387 on the command shell.", _heap_handler},
#endif
#ifdef MODULE_PS
{"ps", "Prints information about running threads.", _ps_handler},
#endif
#ifdef MODULE_SHT11
{"temp", "Prints measured temperature.", _get_temperature_handler},
{"hum", "Prints measured humidity.", _get_humidity_handler},
{"weather", "Prints measured humidity and temperature.", _get_weather_handler},
{"offset", "Set temperature offset.", _set_offset_handler},
#endif
#ifdef MODULE_LTC4150
{"cur", "Prints current and average power consumption.", _get_current_handler},
{"rstcur", "Resets coulomb counter.", _reset_current_handler},
2010-11-09 17:08:35 +01:00
#endif
#ifdef MODULE_AT30TSE75X
{"at30tse75x", "Test AT30TSE75X temperature sensor", _at30tse75x_handler},
#endif
#ifdef MODULE_MCI
{DISK_READ_SECTOR_CMD, "Reads the specified sector of inserted memory card", _read_sector},
{DISK_READ_BYTES_CMD, "Reads the specified bytes from inserted memory card", _read_bytes},
{DISK_GET_SECTOR_SIZE, "Get the sector size of inserted memory card", _get_sectorsize},
{DISK_GET_SECTOR_COUNT, "Get the sector count of inserted memory card", _get_sectorcount},
{DISK_GET_BLOCK_SIZE, "Get the block size of inserted memory card", _get_blocksize},
#endif
#ifdef MODULE_GNRC_ICMPV6_ECHO
2015-11-02 16:53:56 +01:00
#ifdef MODULE_XTIMER
2015-04-01 17:40:36 +02:00
{ "ping6", "Ping via ICMPv6", _icmpv6_ping },
#endif
#endif
#ifdef MODULE_RANDOM
{ "random_init", "initializes the PRNG", _random_init },
{ "random_get", "returns 32 bit of pseudo randomness", _random_get },
#endif
#if FEATURE_PERIPH_RTC
{"rtc", "control RTC peripheral interface", _rtc_handler},
#endif
#ifdef CPU_X86
{"lspci", "Lists PCI devices", _x86_lspci},
#endif
#ifdef MODULE_GNRC_NETIF
{"ifconfig", "Configure network interfaces", _netif_config},
2015-03-11 22:54:52 +01:00
{"txtsnd", "send raw data", _netif_send },
#endif
#ifdef MODULE_FIB
{"fibroute", "Manipulate the FIB (info: 'fibroute [add|del]')", _fib_route_handler},
#endif
#ifdef MODULE_GNRC_IPV6_NC
{"ncache", "manage neighbor cache by hand", _ipv6_nc_manage },
2015-04-02 15:35:56 +02:00
{"routers", "IPv6 default router list", _ipv6_nc_routers },
2015-03-17 14:42:35 +01:00
#endif
#ifdef MODULE_GNRC_IPV6_WHITELIST
{"whitelist", "whitelists an address for receival ('whitelist [add|del|help]')", _whitelist },
#endif
#ifdef MODULE_GNRC_ZEP
2015-08-10 00:26:36 +02:00
#ifdef MODULE_IPV6_ADDR
2015-03-17 14:42:35 +01:00
{"zep_init", "initializes ZEP (Zigbee Encapsulation Protocol)", _zep_init },
#endif
2015-05-22 21:48:30 +02:00
#endif
#ifdef MODULE_GNRC_RPL
{"rpl", "rpl configuration tool [help|init|rm|root|show]", _gnrc_rpl },
#endif
#ifdef MODULE_GNRC_SIXLOWPAN_CTX
#ifdef MODULE_GNRC_SIXLOWPAN_ND_BORDER_ROUTER
{"6ctx", "6LoWPAN context configuration tool", _gnrc_6ctx },
#endif
#endif
#ifdef MODULE_SAUL_REG
{"saul", "interact with sensors and actuators using SAUL", _saul },
#endif
{NULL, NULL, NULL}
};