diff --git a/projects/test_ping/Jamfile b/projects/test_ping/Jamfile index 2470940cff..2e9663fa3c 100644 --- a/projects/test_ping/Jamfile +++ b/projects/test_ping/Jamfile @@ -1,5 +1,5 @@ SubDir TOP projects test_ping ; -Module test_ping : main.c ; +Module test_ping : main.c : shell shell_commands uart0 posix_io auto_init vtimer cc110x ; UseModule test_ping ; diff --git a/projects/test_ping/main.c b/projects/test_ping/main.c index eba917d396..0567ac3167 100644 --- a/projects/test_ping/main.c +++ b/projects/test_ping/main.c @@ -1,12 +1,26 @@ #include +#include +#include +#include + +#include +#include +#include +#include + +// Prototypes +void help(char * arg); +void init(char * arg); +void ping(char * arg); +void stop(char * arg); // Shell commands for this application -const shell_command_t shell_commands[] = { - {"help", "Prints a list of commands", help}, - {"init", "Initializes this node for a pingtest.", init}, - {"ping", "Makes this node a pinging node", ping}, - {"stop", "Stops the current node's ping-action and prints a summary", ping}, - {NULL, NULL, NULL} +const shell_command_t shell_commands[] = +{ { "help", "Prints the help", help }, + { "init", "Initializes this node with an address and a channel.", init }, + { "ping", "Makes this node a pinging node", ping }, + { "stop", "Stops the current node's pings and prints a summary", stop }, + { NULL, NULL, NULL } }; /** @@ -22,7 +36,13 @@ void init(char* arg) { * Prints the shellcommands that are usable in this application for reference. */ void help(char* unused) { -//TODO implement + printf("These are the usable commands:\n"); + printf("\thelp (commandname)\n"); + printf("\tinit [address] (channel)\n"); + printf("\tping [address] (time)\n"); + printf("\tstop\n"); + printf("\n"); + printf("[] = mandatory, () = optional"); } /** @@ -48,13 +68,15 @@ void stop(char* unused) { * commands. */ int main(void) { - puts("Ping Test Application\n"); - puts("For commands type 'help'!\n"); + puts("Ping Test Application\n"); + puts("For commands type 'help'!\n"); - shell_t shell; - shell_init(&shell, shell_commands, uart0_readc, uart0_putc); + posix_open(uart0_handler_pid, 0); - shell_run(&shell); + shell_t shell; + shell_init(&shell, shell_commands, uart0_readc, uart0_putc); - return 0; + shell_run(&shell); + + return 0; }