From c9118e5fe45ec701bd257f61e9842f57d45b5458 Mon Sep 17 00:00:00 2001 From: kYc0o <fco.ja.ac@gmail.com> Date: Mon, 6 Jun 2016 01:51:17 +0200 Subject: [PATCH] examples/gnrc_minimal: Add support for XBee into gnrc_minimal --- examples/gnrc_minimal/Makefile | 15 ++++++++++++ examples/gnrc_minimal/README.md | 4 +++ examples/gnrc_minimal/xbee_params.h | 38 +++++++++++++++++++++++++++++ 3 files changed, 57 insertions(+) create mode 100644 examples/gnrc_minimal/xbee_params.h diff --git a/examples/gnrc_minimal/Makefile b/examples/gnrc_minimal/Makefile index 81b9631d53..73fed6e962 100644 --- a/examples/gnrc_minimal/Makefile +++ b/examples/gnrc_minimal/Makefile @@ -9,6 +9,21 @@ RIOTBASE ?= $(CURDIR)/../.. BOARD_INSUFFICIENT_MEMORY := chronos msb-430 msb-430h +## Uncomment to support the XBee module and nomac +#USEMODULE += xbee +#USEMODULE += gnrc_nomac + +## set default UART to use in case none was defined +#XBEE_UART ?= "UART_NUMOF-1" + +## export UART to params file +#CFLAGS += -DXBEE_UART=$(XBEE_UART) + +## add current directory to the include path. Putting it in CFLAGS will make +## it go to the beginning, before the standard includes. +## That way xbee_params.h get's included and auto configuration can pick it up. +#CFLAGS += -I$(CURDIR) + # Include packages that pull up and auto-init the link layer. # NOTE: 6LoWPAN will be included if IEEE802.15.4 devices are present USEMODULE += gnrc_netdev_default diff --git a/examples/gnrc_minimal/README.md b/examples/gnrc_minimal/README.md index 1c62dbfff0..1ea20849e5 100644 --- a/examples/gnrc_minimal/README.md +++ b/examples/gnrc_minimal/README.md @@ -29,3 +29,7 @@ is achieved by: * Reducing the maximum neighbor cache size from 8 to 1. Please take a look at the Makefile to see how the configuration is done. + +## Support for XBee +Please uncomment the lines in the Makefile in order to support the XBee into +this example. \ No newline at end of file diff --git a/examples/gnrc_minimal/xbee_params.h b/examples/gnrc_minimal/xbee_params.h new file mode 100644 index 0000000000..6191583005 --- /dev/null +++ b/examples/gnrc_minimal/xbee_params.h @@ -0,0 +1,38 @@ +/* + * Copyright (C) 2015 Kaspar Schleiser <kaspar@schleiser.de> + * + * 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 xbee driver parameters example, used by auto_init_gnrc_netif + * + * @author Kaspar Schleiser <kaspar@schleiser.de> + */ + +#ifndef XBEE_PARAMS_H +#define XBEE_PARAMS_H + +#ifdef __cplusplus +extern "C" { +#endif + +static xbee_params_t xbee_params[] = { + { .uart = XBEE_UART, + .baudrate = 9600U, + .sleep_pin = GPIO_UNDEF, + .reset_pin = GPIO_UNDEF + }, +}; + +#ifdef __cplusplus +} +#endif +#endif /* XBEE_PARAMS_H */ +/** @} */ -- GitLab