Commit cc0ab1ac authored by Simon Duquennoy's avatar Simon Duquennoy Committed by GitHub
Browse files

Merge pull request #86 from sics-iot/contrib/harmonise-platform-config

Harmonise platform configuration
parents c8918496 be9fbc8f
......@@ -33,6 +33,11 @@
#ifndef CONTIKI_CONF_H_
#define CONTIKI_CONF_H_
/* include the project config */
#ifdef PROJECT_CONF_PATH
#include PROJECT_CONF_PATH
#endif /* PROJECT_CONF_PATH */
#ifdef INCLUDE_SUBPLATFORM_CONF
#include "subplatform-conf.h"
#endif /* INCLUDE_SUBPLATFORM_CONF */
......@@ -137,10 +142,4 @@ typedef uint64_t rtimer_clock_t;
#define RF_CHANNEL 26
#define NETSTACK_RADIO_MAX_PAYLOAD_LEN 125
/* include the project config */
#ifdef PROJECT_CONF_PATH
#include PROJECT_CONF_PATH
#endif /* PROJECT_CONF_PATH */
#endif /* CONTIKI_CONF_H_ */
......@@ -33,6 +33,11 @@
#ifndef CONTIKI_CONF_H_
#define CONTIKI_CONF_H_
/* include the project config */
#ifdef PROJECT_CONF_PATH
#include PROJECT_CONF_PATH
#endif /* PROJECT_CONF_PATH */
#ifdef PLATFORM_CONF_H
#include PLATFORM_CONF_H
#else
......@@ -49,9 +54,4 @@
#define CCM_STAR_CONF ccm_star_driver_jn516x
#endif /* CCM_STAR_CONF */
/* include the project config */
#ifdef PROJECT_CONF_PATH
#include PROJECT_CONF_PATH
#endif /* PROJECT_CONF_PATH */
#endif /* CONTIKI_CONF_H_ */
......@@ -36,6 +36,7 @@
#include <jendefs.h>
#include <AppHardwareApi.h>
#include <MicroInt.h>
#include "contiki.h"
#include "exceptions.h"
#ifndef EXCEPTION_STALLS_SYSTEM
......
......@@ -33,6 +33,11 @@
#ifndef CONTIKI_CONF_H_
#define CONTIKI_CONF_H_
/* include the project config */
#ifdef PROJECT_CONF_PATH
#include PROJECT_CONF_PATH
#endif /* PROJECT_CONF_PATH */
#include <inttypes.h>
#ifndef WIN32_LEAN_AND_MEAN
#include <sys/select.h>
......@@ -94,9 +99,4 @@ typedef unsigned long clock_time_t;
/* Not part of C99 but actually present */
int strcasecmp(const char*, const char*);
/* include the project config */
#ifdef PROJECT_CONF_PATH
#include PROJECT_CONF_PATH
#endif /* PROJECT_CONF_PATH */
#endif /* CONTIKI_CONF_H_ */
......@@ -61,7 +61,11 @@
/* 6LoWPAN */
#define SICSLOWPAN_CONF_MAC_MAX_PAYLOAD 1280
#ifndef SICSLOWPAN_CONF_FRAG
#define SICSLOWPAN_CONF_FRAG 0 /**< We don't use 6LoWPAN fragmentation as IPSP takes care of that for us.*/
#endif
#define SICSLOWPAN_FRAMER_HDRLEN 0 /**< Use fixed header len rather than framer.length() function */
/* Packet buffer */
......
......@@ -3,6 +3,11 @@
#ifndef CONTIKI_CONF_H
#define CONTIKI_CONF_H
/* include the project config */
#ifdef PROJECT_CONF_PATH
#include PROJECT_CONF_PATH
#endif /* PROJECT_CONF_PATH */
#ifdef PLATFORM_CONF_H
#include PLATFORM_CONF_H
#else
......@@ -33,9 +38,4 @@
#define AES_128_CONF cc2420_aes_128_driver
#endif /* AES_128_CONF */
/* include the project config */
#ifdef PROJECT_CONF_PATH
#include PROJECT_CONF_PATH
#endif /* PROJECT_CONF_PATH */
#endif /* CONTIKI_CONF_H */
......@@ -32,7 +32,6 @@
#define _PROJECT_CONF_H_
#define CONTIKI_WITH_RPL 0
#undef UIP_CONF_IPV6_RPL
#define UIP_CONF_IPV6_RPL 0
#define UIP_CONF_ND6_SEND_RA 0
......
......@@ -59,21 +59,17 @@
/*******************************************************/
/* IEEE802.15.4 PANID */
#undef IEEE802154_CONF_PANID
#define IEEE802154_CONF_PANID 0x81a5
/* Do not start TSCH at init, wait for NETSTACK_MAC.on() */
#undef TSCH_CONF_AUTOSTART
#define TSCH_CONF_AUTOSTART 0
/* 6TiSCH minimal schedule length.
* Larger values result in less frequent active slots: reduces capacity and saves energy. */
#undef TSCH_SCHEDULE_CONF_DEFAULT_LENGTH
#define TSCH_SCHEDULE_CONF_DEFAULT_LENGTH 11
#if WITH_SECURITY
/* Enable security */
#undef LLSEC802154_CONF_ENABLED
#define LLSEC802154_CONF_ENABLED 1
#define LLSEC802154_CONF_USES_EXPLICIT_KEYS 0
#define LLSEC802154_CONF_USES_FRAME_COUNTER 0
......@@ -89,19 +85,14 @@
#define TSCH_CONF_MAC_MAX_FRAME_RETRIES 3
#undef TSCH_CONF_DEFAULT_HOPPING_SEQUENCE
#define TSCH_CONF_DEFAULT_HOPPING_SEQUENCE (uint8_t[]){ 20 }
//#define TSCH_CONF_DEFAULT_HOPPING_SEQUENCE TSCH_HOPPING_SEQUENCE_16_16
#undef TSCH_PACKET_CONF_EACK_WITH_SRC_ADDR
#define TSCH_PACKET_CONF_EACK_WITH_SRC_ADDR 1
#undef TSCH_PACKET_CONF_EB_WITH_SLOTFRAME_AND_LINK
#define TSCH_PACKET_CONF_EB_WITH_SLOTFRAME_AND_LINK 1
#undef TSCH_CONF_EB_PERIOD
#define TSCH_CONF_EB_PERIOD (1 * CLOCK_SECOND)
#undef TSCH_CONF_MAX_EB_PERIOD
#define TSCH_CONF_MAX_EB_PERIOD (1 * CLOCK_SECOND)
/*******************************************************/
......@@ -126,14 +117,11 @@
/* Needed for CC2538 platforms only */
/* For TSCH we have to use the more accurate crystal oscillator
* by default the RC oscillator is activated */
#undef SYS_CTRL_CONF_OSC32K_USE_XTAL
#define SYS_CTRL_CONF_OSC32K_USE_XTAL 1
#define USB_SERIAL_CONF_ENABLE 1
/* USB serial takes space, free more space elsewhere */
#undef SICSLOWPAN_CONF_FRAG
#define SICSLOWPAN_CONF_FRAG 0
#undef UIP_CONF_BUFFER_SIZE
#define UIP_CONF_BUFFER_SIZE 160
#if CONTIKI_TARGET_SRF06_CC26XX
......@@ -146,27 +134,22 @@
/* Needed for cc2420 platforms only */
/* Disable DCO calibration (uses timerB) */
#undef DCOSYNCH_CONF_ENABLED
#define DCOSYNCH_CONF_ENABLED 0
/* Enable SFD timestamps (uses timerB) */
#undef CC2420_CONF_SFD_TIMESTAMPS
#define CC2420_CONF_SFD_TIMESTAMPS 1
/*******************************************************/
/******************* Configure 6LoWPAN/IPv6 ************/
/*******************************************************/
#undef UIP_CONF_IPV6_CHECKS
#define UIP_CONF_IPV6_CHECKS 1
#undef SICSLOWPAN_CONF_COMPRESSION
#define SICSLOWPAN_CONF_COMPRESSION SICSLOWPAN_COMPRESSION_6LORH
/*******************************************************/
/********* Enable RPL non-storing mode *****************/
/*******************************************************/
#undef RPL_CONF_MOP
#define RPL_CONF_MOP RPL_MOP_NON_STORING /* Mode of operation*/
/*******************************************************/
......@@ -183,7 +166,6 @@
#define LOG_CONF_LEVEL_6TOP LOG_LEVEL_DBG
#define TSCH_LOG_CONF_PER_SLOT 1
#undef TCPIP_CONF_ANNOTATE_TRANSMISSIONS
#define TCPIP_CONF_ANNOTATE_TRANSMISSIONS 0
#endif /* __PROJECT_CONF_H__ */
......@@ -3,5 +3,4 @@ CONTIKI=../..
MODULES += os/net/app-layer/http-socket
CONTIKI_WITH_RPL_LITE = 0
CFLAGS += -DUIP_CONF_TCP=1
include $(CONTIKI)/Makefile.include
/*
* Copyright (c) 2017, George Oikonomou - http://www.spd.gr
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
*
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
* 3. Neither the name of the copyright holder nor the names of its
* contributors may be used to endorse or promote products derived
* from this software without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
* FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
* COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
* INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
* SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
* STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
* OF THE POSSIBILITY OF SUCH DAMAGE.
*/
/*---------------------------------------------------------------------------*/
#ifndef PROJECT_CONF_H_
#define PROJECT_CONF_H_
/*---------------------------------------------------------------------------*/
#define UIP_CONF_TCP 1
/*---------------------------------------------------------------------------*/
#endif /* PROJECT_CONF_H_ */
all: ip64-router
CONTIKI=../..
CFLAGS += -DUIP_CONF_TCP=1
include $(CONTIKI)/Makefile.include
/*
* Copyright (c) 2017, George Oikonomou - http://www.spd.gr
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
*
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
* 3. Neither the name of the copyright holder nor the names of its
* contributors may be used to endorse or promote products derived
* from this software without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
* FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
* COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
* INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
* SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
* STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
* OF THE POSSIBILITY OF SUCH DAMAGE.
*/
/*---------------------------------------------------------------------------*/
#ifndef PROJECT_CONF_H_
#define PROJECT_CONF_H_
/*---------------------------------------------------------------------------*/
#define UIP_CONF_TCP 1
/*---------------------------------------------------------------------------*/
#endif /* PROJECT_CONF_H_ */
......@@ -43,17 +43,13 @@
#define IPSO_TEMPERATURE example_ipso_temperature
/* Increase rpl-border-router IP-buffer when using more than 64. */
#undef REST_MAX_CHUNK_SIZE
#define REST_MAX_CHUNK_SIZE 64
/* Multiplies with chunk size, be aware of memory constraints. */
#undef COAP_MAX_OPEN_TRANSACTIONS
#define COAP_MAX_OPEN_TRANSACTIONS 4
/* Filtering .well-known/core per query can be disabled to save space. */
#undef COAP_LINK_FORMAT_FILTERING
#define COAP_LINK_FORMAT_FILTERING 0
#undef COAP_PROXY_OPTION_PROCESSING
#define COAP_PROXY_OPTION_PROCESSING 0
/* Enable client-side support for COAP observe */
......
......@@ -19,7 +19,6 @@ PRELIMINARIES
- Make sure rpl-border-router has the same stack and fits into mote memory:
You can disable RDC in border-router project-conf.h (not really required as BR keeps radio turned on).
#undef NETSTACK_CONF_RDC
#define NETSTACK_CONF_RDC nullrdc_driver
- Alternatively, you can use the native-border-router together with the slip-radio.
- For convenience, define the Cooja addresses in /etc/hosts
......
......@@ -41,47 +41,36 @@
/* Custom channel and PAN ID configuration for your project. */
/*
#undef RF_CHANNEL
#define RF_CHANNEL 26
#undef IEEE802154_CONF_PANID
#define IEEE802154_CONF_PANID 0xABCD
*/
/* IP buffer size must match all other hops, in particular the border router. */
/*
#undef UIP_CONF_BUFFER_SIZE
#define UIP_CONF_BUFFER_SIZE 256
*/
/* Increase rpl-border-router IP-buffer when using more than 64. */
#undef REST_MAX_CHUNK_SIZE
#define REST_MAX_CHUNK_SIZE 48
/* Estimate your header size, especially when using Proxy-Uri. */
/*
#undef COAP_MAX_HEADER_SIZE
#define COAP_MAX_HEADER_SIZE 70
*/
/* Multiplies with chunk size, be aware of memory constraints. */
#undef COAP_MAX_OPEN_TRANSACTIONS
#define COAP_MAX_OPEN_TRANSACTIONS 4
/* Must be <= open transactions, default is COAP_MAX_OPEN_TRANSACTIONS-1. */
/*
#undef COAP_MAX_OBSERVERS
#define COAP_MAX_OBSERVERS 2
*/
/* Filtering .well-known/core per query can be disabled to save space. */
#undef COAP_LINK_FORMAT_FILTERING
#define COAP_LINK_FORMAT_FILTERING 0
#undef COAP_PROXY_OPTION_PROCESSING
#define COAP_PROXY_OPTION_PROCESSING 0
/* Turn off DAO-ACK to make code smaller */
#undef RPL_CONF_WITH_DAO_ACK
#define RPL_CONF_WITH_DAO_ACK 0
/* Enable client-side support for COAP observe */
......
......@@ -38,13 +38,10 @@
#define JSON_WS_CONF_CALLBACK_PORT 80
#define JSON_WS_CONF_CALLBACK_INTERVAL 120
#undef WEBSERVER_CONF_INBUF_SIZE
#define WEBSERVER_CONF_INBUF_SIZE 200
#undef WEBSERVER_CONF_OUTBUF_SIZE
#define WEBSERVER_CONF_OUTBUF_SIZE (UIP_TCP_MSS + 20 + 80)
#undef WEBSERVER_CONF_CFS_CONNS
#define WEBSERVER_CONF_CFS_CONNS 3
#endif /* PROJECT_CONF_H_ */
......@@ -49,13 +49,10 @@
/* For Imin: Use 16 over CSMA, 64 over Contiki MAC */
#define ROLL_TM_CONF_IMIN_1 64
#undef UIP_MCAST6_ROUTE_CONF_ROUTES
#define UIP_MCAST6_ROUTE_CONF_ROUTES 1
/* Code/RAM footprint savings so that things will fit on our device */
#undef NETSTACK_MAX_ROUTE_ENTRIES
#define NETSTACK_MAX_ROUTE_ENTRIES 10
#undef NBR_TABLE_CONF_MAX_NEIGHBORS
#define NBR_TABLE_CONF_MAX_NEIGHBORS 10
#endif /* PROJECT_CONF_H_ */
......@@ -30,21 +30,17 @@
#ifndef PROJECT_ROUTER_CONF_H_
#define PROJECT_ROUTER_CONF_H_
#undef UIP_FALLBACK_INTERFACE
#define UIP_FALLBACK_INTERFACE rpl_interface
/* use a non-default network driver */
#undef NETSTACK_CONF_NETWORK
#define NETSTACK_CONF_NETWORK sicslowpan_driver
/* use a non-default MAC driver */
#undef NETSTACK_CONF_MAC
#define NETSTACK_CONF_MAC border_router_mac_driver
#define SLIP_DEV_CONF_SEND_DELAY (CLOCK_SECOND / 32)
#undef WEBSERVER_CONF_CFS_CONNS
#define WEBSERVER_CONF_CFS_CONNS 2
#define SERIALIZE_ATTRIBUTES 1
......
......@@ -16,12 +16,10 @@ PROJECT_SOURCEFILES += slip-bridge.c
WITH_WEBSERVER=1
ifeq ($(WITH_WEBSERVER),1)
CFLAGS += -DUIP_CONF_TCP=1
CFLAGS += -DWEBSERVER=1
PROJECT_SOURCEFILES += httpd-simple.c
else ifneq ($(WITH_WEBSERVER), 0)
MODULES += $(WITH_WEBSERVER)
CFLAGS += -DUIP_CONF_TCP=1
CFLAGS += -DWEBSERVER=2
endif
......
......@@ -39,4 +39,8 @@
#define WEBSERVER_CONF_CFS_CONNS 2
#endif
#if WEBSERVER
#define UIP_CONF_TCP 1
#endif
#endif /* PROJECT_ROUTER_CONF_H_ */
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment