diff --git a/openwsn/Makefile b/openwsn/Makefile new file mode 100644 index 0000000000..d52662ea8c --- /dev/null +++ b/openwsn/Makefile @@ -0,0 +1,33 @@ +APPLICATION = openwsn-app + +# If no BOARD is found in the environment, use this default: +BOARD ?= iot-lab_M3 + +# This has to be the absolute path to the RIOT base directory: +RIOTBASE ?= $(CURDIR)/../../RIOT + +# Uncomment this to enable scheduler statistics for ps: +#CFLAGS += -DSCHEDSTATISTICS + +# Uncomment this to enable code in RIOT that does safety checking +# which is not needed in a production environment but helps in the +# development process: +CFLAGS += -DDEVELHELP + +# Change this to 0 show compiler invocation lines by default: +export QUIET ?= 1 + +USEMODULE += ps +USEMODULE += vtimer +USEMODULE += shell +USEMODULE += shell_commands +USEMODULE += posix +USEMODULE += uart0 +USEMODULE += at86rf231 + +USEPKG += openwsn + +include $(RIOTBASE)/Makefile.include + +INCLUDES += -I$(RIOTBASE)/pkg/openwsn/openwsn/projects/common/03oos_openwsn \ + -I$(RIOTBASE)/pkg/openwsn/openwsn/bsp/boards/riot-adaption diff --git a/openwsn/main.c b/openwsn/main.c new file mode 100644 index 0000000000..31cac065e5 --- /dev/null +++ b/openwsn/main.c @@ -0,0 +1,60 @@ +/* + * Copyright (C) 2014 Freie Universität Berlin + * + * 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 tests + * @{ + * + * @file + * @brief Test application for OpenWSN pkg + * + * @author Thomas Eichinger + * + * @} + */ + +#include + +#include "vtimer.h" +#include "shell.h" +#include "posix_io.h" +#include "03oos_openwsn.h" +#include "board_uart0.h" +#include "riot.h" + + +const shell_command_t shell_commands[] = { + {"owsn_init", "Start OpenWSN", openwsn_start_thread}, + {NULL, NULL, NULL} +}; + +static int shell_readc(void) +{ + char c = 0; + (void) posix_read(uart0_handler_pid, &c, 1); + return c; +} + +static void shell_putchar(int c) +{ + (void) putchar(c); +} + +int main(void) { + shell_t shell; + + (void) posix_open(uart0_handler_pid, 0); + + puts("Welcome to RIOT!"); + + shell_init(&shell, shell_commands, UART0_BUFSIZE, shell_readc, shell_putchar); + + shell_run(&shell); + + return 0; +} \ No newline at end of file