From 222a8582549fd6b4aa53c27a92db1a71801f34d0 Mon Sep 17 00:00:00 2001 From: Matthias Kovatsch Date: Sun, 13 May 2012 16:23:28 +0200 Subject: [PATCH] Optimized configuration to fit into sky again. --- examples/er-rest-example/Makefile | 19 +++++++++++-------- examples/er-rest-example/project-conf.h | 15 ++++----------- .../er-rest-example/rest-server-example.c | 2 +- 3 files changed, 16 insertions(+), 20 deletions(-) diff --git a/examples/er-rest-example/Makefile b/examples/er-rest-example/Makefile index 979e9f477..29fb071f1 100644 --- a/examples/er-rest-example/Makefile +++ b/examples/er-rest-example/Makefile @@ -1,4 +1,5 @@ -all: rest-server-example coap-client-example plugtest-server +all: rest-server-example coap-client-example +# Use this target explicitly if requried: plugtest-server CONTIKI=../.. CFLAGS += -DPROJECT_CONF_H=\"project-conf.h\" @@ -6,9 +7,11 @@ CFLAGS += -DPROJECT_CONF_H=\"project-conf.h\" # for static routing, if enabled ifneq ($(TARGET), minimal-net) ifneq ($(TARGET), native) +ifneq ($(findstring avr,$(TARGET)), avr) PROJECT_SOURCEFILES += static-routing.c endif endif +endif # variable for root Makefile.include WITH_UIP6=1 @@ -16,7 +19,7 @@ WITH_UIP6=1 UIP_CONF_IPV6=1 # variable for this Makefile -# configure CoAP implementation (3|7) +# configure CoAP implementation (3|7) (er-coap-07 also supports CoAP draft 08) WITH_COAP=7 # new variable since slip-radio @@ -36,14 +39,16 @@ SMALL=1 # REST framework, requires WITH_COAP ifeq ($(WITH_COAP), 7) -${info INFO: compiling with CoAP-07} +${info INFO: compiling with CoAP-08} CFLAGS += -DWITH_COAP=7 CFLAGS += -DREST=coap_rest_implementation +CFLAGS += -DUIP_CONF_TCP=0 APPS += er-coap-07 else ifeq ($(WITH_COAP), 3) ${info INFO: compiling with CoAP-03} CFLAGS += -DWITH_COAP=3 CFLAGS += -DREST=coap_rest_implementation +CFLAGS += -DUIP_CONF_TCP=0 APPS += er-coap-03 else ${info INFO: compiling with HTTP} @@ -55,23 +60,21 @@ endif APPS += erbium - +# optional rules to get assembly #CUSTOM_RULE_C_TO_OBJECTDIR_O = 1 #CUSTOM_RULE_S_TO_OBJECTDIR_O = 1 include $(CONTIKI)/Makefile.include +# optional rules to get assembly #$(OBJECTDIR)/%.o: asmdir/%.S # $(CC) $(CFLAGS) -MMD -c $< -o $@ # @$(FINALIZE_DEPENDENCY) # #asmdir/%.S: %.c # $(CC) $(CFLAGS) -MMD -S $< -o $@ - - - - +# border router rules $(CONTIKI)/tools/tunslip6: $(CONTIKI)/tools/tunslip6.c (cd $(CONTIKI)/tools && $(MAKE) tunslip6) diff --git a/examples/er-rest-example/project-conf.h b/examples/er-rest-example/project-conf.h index 0e91bedcd..751503f13 100644 --- a/examples/er-rest-example/project-conf.h +++ b/examples/er-rest-example/project-conf.h @@ -52,7 +52,7 @@ /* Multiplies with chunk size, be aware of memory constraints. */ #ifndef COAP_MAX_OPEN_TRANSACTIONS -#define COAP_MAX_OPEN_TRANSACTIONS 4 +#define COAP_MAX_OPEN_TRANSACTIONS 2 #endif /* Must be <= open transaction number. */ @@ -60,15 +60,8 @@ #define COAP_MAX_OBSERVERS COAP_MAX_OPEN_TRANSACTIONS-1 #endif - -#ifndef UIP_CONF_RECEIVE_WINDOW -#define UIP_CONF_RECEIVE_WINDOW 60 -#endif - -#ifndef WEBSERVER_CONF_CFS_CONNS -#define WEBSERVER_CONF_CFS_CONNS 2 -#endif - - +/* Reduce 802.15.4 frame queue to save RAM. */ +#undef QUEUEBUF_CONF_NUM +#define QUEUEBUF_CONF_NUM 4 #endif /* __PROJECT_RPL_WEB_CONF_H__ */ diff --git a/examples/er-rest-example/rest-server-example.c b/examples/er-rest-example/rest-server-example.c index 911069d88..a062fd009 100644 --- a/examples/er-rest-example/rest-server-example.c +++ b/examples/er-rest-example/rest-server-example.c @@ -53,7 +53,7 @@ #define REST_RES_LEDS 1 #define REST_RES_TOGGLE 1 #define REST_RES_LIGHT 0 -#define REST_RES_BATTERY 1 +#define REST_RES_BATTERY 0