2013-06-22 05:11:53 +02:00
|
|
|
/**
|
|
|
|
* Provides prototypes for available shell commands
|
|
|
|
*
|
|
|
|
* Copyright (C) 2013 INRIA.
|
|
|
|
*
|
2013-09-05 12:31:07 +02:00
|
|
|
* This source code is licensed under the LGPLv2 license,
|
|
|
|
* See the file LICENSE for more details.
|
|
|
|
*
|
2013-08-06 16:36:37 +02:00
|
|
|
*
|
2013-06-22 05:11:53 +02:00
|
|
|
*
|
|
|
|
* @ingroup shell_commands
|
|
|
|
* @{
|
|
|
|
* @file shell_commands.c
|
|
|
|
* @brief sets up the system shell command struct
|
|
|
|
* @author Oliver Hahm <oliver.hahm@inria.fr>
|
2013-06-27 16:16:57 +02:00
|
|
|
* @author Zakaria Kasmi <zkasmi@inf.fu-berlin.de>
|
2013-09-05 12:31:07 +02:00
|
|
|
*
|
2013-09-05 12:41:43 +02:00
|
|
|
* @note $Id: shell_commands.c 3855 2013-09-05 12:54:57 kasmi $
|
2013-06-22 05:11:53 +02:00
|
|
|
* @}
|
|
|
|
*/
|
|
|
|
|
2010-12-03 22:22:58 +01:00
|
|
|
#include <shell_commands.h>
|
2010-11-04 14:24:31 +01:00
|
|
|
#include <stdlib.h>
|
2010-10-01 15:24:43 +02:00
|
|
|
|
2013-09-05 12:41:43 +02:00
|
|
|
extern void _id_handler(char *id);
|
|
|
|
extern void _heap_handler(char *unused);
|
2010-12-01 16:26:48 +01:00
|
|
|
|
2010-11-04 15:05:51 +01:00
|
|
|
#ifdef MODULE_PS
|
2013-06-22 05:11:53 +02:00
|
|
|
extern void _ps_handler(char *unused);
|
2010-11-04 18:16:39 +01:00
|
|
|
#endif
|
|
|
|
|
|
|
|
#ifdef MODULE_RTC
|
2013-06-22 05:11:53 +02:00
|
|
|
extern void _date_handler(char *now);
|
2010-11-04 18:16:39 +01:00
|
|
|
#endif
|
|
|
|
|
|
|
|
#ifdef MODULE_SHT11
|
2013-06-22 05:11:53 +02:00
|
|
|
extern void _get_temperature_handler(char *unused);
|
|
|
|
extern void _get_humidity_handler(char *unused);
|
|
|
|
extern void _get_weather_handler(char *unused);
|
|
|
|
extern void _set_offset_handler(char *offset);
|
2010-11-04 15:05:51 +01:00
|
|
|
#endif
|
|
|
|
|
2010-11-05 23:43:14 +01:00
|
|
|
#ifdef MODULE_LTC4150
|
2013-06-22 05:11:53 +02:00
|
|
|
extern void _get_current_handler(char *unused);
|
|
|
|
extern void _reset_current_handler(char *unused);
|
2010-11-05 23:43:14 +01:00
|
|
|
#endif
|
|
|
|
|
2010-11-09 17:08:35 +01:00
|
|
|
#ifdef MODULE_CC110X
|
2012-03-01 22:12:25 +01:00
|
|
|
#ifdef MODULE_TRANSCEIVER
|
|
|
|
extern void _cc1100_get_set_address_handler(char *addr);
|
|
|
|
extern void _cc1100_get_set_channel_handler(char *chan);
|
|
|
|
extern void _cc1100_send_handler(char *pkt);
|
|
|
|
#else
|
2011-04-06 11:11:03 +02:00
|
|
|
extern void _cc110x_get_set_address_handler(char *addr);
|
|
|
|
extern void _cc110x_get_set_channel_handler(char *addr);
|
2010-11-09 17:08:35 +01:00
|
|
|
#endif
|
2012-03-01 22:12:25 +01:00
|
|
|
#endif
|
2010-11-09 17:08:35 +01:00
|
|
|
|
2010-11-27 10:50:18 +01:00
|
|
|
#ifdef MODULE_TRANSCEIVER
|
|
|
|
#ifdef MODULE_CC110X_NG
|
2010-12-11 12:09:20 +01:00
|
|
|
extern void _cc110x_ng_get_set_address_handler(char *addr);
|
|
|
|
extern void _cc110x_ng_get_set_channel_handler(char *chan);
|
|
|
|
extern void _cc110x_ng_send_handler(char *pkt);
|
|
|
|
extern void _cc110x_ng_monitor_handler(char *mode);
|
2010-11-27 10:50:18 +01:00
|
|
|
#endif
|
|
|
|
#endif
|
|
|
|
|
2013-05-02 08:45:47 +02:00
|
|
|
#ifdef MODULE_TRANSCEIVER
|
|
|
|
#ifdef MODULE_CC2420
|
|
|
|
extern void _cc2420_get_set_address_handler(char *addr);
|
|
|
|
extern void _cc2420_get_set_channel_handler(char *chan);
|
|
|
|
extern void _cc2420_get_set_pan_handler(char *pan);
|
|
|
|
extern void _cc2420_send_handler(char *pkt);
|
|
|
|
extern void _cc2420_monitor_handler(char *mode);
|
|
|
|
#endif
|
|
|
|
#endif
|
|
|
|
|
2013-08-08 11:08:33 +02:00
|
|
|
#ifdef MODULE_TRANSCEIVER
|
|
|
|
#ifdef MODULE_NATIVENET
|
|
|
|
extern void _nativenet_get_set_address_handler(char *addr);
|
|
|
|
extern void _nativenet_get_set_channel_handler(char *chan);
|
|
|
|
extern void _nativenet_send_handler(char *pkt);
|
|
|
|
extern void _nativenet_monitor_handler(char *mode);
|
|
|
|
#endif
|
|
|
|
#endif
|
|
|
|
|
2011-12-12 17:50:22 +01:00
|
|
|
#ifdef MODULE_MCI
|
|
|
|
extern void _get_sectorsize(char *unused);
|
2013-06-22 05:11:53 +02:00
|
|
|
extern void _get_blocksize(char *unused);
|
|
|
|
extern void _get_sectorcount(char *unused);
|
|
|
|
extern void _read_sector(char *sector);
|
|
|
|
extern void _read_bytes(char *bytes);
|
2011-12-12 17:50:22 +01:00
|
|
|
#endif
|
|
|
|
|
2010-10-01 15:24:43 +02:00
|
|
|
const shell_command_t _shell_command_list[] = {
|
2010-12-01 16:26:48 +01:00
|
|
|
{"id", "Gets or sets the node's id.", _id_handler},
|
2013-09-19 13:47:23 +02:00
|
|
|
#ifdef MODULE_LPC_COMMON
|
2013-09-05 12:31:07 +02:00
|
|
|
{"heap", "Shows the heap state for the LPC2387 on the command shell.", _heap_handler},
|
2013-09-19 13:47:23 +02:00
|
|
|
#endif
|
2010-10-01 15:24:43 +02:00
|
|
|
#ifdef MODULE_PS
|
2010-11-04 15:05:51 +01:00
|
|
|
{"ps", "Prints information about running threads.", _ps_handler},
|
2010-11-04 18:16:39 +01:00
|
|
|
#endif
|
|
|
|
#ifdef MODULE_RTC
|
2010-12-01 16:26:48 +01:00
|
|
|
{"date", "Gets or sets current date and time.", _date_handler},
|
2010-11-04 18:16:39 +01:00
|
|
|
#endif
|
|
|
|
#ifdef MODULE_SHT11
|
2010-11-05 23:43:14 +01:00
|
|
|
{"temp", "Prints measured temperature.", _get_temperature_handler},
|
|
|
|
{"hum", "Prints measured humidity.", _get_humidity_handler},
|
|
|
|
{"weather", "Prints measured humidity and temperature.", _get_weather_handler},
|
2013-06-22 05:11:53 +02:00
|
|
|
{"offset", "Set temperature offset.", _set_offset_handler},
|
2010-11-05 23:43:14 +01:00
|
|
|
#endif
|
|
|
|
#ifdef MODULE_LTC4150
|
2013-06-22 05:11:53 +02:00
|
|
|
{"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_CC110X
|
2012-03-01 22:12:25 +01:00
|
|
|
#ifdef MODULE_TRANSCEIVER
|
|
|
|
{"addr", "Gets or sets the address for the CC1100 transceiver", _cc1100_get_set_address_handler},
|
|
|
|
{"chan", "Gets or sets the channel for the CC1100 transceiver", _cc1100_get_set_channel_handler},
|
|
|
|
{"txtsnd", "Sends a text message to a given node via the CC1100 transceiver", _cc1100_send_handler},
|
|
|
|
#else
|
2011-04-06 11:11:03 +02:00
|
|
|
{"addr", "Gets or sets the address for the CC1100 transceiver", _cc110x_get_set_address_handler},
|
|
|
|
{"chan", "Gets or sets the channel for the CC1100 transceiver", _cc110x_get_set_channel_handler},
|
2010-11-27 10:50:18 +01:00
|
|
|
#endif
|
2012-03-01 22:12:25 +01:00
|
|
|
#endif
|
2010-11-27 10:50:18 +01:00
|
|
|
#ifdef MODULE_TRANSCEIVER
|
|
|
|
#ifdef MODULE_CC110X_NG
|
2010-12-11 12:09:20 +01:00
|
|
|
{"addr", "Gets or sets the address for the CC1100 transceiver", _cc110x_ng_get_set_address_handler},
|
|
|
|
{"chan", "Gets or sets the channel for the CC1100 transceiver", _cc110x_ng_get_set_channel_handler},
|
|
|
|
{"txtsnd", "Sends a text message to a given node via the CC1100 transceiver", _cc110x_ng_send_handler},
|
|
|
|
{"monitor", "Enables or disables address checking for the CC1100 transceiver", _cc110x_ng_monitor_handler},
|
2010-11-27 10:50:18 +01:00
|
|
|
#endif
|
2011-12-12 17:50:22 +01:00
|
|
|
#endif
|
2013-05-02 08:45:47 +02:00
|
|
|
#ifdef MODULE_TRANSCEIVER
|
|
|
|
#ifdef MODULE_CC2420
|
|
|
|
{"addr", "Gets or sets the address for the CC2420 transceiver", _cc2420_get_set_address_handler},
|
|
|
|
{"chan", "Gets or sets the channel for the CC2420 transceiver", _cc2420_get_set_channel_handler},
|
|
|
|
{"pan", "Gets or sets the pan id for the CC2420 transceiver", _cc2420_get_set_pan_handler},
|
|
|
|
{"txtsnd", "Sends a text message to a given node via the C2420 transceiver", _cc2420_send_handler},
|
|
|
|
{"monitor", "Enables or disables address checking for the CC2420 transceiver", _cc2420_monitor_handler},
|
|
|
|
#endif
|
|
|
|
#endif
|
2013-08-08 11:08:33 +02:00
|
|
|
#ifdef MODULE_TRANSCEIVER
|
|
|
|
#ifdef MODULE_NATIVENET
|
|
|
|
{"addr", "Gets or sets the address for the native transceiver", _nativenet_get_set_address_handler},
|
|
|
|
{"chan", "Gets or sets the channel for the native transceiver", _nativenet_get_set_channel_handler},
|
|
|
|
{"txtsnd", "Sends a text message to a given node via the native transceiver", _nativenet_send_handler},
|
|
|
|
{"monitor", "Enables or disables address checking for the native transceiver", _nativenet_monitor_handler},
|
|
|
|
#endif
|
|
|
|
#endif
|
2011-12-12 17:50:22 +01:00
|
|
|
#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},
|
2010-10-01 15:24:43 +02:00
|
|
|
#endif
|
2010-11-04 15:05:51 +01:00
|
|
|
{NULL, NULL, NULL}
|
2010-10-01 15:24:43 +02:00
|
|
|
};
|
|
|
|
|