You can subscribe to this list here.
2012 |
Jan
|
Feb
|
Mar
|
Apr
|
May
(45) |
Jun
(37) |
Jul
(6) |
Aug
(3) |
Sep
(7) |
Oct
(3) |
Nov
|
Dec
|
---|---|---|---|---|---|---|---|---|---|---|---|---|
2015 |
Jan
|
Feb
|
Mar
|
Apr
|
May
(1) |
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
(1) |
2017 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
(1) |
Sep
|
Oct
|
Nov
|
Dec
|
2018 |
Jan
(1) |
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
2019 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
(1) |
Nov
|
Dec
|
From: Kunal V <kun...@gm...> - 2018-01-18 18:25:17
|
Hello, I am new to Contiki and using Contiki 3.0. Can anyone please help me on following points: 1. How to set RPL into non storing mode from storing mode? I'm trying with changing DAG mode in rpl-private.h but it seems it's not the correct way. 2. Why Cooja Collect View works only with simulation in rpl-collect and not in my custom simulation project? Thanks, With Regards, Kunal |
From: Saidi S. <sai...@ya...> - 2017-08-18 11:57:51
|
salammay i know how to give(load) the ECG signal to the mote in contiki simulator? |
From: Rehmat U. <reh...@ho...> - 2015-12-15 08:06:48
|
Dear All.As we know that RPL default objective function is mrhof.c. I want to use the same OF but include remaining energy . in mrhof.c the routing decision is based on ETX value. I want to include remaining energy for routing decision. Where i shall make changes in the mrhof.c code. coud any one please guide me.Thanks RegardsRehmat Ullah |
From: allali s. <all...@gm...> - 2015-05-28 11:59:21
|
Hello, I want to run automatically n iteration of rpl-udp-powertrace program however when I excute the bash RUN_TEST rpl-udp-powertrace or bash RUN_REPEATED commande it says that the RUN_TEST does not existe and also I could not excute it in the "contiki/tools/cooja/contiki_tests" directory because it does not existes too. Please I want to know how it is possible to run n iteration of the same programme in a terminal without using the graphic interface. Regards |
From: Niclas F. <ni...@us...> - 2012-10-22 22:53:48
|
This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "contiki". The branch, master has been updated via f5c8cff5b2c77aa387f68e110a9a762b2a961648 (commit) via e25226f01eb40a7d4763551ce13a7428b4a3a414 (commit) from 74baca91b1651bf830ef5ada68803ae80885bb68 (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- commit f5c8cff5b2c77aa387f68e110a9a762b2a961648 Author: Niclas Finne <nf...@si...> Date: Tue Oct 23 00:52:52 2012 +0200 Made MT stack size configurable diff --git a/cpu/msp430/mtarch.h b/cpu/msp430/mtarch.h index 68913d8..313c558 100644 --- a/cpu/msp430/mtarch.h +++ b/cpu/msp430/mtarch.h @@ -27,13 +27,15 @@ * SUCH DAMAGE. * * This file is part of the Contiki operating system. - * - * @(#)$Id: mtarch.h,v 1.3 2008/11/21 10:28:32 fros4943 Exp $ */ #ifndef __MTARCH_H__ #define __MTARCH_H__ +#include "contiki.h" + +#ifndef MTARCH_STACKSIZE #define MTARCH_STACKSIZE 128 +#endif /* MTARCH_STACKSIZE */ struct mtarch_thread { unsigned short stack[MTARCH_STACKSIZE]; @@ -46,6 +48,4 @@ struct mt_thread; int mtarch_stack_usage(struct mt_thread *t); - #endif /* __MTARCH_H__ */ - diff --git a/cpu/native/mtarch.c b/cpu/native/mtarch.c index e9df427..a774e3b 100644 --- a/cpu/native/mtarch.c +++ b/cpu/native/mtarch.c @@ -33,6 +33,12 @@ * $Id: mtarch.c,v 1.2 2007/04/03 18:37:15 oliverschmidt Exp $ */ +#include "sys/mt.h" + +#ifndef MTARCH_STACKSIZE +#define MTARCH_STACKSIZE 4096 +#endif /* MTARCH_STACKSIZE */ + #if defined(_WIN32) || defined(__CYGWIN__) #define WIN32_LEAN_AND_MEAN @@ -52,7 +58,7 @@ static void *main_fiber; #include <ucontext.h> struct mtarch_t { - char stack[4096]; + char stack[MTARCH_STACKSIZE]; ucontext_t context; }; @@ -61,8 +67,6 @@ static ucontext_t *running_context; #endif /* _WIN32 || __CYGWIN__ || __linux */ -#include "mtarch.h" - /*--------------------------------------------------------------------------*/ void mtarch_init(void) diff --git a/examples/multi-threading/multi-threading.c b/examples/multi-threading/multi-threading.c index d52ec75..d8439f5 100644 --- a/examples/multi-threading/multi-threading.c +++ b/examples/multi-threading/multi-threading.c @@ -48,6 +48,7 @@ #include "contiki.h" #include "sys/mt.h" +#include <stdio.h> static char *ptr; commit e25226f01eb40a7d4763551ce13a7428b4a3a414 Author: Niclas Finne <nf...@si...> Date: Fri Oct 19 14:07:22 2012 +0200 Use the directory of the source file as initial directory when opening file browser diff --git a/tools/cooja/java/se/sics/cooja/dialogs/AbstractCompileDialog.java b/tools/cooja/java/se/sics/cooja/dialogs/AbstractCompileDialog.java index 4b2e3fa..814cc8d 100644 --- a/tools/cooja/java/se/sics/cooja/dialogs/AbstractCompileDialog.java +++ b/tools/cooja/java/se/sics/cooja/dialogs/AbstractCompileDialog.java @@ -184,6 +184,10 @@ public abstract class AbstractCompileDialog extends JDialog { public void actionPerformed(ActionEvent e) { JFileChooser fc = new JFileChooser(); + File fp = new File(contikiField.getText()); + if (fp.exists() && fp.isFile()) { + lastFile = fp; + } if (lastFile == null) { String path = GUI.getExternalToolsSetting("COMPILE_LAST_FILE", null); if (path != null) { @@ -691,6 +695,8 @@ public abstract class AbstractCompileDialog extends JDialog { } private Action defaultAction = new AbstractAction("Use default") { + private static final long serialVersionUID = 2874355910493988933L; + public void actionPerformed(ActionEvent e) { /* Unselect all */ for (Component c : moteIntfBox.getComponents()) { @@ -713,7 +719,7 @@ public abstract class AbstractCompileDialog extends JDialog { * @return Currently selected mote interface classes */ public Class<? extends MoteInterface>[] getSelectedMoteInterfaceClasses() { - ArrayList<Class<? extends MoteInterface>> selected = new ArrayList(); + ArrayList<Class<? extends MoteInterface>> selected = new ArrayList<Class<? extends MoteInterface>>(); for (Component c : moteIntfBox.getComponents()) { if (!(c instanceof JCheckBox)) { @@ -736,8 +742,7 @@ public abstract class AbstractCompileDialog extends JDialog { } Class<? extends MoteInterface>[] arr = new Class[selected.size()]; - selected.toArray(arr); - return arr; + return selected.toArray(arr); } /** ----------------------------------------------------------------------- Summary of changes: cpu/msp430/mtarch.h | 8 ++++---- cpu/native/mtarch.c | 10 +++++++--- examples/multi-threading/multi-threading.c | 1 + .../sics/cooja/dialogs/AbstractCompileDialog.java | 11 ++++++++--- 4 files changed, 20 insertions(+), 10 deletions(-) hooks/post-receive -- contiki |
From: Simon D. <sim...@us...> - 2012-10-05 15:57:56
|
This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "contiki". The branch, master has been updated via 74baca91b1651bf830ef5ada68803ae80885bb68 (commit) via dbd4f1c5790c6eb36a3b07ad0284731aebc27592 (commit) from 621790f156a091c1a2c2c3bbfcd14595d3281840 (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- commit 74baca91b1651bf830ef5ada68803ae80885bb68 Author: simonduq <sim...@si...> Date: Fri Oct 5 17:55:45 2012 +0200 Added sanity check to avoid deleting DS6 neighbor table entry for a default route diff --git a/core/net/uip-ds6.c b/core/net/uip-ds6.c index eefbef1..056c74c 100644 --- a/core/net/uip-ds6.c +++ b/core/net/uip-ds6.c @@ -335,7 +335,7 @@ uip_ds6_nbr_add(uip_ipaddr_t *ipaddr, uip_lladdr_t *lladdr, for(n = uip_ds6_nbr_cache; n < &uip_ds6_nbr_cache[UIP_DS6_NBR_NB]; n++) { - if(n->isused) { + if(n->isused && !uip_ds6_defrt_lookup(&n->ipaddr)) { if(n->last_lookup < oldest_time) { oldest = n; oldest_time = n->last_lookup; commit dbd4f1c5790c6eb36a3b07ad0284731aebc27592 Author: simonduq <sim...@si...> Date: Fri Oct 5 17:24:23 2012 +0200 Force call of subscriber_callback when the ETX of a link is estimated for the first time. Otherwise, it was not called in case of NO_ACK. diff --git a/core/net/neighbor-info.c b/core/net/neighbor-info.c index b617899..b0492e1 100644 --- a/core/net/neighbor-info.c +++ b/core/net/neighbor-info.c @@ -61,12 +61,14 @@ update_metric(const rimeaddr_t *dest, int packet_metric) link_metric_t *metricp; link_metric_t recorded_metric, new_metric; unsigned long time; + int first_update = 0; metricp = (link_metric_t *)neighbor_attr_get_data(&attr_etx, dest); packet_metric = NEIGHBOR_INFO_ETX2FIX(packet_metric); if(metricp == NULL || *metricp == 0) { recorded_metric = NEIGHBOR_INFO_ETX2FIX(ETX_LIMIT); new_metric = packet_metric; + first_update = 1; } else { recorded_metric = *metricp; /* Update the EWMA of the ETX for the neighbor. */ @@ -84,7 +86,7 @@ update_metric(const rimeaddr_t *dest, int packet_metric) time = clock_seconds(); neighbor_attr_set_data(&attr_etx, dest, &new_metric); neighbor_attr_set_data(&attr_timestamp, dest, &time); - if(new_metric != recorded_metric && subscriber_callback != NULL) { + if((first_update || new_metric != recorded_metric) && subscriber_callback != NULL) { subscriber_callback(dest, 1, new_metric); } } ----------------------------------------------------------------------- Summary of changes: core/net/neighbor-info.c | 4 +++- core/net/uip-ds6.c | 2 +- 2 files changed, 4 insertions(+), 2 deletions(-) hooks/post-receive -- contiki |
From: Joakim E. <jo...@us...> - 2012-10-01 11:16:32
|
This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "contiki". The branch, master has been updated via 621790f156a091c1a2c2c3bbfcd14595d3281840 (commit) from d84a97103fb2d2cad28402db31242d1dae3c7e67 (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- commit 621790f156a091c1a2c2c3bbfcd14595d3281840 Author: Joakim Eriksson <jo...@si...> Date: Mon Oct 1 13:09:16 2012 +0200 fixed read loop to be slightly less CPU speed dependent diff --git a/core/dev/sht11.c b/core/dev/sht11.c index 9577281..815bf6a 100644 --- a/core/dev/sht11.c +++ b/core/dev/sht11.c @@ -250,7 +250,7 @@ sht11_off(void) static unsigned int scmd(unsigned cmd) { - unsigned long n; + unsigned int n; if(cmd != MEASURE_HUMI && cmd != MEASURE_TEMP) { PRINTF("Illegal command: %d\n", cmd); @@ -263,7 +263,7 @@ scmd(unsigned cmd) goto fail; } - for(n = 0; n < 250000; n++) { + for(n = 0; n < 20000; n++) { if(!SDA_IS_1) { unsigned t0, t1, rcrc; t0 = sread(1); @@ -285,8 +285,9 @@ scmd(unsigned cmd) #endif return (t0 << 8) | t1; } + /* short wait before next loop */ + clock_wait(1); } - fail: sreset(); return -1; ----------------------------------------------------------------------- Summary of changes: core/dev/sht11.c | 7 ++++--- 1 files changed, 4 insertions(+), 3 deletions(-) hooks/post-receive -- contiki |
From: George O. <oik...@us...> - 2012-09-20 14:47:36
|
This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "contiki". The branch, master has been updated via d84a97103fb2d2cad28402db31242d1dae3c7e67 (commit) via fde15106533bf0ca29d9af62bb37a9d8ac74a1ab (commit) via 3b0e92168b1674915e4b4d3f885a2c2a9f56ddbd (commit) via b292e0201280efa1c3b8ec67c23a7a64d2f3595c (commit) via 95b9d4ee29829bb176271146ea5d6cd9429bc67c (commit) via 067fabe0f9c85fa97e79a476e2f856169b4996c4 (commit) via cb168da7298365d0e8c9978767596567797a1592 (commit) via fa5a38666b68dcbca910498e24f3b80497d4e0f8 (commit) via 88c6689e38df71f4ec3e6d826340f5ba9f11a0b7 (commit) from 767e8bb551084f762f9a5f8098022e2a52fdc130 (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- commit d84a97103fb2d2cad28402db31242d1dae3c7e67 Author: George Oikonomou <g.o...@br...> Date: Thu Sep 20 15:12:02 2012 +0100 cc2x3x stack debugging macro fix diff --git a/cpu/cc2430/stack.h b/cpu/cc2430/stack.h index 18caccd..6ee7442 100644 --- a/cpu/cc2430/stack.h +++ b/cpu/cc2430/stack.h @@ -52,7 +52,6 @@ extern CC_AT_DATA uint8_t sp; #define stack_max_sp_print(f) do { \ putstring(f); \ - sp = SP; \ puthex(stack_get_max()); \ putchar('\n'); \ } while(0) diff --git a/cpu/cc253x/stack.h b/cpu/cc253x/stack.h index 989875d..16ceb92 100644 --- a/cpu/cc253x/stack.h +++ b/cpu/cc253x/stack.h @@ -52,7 +52,6 @@ extern CC_AT_DATA uint8_t sp; #define stack_max_sp_print(f) do { \ putstring(f); \ - sp = SP; \ puthex(stack_get_max()); \ putchar('\n'); \ } while(0) commit fde15106533bf0ca29d9af62bb37a9d8ac74a1ab Author: George Oikonomou <g.o...@br...> Date: Fri Sep 7 11:27:03 2012 +0100 Added definitions for cc2530 DMA-related SFR bits diff --git a/cpu/cc253x/sfr-bits.h b/cpu/cc253x/sfr-bits.h index efec539..7a4d72c 100644 --- a/cpu/cc253x/sfr-bits.h +++ b/cpu/cc253x/sfr-bits.h @@ -148,6 +148,28 @@ #define PICTL_P1ICONH 0x04 #define PICTL_P1ICONL 0x02 #define PICTL_P0ICON 0x01 + +/* DMAARM */ +#define DMAARM_ABORT 0x80 +#define DMAARM_DMAARM4 0x10 +#define DMAARM_DMAARM3 0x08 +#define DMAARM_DMAARM2 0x04 +#define DMAARM_DMAARM1 0x02 +#define DMAARM_DMAARM0 0x01 + +/* DMAREQ */ +#define DMAREQ_DMAREQ4 0x10 +#define DMAREQ_DMAREQ3 0x08 +#define DMAREQ_DMAREQ2 0x04 +#define DMAREQ_DMAREQ1 0x02 +#define DMAREQ_DMAREQ0 0x01 + +/* DMAIRQ */ +#define DMAIRQ_DMAIF4 0x10 +#define DMAIRQ_DMAIF3 0x08 +#define DMAIRQ_DMAIF2 0x04 +#define DMAIRQ_DMAIF1 0x02 +#define DMAIRQ_DMAIF0 0x01 /*--------------------------------------------------------------------------- * XREG bits, excluding RF and USB *---------------------------------------------------------------------------*/ commit 3b0e92168b1674915e4b4d3f885a2c2a9f56ddbd Author: George Oikonomou <g.o...@br...> Date: Fri Sep 7 15:23:08 2012 +0100 Copied cc2530 stack functions to the cc2430 port diff --git a/cpu/cc2430/Makefile.cc2430 b/cpu/cc2430/Makefile.cc2430 index fab1fbf..0f67e88 100644 --- a/cpu/cc2430/Makefile.cc2430 +++ b/cpu/cc2430/Makefile.cc2430 @@ -89,7 +89,7 @@ CONTIKI_CPU_DIRS = . dev ### CPU-dependent source files CONTIKI_SOURCEFILES += bus.c clock.c uart0.c uart1.c cc2430_rf.c dma.c CONTIKI_SOURCEFILES += uart_intr.c cc2430_rf_intr.c dma_intr.c -CONTIKI_SOURCEFILES += watchdog-cc2430.c rtimer-arch.c +CONTIKI_SOURCEFILES += watchdog-cc2430.c rtimer-arch.c stack.c CONTIKI_ASMFILES += CONTIKI_ASMOBJECTFILES = $(addprefix $(OBJECTDIR)/,$(CONTIKI_ASMFILES:.S=.rel)) diff --git a/cpu/cc2430/stack.c b/cpu/cc2430/stack.c new file mode 100644 index 0000000..0a26330 --- /dev/null +++ b/cpu/cc2430/stack.c @@ -0,0 +1,71 @@ +/* + * Copyright (c) 2011, George Oikonomou - <oik...@us...> + * 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 Institute 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 AUTHOR 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 INSTITUTE 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. + * + * This file is part of the Contiki operating system. + */ + +/** + * \file + * 8051 stack debugging facilities + * + * \author + * George Oikonomou - <oik...@us...> + * Philippe Retornaz (EPFL) + */ +#include "contiki.h" + +#ifndef STACK_POISON +#define STACK_POISON 0xAA +#endif + +CC_AT_DATA uint8_t sp; + +void +stack_poison(void) +{ + __asm + mov r1, _SP +poison_loop: + inc r1 + mov @r1, #STACK_POISON + cjne r1, #0xFF, poison_loop + __endasm; +} + +uint8_t +stack_get_max(void) +{ + __data uint8_t * sp = (__data uint8_t *) 0xff; + uint8_t free = 0; + + while(*sp-- == STACK_POISON) { + free++; + } + + return 0xff - free; +} diff --git a/cpu/cc2430/stack.h b/cpu/cc2430/stack.h new file mode 100644 index 0000000..18caccd --- /dev/null +++ b/cpu/cc2430/stack.h @@ -0,0 +1,69 @@ +/* + * Copyright (c) 2011, George Oikonomou - <oik...@us...> + * 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 Institute 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 AUTHOR 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 INSTITUTE 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. + * + * This file is part of the Contiki operating system. + */ + +/** + * \file + * Header file for 8051 stack debugging facilities + * + * \author + * George Oikonomou - <oik...@us...> + * Philippe Retornaz (EPFL) + */ +#ifndef STACK_H_ +#define STACK_H_ + +#if STACK_CONF_DEBUGGING +extern CC_AT_DATA uint8_t sp; + +#define stack_dump(f) do { \ + putstring(f); \ + sp = SP; \ + puthex(sp); \ + putchar('\n'); \ +} while(0) + +#define stack_max_sp_print(f) do { \ + putstring(f); \ + sp = SP; \ + puthex(stack_get_max()); \ + putchar('\n'); \ +} while(0) + +void stack_poison(void); +uint8_t stack_get_max(void); +#else +#define stack_dump(...) +#define stack_max_sp_print(...) +#define stack_poison() +#define stack_get_max() +#endif + +#endif /* STACK_H_ */ diff --git a/platform/sensinode/contiki-conf.h b/platform/sensinode/contiki-conf.h index ea11008..610c3cf 100644 --- a/platform/sensinode/contiki-conf.h +++ b/platform/sensinode/contiki-conf.h @@ -24,6 +24,10 @@ /* Logging.. */ #define LOG_CONF_ENABLED 0 +#ifndef STACK_CONF_DEBUGGING +#define STACK_CONF_DEBUGGING 0 +#endif + /* Energest Module */ #ifndef ENERGEST_CONF_ON #define ENERGEST_CONF_ON 0 diff --git a/platform/sensinode/contiki-sensinode-main.c b/platform/sensinode/contiki-sensinode-main.c index 6899de9..27cc1a1 100644 --- a/platform/sensinode/contiki-sensinode-main.c +++ b/platform/sensinode/contiki-sensinode-main.c @@ -16,6 +16,7 @@ #include "net/netstack.h" #include "net/mac/frame802154.h" #include "debug.h" +#include "stack.h" #include "dev/watchdog-cc2430.h" #include "dev/sensinode-sensors.h" #include "disco.h" @@ -164,6 +165,8 @@ main(void) bus_init(); rtimer_init(); + stack_poison(); + /* model-specific h/w init. */ model_init(); commit b292e0201280efa1c3b8ec67c23a7a64d2f3595c Author: George Oikonomou <g.o...@br...> Date: Fri Sep 7 14:59:34 2012 +0100 Sensinode putdec() debugging diff --git a/platform/sensinode/debug.c b/platform/sensinode/debug.c index b1e3a27..390c2ff 100644 --- a/platform/sensinode/debug.c +++ b/platform/sensinode/debug.c @@ -44,3 +44,18 @@ putbin(uint8_t c) } } /*---------------------------------------------------------------------------*/ +void +putdec(uint8_t c) +{ + uint8_t div; + uint8_t hassent = 0; + for(div = 100; div > 0; div /= 10) { + uint8_t disp = c / div; + c %= div; + if((disp != 0) || (hassent) || (div == 1)) { + hassent = 1; + putchar('0'+disp); + } + } +} +/*---------------------------------------------------------------------------*/ diff --git a/platform/sensinode/debug.h b/platform/sensinode/debug.h index 4c5dc13..94eaa4f 100644 --- a/platform/sensinode/debug.h +++ b/platform/sensinode/debug.h @@ -50,5 +50,6 @@ void putchar(char c); void putstring(char *s); void puthex(uint8_t c); void putbin(uint8_t c); +void putdec(uint8_t c); #endif /* DEBUG_H_ */ commit 95b9d4ee29829bb176271146ea5d6cd9429bc67c Author: George Oikonomou <g.o...@br...> Date: Fri Sep 7 14:48:15 2012 +0100 Sensinode/cc2430 stack depth optimisation This replicates the method used by the cc2530 port diff --git a/cpu/cc2430/8051def.h b/cpu/cc2430/8051def.h index ce6bc33..fe82ce9 100644 --- a/cpu/cc2430/8051def.h +++ b/cpu/cc2430/8051def.h @@ -51,6 +51,26 @@ #define CC_NON_BANKED #endif +/* + * Max Stack Depth manipulation. It is possible to get up to 247 bytes + * allocated for the stack if: + * - You set this to 1 and + * - You have a patched toolchain and + * - You don't use __bit variables + * - You do not link libraries using BIT registers (e.g. printf_large) + * Enabling this will mean ISRs will NOT push bits (#pragma exclude bits) so + * make sure you know what you're doing + * + * More information on the wiki + */ +#define CC_CONF_OPTIMIZE_STACK_SIZE 0 + +#if CC_CONF_OPTIMIZE_STACK_SIZE +#define CC_AT_DATA +#else +#define CC_AT_DATA __data +#endif + /* Generic types. */ typedef unsigned short uip_stats_t; diff --git a/cpu/cc2430/dev/cc2430_rf.c b/cpu/cc2430/dev/cc2430_rf.c index 5339c84..7d6d5ec 100644 --- a/cpu/cc2430/dev/cc2430_rf.c +++ b/cpu/cc2430/dev/cc2430_rf.c @@ -105,7 +105,7 @@ uint8_t rf_error = 0; PROCESS(cc2430_rf_process, "CC2430 RF driver"); #endif /*---------------------------------------------------------------------------*/ -static uint8_t __data rf_flags; +static uint8_t CC_AT_DATA rf_flags; static uint8_t rf_channel; static int on(void); /* prepare() needs our prototype */ diff --git a/cpu/cc2430/dev/cc2430_rf_intr.c b/cpu/cc2430/dev/cc2430_rf_intr.c index 510c93f..b19a115 100644 --- a/cpu/cc2430/dev/cc2430_rf_intr.c +++ b/cpu/cc2430/dev/cc2430_rf_intr.c @@ -56,6 +56,10 @@ PROCESS_NAME(cc2430_rf_process); * RF interrupt service routine. * */ +#pragma save +#if CC_CONF_OPTIMIZE_STACK_SIZE +#pragma exclude bits +#endif void cc2430_rf_ISR( void ) __interrupt (RF_VECTOR) { @@ -75,6 +79,7 @@ cc2430_rf_ISR( void ) __interrupt (RF_VECTOR) ENERGEST_OFF(ENERGEST_TYPE_IRQ); EA = 1; } +#pragma restore #endif /*---------------------------------------------------------------------------*/ #if CC2430_RFERR_INTERRUPT @@ -82,6 +87,10 @@ cc2430_rf_ISR( void ) __interrupt (RF_VECTOR) * RF error interrupt service routine. * Turned off by default, can be turned on in contiki-conf.h */ +#pragma save +#if CC_CONF_OPTIMIZE_STACK_SIZE +#pragma exclude bits +#endif void cc2430_rf_error_ISR( void ) __interrupt (RFERR_VECTOR) { @@ -98,5 +107,6 @@ cc2430_rf_error_ISR( void ) __interrupt (RFERR_VECTOR) RF_TX_LED_OFF(); EA = 1; } +#pragma restore #endif /*---------------------------------------------------------------------------*/ diff --git a/cpu/cc2430/dev/clock.c b/cpu/cc2430/dev/clock.c index 8ca9690..e36a112 100644 --- a/cpu/cc2430/dev/clock.c +++ b/cpu/cc2430/dev/clock.c @@ -51,8 +51,8 @@ volatile uint8_t sleep_flag; /*---------------------------------------------------------------------------*/ /* Used in sleep timer interrupt for calculating the next interrupt time */ static unsigned long timer_value; -static volatile __data clock_time_t count = 0; /* Uptime in ticks */ -static volatile __data clock_time_t seconds = 0; /* Uptime in secs */ +static volatile CC_AT_DATA clock_time_t count = 0; /* Uptime in ticks */ +static volatile CC_AT_DATA clock_time_t seconds = 0; /* Uptime in secs */ /*---------------------------------------------------------------------------*/ /** * Each iteration is ~1.0xy usec, so this function delays for roughly len usec @@ -109,6 +109,10 @@ clock_init(void) IEN0_STIE = 1; /* IEN0.STIE acknowledge Sleep Timer Interrupt */ } /*---------------------------------------------------------------------------*/ +#pragma save +#if CC_CONF_OPTIMIZE_STACK_SIZE +#pragma exclude bits +#endif void clock_ISR(void) __interrupt(ST_VECTOR) { @@ -161,4 +165,5 @@ clock_ISR(void) __interrupt(ST_VECTOR) ENERGEST_OFF(ENERGEST_TYPE_IRQ); ENABLE_INTERRUPTS(); } +#pragma restore /*------------------ |
From: Niclas F. <ni...@us...> - 2012-09-20 12:02:23
|
This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "contiki". The branch, master has been updated via 767e8bb551084f762f9a5f8098022e2a52fdc130 (commit) from 463094547531f37df9668826771a6a0d4eb792d9 (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- commit 767e8bb551084f762f9a5f8098022e2a52fdc130 Author: Niclas Finne <nf...@si...> Date: Thu Sep 20 14:01:56 2012 +0200 Default value for _DATA20_HEAP_SIZE when using the IAR compiler on MSP430 platforms diff --git a/cpu/msp430/Makefile.msp430 b/cpu/msp430/Makefile.msp430 index 1dc8279..fbe5a19 100644 --- a/cpu/msp430/Makefile.msp430 +++ b/cpu/msp430/Makefile.msp430 @@ -81,10 +81,10 @@ endif ifndef IAR_DATA16_HEAP_SIZE IAR_DATA16_HEAP_SIZE=100 endif -LDFLAGSNO += -D_STACK_SIZE=$(IAR_STACK_SIZE) -D_DATA16_HEAP_SIZE=$(IAR_DATA16_HEAP_SIZE) -ifdef IAR_DATA20_HEAP_SIZE - LDFLAGSNO += -D_DATA20_HEAP_SIZE=$(IAR_DATA20_HEAP_SIZE) +ifndef IAR_DATA20_HEAP_SIZE + IAR_DATA20_HEAP_SIZE=0 endif +LDFLAGSNO += -D_STACK_SIZE=$(IAR_STACK_SIZE) -D_DATA16_HEAP_SIZE=$(IAR_DATA16_HEAP_SIZE) -D_DATA20_HEAP_SIZE=$(IAR_DATA20_HEAP_SIZE) CUSTOM_RULE_C_TO_O = 1 %.o: %.c ----------------------------------------------------------------------- Summary of changes: cpu/msp430/Makefile.msp430 | 6 +++--- 1 files changed, 3 insertions(+), 3 deletions(-) hooks/post-receive -- contiki |
From: Niclas F. <ni...@us...> - 2012-09-19 20:50:28
|
This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "contiki". The branch, master has been updated via 463094547531f37df9668826771a6a0d4eb792d9 (commit) via 919ddfbf09bb25300d9782fc3587b794e6824cd8 (commit) from 8053e2c353323212c1418a4571df1b818e429d84 (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- commit 463094547531f37df9668826771a6a0d4eb792d9 Author: Niclas Finne <nf...@si...> Date: Wed Sep 19 22:49:19 2012 +0200 Made the stack and heap size configurable when using the IAR compiler on the MSP430 platforms diff --git a/cpu/msp430/Makefile.msp430 b/cpu/msp430/Makefile.msp430 index 8e9ffd2..1dc8279 100644 --- a/cpu/msp430/Makefile.msp430 +++ b/cpu/msp430/Makefile.msp430 @@ -72,6 +72,20 @@ CFLAGSNO = --dlib_config "$(IAR_PATH)/LIB/DLIB/dl430xlfn.h" $(CFLAGSWERROR) # CFLAGSNO = --dlib_config $(IAR_PATH)/LIB/DLIB/dl430xlfn.h -Ohz --multiplier=32 --multiplier_location=4C0 --hw_workaround=CPU40 --core=430X $(CFLAGSWERROR) --data_model large --double=32 endif +LDFLAGSNO += -B -l contiki-$(TARGET).map -s __program_start +# Stack and heap size in hex +ifndef IAR_STACK_SIZE + IAR_STACK_SIZE=300 +endif +# Set this to a positive number (hex) to enable malloc/free with IAR compiler +ifndef IAR_DATA16_HEAP_SIZE + IAR_DATA16_HEAP_SIZE=100 +endif +LDFLAGSNO += -D_STACK_SIZE=$(IAR_STACK_SIZE) -D_DATA16_HEAP_SIZE=$(IAR_DATA16_HEAP_SIZE) +ifdef IAR_DATA20_HEAP_SIZE + LDFLAGSNO += -D_DATA20_HEAP_SIZE=$(IAR_DATA20_HEAP_SIZE) +endif + CUSTOM_RULE_C_TO_O = 1 %.o: %.c $(CC) $(CFLAGS) $< -o $@ diff --git a/platform/esb/Makefile.esb b/platform/esb/Makefile.esb index 9e82880..7ec4d44 100644 --- a/platform/esb/Makefile.esb +++ b/platform/esb/Makefile.esb @@ -54,7 +54,7 @@ MCU=msp430f149 include $(CONTIKI)/cpu/msp430/Makefile.msp430 ifdef IAR -LDFLAGSNO += -B -xm "$(IAR_PATH)/lib/dlib/dl430fn.r43" -f "$(IAR_PATH)/config/lnk430f149.xcl" -l contiki-$(TARGET).map -s __program_start -D_STACK_SIZE=80 -D_DATA16_HEAP_SIZE=80 -D_DATA20_HEAP_SIZE=80 +LDFLAGSNO += -xm "$(IAR_PATH)/lib/dlib/dl430fn.r43" -f "$(IAR_PATH)/config/lnk430f149.xcl" LDFLAGS += $(LDFLAGSNO) -Felf -yn endif # IAR diff --git a/platform/exp5438/Makefile.exp5438 b/platform/exp5438/Makefile.exp5438 index d1780dc..d22f18a 100644 --- a/platform/exp5438/Makefile.exp5438 +++ b/platform/exp5438/Makefile.exp5438 @@ -58,8 +58,7 @@ contiki-$(TARGET).a: ${addprefix $(OBJECTDIR)/,symbols.o} ifdef IAR -STACKSIZE=300 -LDFLAGSNO += -B -xm "$(IAR_PATH)/lib/dlib/dl430xsfn.r43" -f "$(IAR_PATH)/config/lnk430f5437.xcl" -l contiki-$(TARGET).map -s __program_start -D_STACK_SIZE=$(STACKSIZE) -D_DATA16_HEAP_SIZE=$(STACKSIZE) -D_DATA20_HEAP_SIZE=$(STACKSIZE) +LDFLAGSNO += -xm "$(IAR_PATH)/lib/dlib/dl430xsfn.r43" -f "$(IAR_PATH)/config/lnk430f5437.xcl" LDFLAGS += $(LDFLAGSNO) -Felf -yn endif diff --git a/platform/sky/Makefile.common b/platform/sky/Makefile.common index 53d6808..bfc32b0 100644 --- a/platform/sky/Makefile.common +++ b/platform/sky/Makefile.common @@ -29,7 +29,7 @@ contiki-$(TARGET).a: ${addprefix $(OBJECTDIR)/,symbols.o} ifdef IAR -LDFLAGSNO += -B -xm "$(IAR_PATH)/lib/dlib/dl430fn.r43" -f "$(IAR_PATH)/config/lnk430f1611.xcl" -l contiki-$(TARGET).map -s __program_start -D_STACK_SIZE=80 -D_DATA16_HEAP_SIZE=80 -D_DATA20_HEAP_SIZE=80 +LDFLAGSNO += -xm "$(IAR_PATH)/lib/dlib/dl430fn.r43" -f "$(IAR_PATH)/config/lnk430f1611.xcl" LDFLAGS += $(LDFLAGSNO) -Felf -yn endif # IAR diff --git a/platform/wismote/Makefile.wismote b/platform/wismote/Makefile.wismote index e24d9d0..71850bd 100644 --- a/platform/wismote/Makefile.wismote +++ b/platform/wismote/Makefile.wismote @@ -34,7 +34,7 @@ MCU=msp430f5437 include $(CONTIKI)/cpu/msp430/Makefile.msp430 ifdef IAR -LDFLAGSNO += -B -xm "$(IAR_PATH)/lib/dlib/dl430xsfn.r43" -f "$(IAR_PATH)/config/lnk430f5437.xcl" -l contiki-$(TARGET).map -s __program_start -D_STACK_SIZE=80 -D_DATA16_HEAP_SIZE=80 -D_DATA20_HEAP_SIZE=80 +LDFLAGSNO += -xm "$(IAR_PATH)/lib/dlib/dl430xsfn.r43" -f "$(IAR_PATH)/config/lnk430f5437.xcl" LDFLAGS += $(LDFLAGSNO) -Felf -yn endif diff --git a/platform/z1/Makefile.common b/platform/z1/Makefile.common index 6afab08..28f1f8f 100644 --- a/platform/z1/Makefile.common +++ b/platform/z1/Makefile.common @@ -42,7 +42,7 @@ include $(CONTIKI)/cpu/msp430/Makefile.msp430 # Add LDFLAGS after IAR_PATH is set ifdef IAR -LDFLAGSNO += -B -xm "$(IAR_PATH)/lib/dlib/dl430xsfn.r43" -f "$(IAR_PATH)/config/lnk430f2617.xcl" -l contiki-$(TARGET).map -s __program_start -D_STACK_SIZE=80 -D_DATA16_HEAP_SIZE=80 -D_DATA20_HEAP_SIZE=80 +LDFLAGSNO += -xm "$(IAR_PATH)/lib/dlib/dl430xsfn.r43" -f "$(IAR_PATH)/config/lnk430f2617.xcl" LDFLAGS += $(LDFLAGSNO) -Felf -yn endif commit 919ddfbf09bb25300d9782fc3587b794e6824cd8 Author: Niclas Finne <nf...@si...> Date: Wed Sep 19 22:47:48 2012 +0200 Added delay at startup to let things stabilize before writing to the uart diff --git a/platform/wismote/contiki-wismote-main.c b/platform/wismote/contiki-wismote-main.c index 6daec14..828a74f 100644 --- a/platform/wismote/contiki-wismote-main.c +++ b/platform/wismote/contiki-wismote-main.c @@ -203,12 +203,16 @@ main(int argc, char **argv) leds_on(LEDS_RED); + clock_wait(2); + uart1_init(115200); /* Must come before first printf */ #if WITH_UIP slip_arch_init(115200); #endif /* WITH_UIP */ + clock_wait(1); + leds_on(LEDS_GREEN); //ds2411_init(); ----------------------------------------------------------------------- Summary of changes: cpu/msp430/Makefile.msp430 | 14 ++++++++++++++ platform/esb/Makefile.esb | 2 +- platform/exp5438/Makefile.exp5438 | 3 +-- platform/sky/Makefile.common | 2 +- platform/wismote/Makefile.wismote | 2 +- platform/wismote/contiki-wismote-main.c | 4 ++++ platform/z1/Makefile.common | 2 +- 7 files changed, 23 insertions(+), 6 deletions(-) hooks/post-receive -- contiki |
From: Niclas F. <ni...@us...> - 2012-09-12 12:49:39
|
This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "contiki". The branch, master has been updated via 8053e2c353323212c1418a4571df1b818e429d84 (commit) from ee7af77ca994a1685462b5dddc524f804f5048e0 (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- commit 8053e2c353323212c1418a4571df1b818e429d84 Author: Niclas Finne <nf...@si...> Date: Wed Sep 12 14:46:19 2012 +0200 Workaround for an odd type inference problem associated with the IAR compiler. Patch by Vilhelm Jutvik. diff --git a/core/net/uip6.c b/core/net/uip6.c index 942e0df..021cbf8 100644 --- a/core/net/uip6.c +++ b/core/net/uip6.c @@ -508,7 +508,7 @@ remove_ext_hdr(void) if(uip_ext_len > 0) { PRINTF("Cutting ext-header before processing (extlen: %d, uiplen: %d)\n", uip_ext_len, uip_len); - if(uip_len - UIP_IPH_LEN - uip_ext_len < 0) { + if(uip_len < UIP_IPH_LEN + uip_ext_len) { PRINTF("ERROR: uip_len too short compared to ext len\n"); uip_ext_len = 0; uip_len = 0; ----------------------------------------------------------------------- Summary of changes: core/net/uip6.c | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-) hooks/post-receive -- contiki |
From: George O. <oik...@us...> - 2012-09-07 16:57:51
|
This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "contiki". The branch, master has been updated via ee7af77ca994a1685462b5dddc524f804f5048e0 (commit) via 9a63e8c027ba6912f2a2eb093c71b3e29b5d5269 (commit) via 780e62d7e8e5b0ef0802cf94db46bb612a245cd3 (commit) via 48d99f15c8b71dcd4359c7391b415b4266de02ed (commit) via c6ec22c4c867dce60b52cf625326bd671473404a (commit) via a0d29888469b4303cc13ed48bef006eeb29a93f1 (commit) via 666ff6ca55ede32fead7ae34bcc5f7979ad3589d (commit) via 44bcabe89c41329e4add03fd84e410dce83c6200 (commit) via 8699f7741d7d23397e6bdcf4af23dcec5755b7d7 (commit) from b43dad00b0d598c7ee9f974b4a820a8fe5082d2e (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- commit ee7af77ca994a1685462b5dddc524f804f5048e0 Author: George Oikonomou <g.o...@br...> Date: Fri Sep 7 11:12:31 2012 +0100 Reworked the cc2530 stack debugging facilities: - Moved to their own file (so we can later copy the entire thing over to cc2430) - Renamed the functions (for naming convention reasons) - The entire thing can be enabled/disabled - Added a couple more macros - Hooked into main() diff --git a/cpu/cc253x/Makefile.cc253x b/cpu/cc253x/Makefile.cc253x index ff499c7..fb7a718 100644 --- a/cpu/cc253x/Makefile.cc253x +++ b/cpu/cc253x/Makefile.cc253x @@ -101,7 +101,7 @@ CLEAN += symbols.c symbols.h CONTIKI_CPU_DIRS = . dev ### CPU-dependent source files -CONTIKI_SOURCEFILES += soc.c clock.c +CONTIKI_SOURCEFILES += soc.c clock.c stack.c CONTIKI_SOURCEFILES += uart0.c uart1.c uart-intr.c CONTIKI_SOURCEFILES += dma.c dma_intr.c CONTIKI_SOURCEFILES += cc2530-rf.c diff --git a/cpu/cc253x/soc.c b/cpu/cc253x/soc.c index 94b3935..d65bbac 100644 --- a/cpu/cc253x/soc.c +++ b/cpu/cc253x/soc.c @@ -51,34 +51,3 @@ soc_init() /* Enable Global Interrupt */ ENABLE_INTERRUPTS(); } - -#ifndef STACK_POISON -#define STACK_POISON 0xAA -#endif - -void -cc253x_stack_poison(void) -{ - __asm - mov r1, _SP -poison_loop: - inc r1 - mov @r1, #STACK_POISON - cjne r1, #0xFF, poison_loop - __endasm; -} - -uint8_t -cc253x_get_max_stack(void) -{ - __data uint8_t * sp = (__data uint8_t *) 0xff; - uint8_t free = 0; - - while(*sp-- == STACK_POISON) { - free++; - } - - return 0xff - free; -} - - diff --git a/cpu/cc253x/soc.h b/cpu/cc253x/soc.h index e4d4c85..bcf858b 100644 --- a/cpu/cc253x/soc.h +++ b/cpu/cc253x/soc.h @@ -61,7 +61,4 @@ void soc_init(); -void cc253x_stack_poison(void); -uint8_t cc253x_get_max_stack(void); - #endif /* __SOC_H__ */ diff --git a/cpu/cc253x/soc.c b/cpu/cc253x/stack.c similarity index 86% copy from cpu/cc253x/soc.c copy to cpu/cc253x/stack.c index 94b3935..d6daf25 100644 --- a/cpu/cc253x/soc.c +++ b/cpu/cc253x/stack.c @@ -31,33 +31,22 @@ /** * \file - * Init routine for the cc2530 SoC - * - * Bankable + * 8051 stack debugging facilities * * \author * George Oikonomou - <oik...@us...> + * Philippe Retornaz (EPFL) */ -#include "cc253x.h" -#include "8051def.h" -#include "sfr-bits.h" - -void -soc_init() -{ - /* Flash: Cache with Pre-fetch */ - FCTL = FCTL_CM0; - - /* Enable Global Interrupt */ - ENABLE_INTERRUPTS(); -} +#include "contiki.h" #ifndef STACK_POISON #define STACK_POISON 0xAA #endif -void -cc253x_stack_poison(void) +CC_AT_DATA uint8_t sp; + +void +stack_poison(void) { __asm mov r1, _SP @@ -69,7 +58,7 @@ poison_loop: } uint8_t -cc253x_get_max_stack(void) +stack_get_max(void) { __data uint8_t * sp = (__data uint8_t *) 0xff; uint8_t free = 0; @@ -80,5 +69,3 @@ cc253x_get_max_stack(void) return 0xff - free; } - - diff --git a/cpu/cc253x/soc.c b/cpu/cc253x/stack.h similarity index 73% copy from cpu/cc253x/soc.c copy to cpu/cc253x/stack.h index 94b3935..989875d 100644 --- a/cpu/cc253x/soc.c +++ b/cpu/cc253x/stack.h @@ -31,54 +31,39 @@ /** * \file - * Init routine for the cc2530 SoC - * - * Bankable + * Header file for 8051 stack debugging facilities * * \author * George Oikonomou - <oik...@us...> + * Philippe Retornaz (EPFL) */ -#include "cc253x.h" -#include "8051def.h" -#include "sfr-bits.h" - -void -soc_init() -{ - /* Flash: Cache with Pre-fetch */ - FCTL = FCTL_CM0; +#ifndef STACK_H_ +#define STACK_H_ - /* Enable Global Interrupt */ - ENABLE_INTERRUPTS(); -} - -#ifndef STACK_POISON -#define STACK_POISON 0xAA -#endif +#if STACK_CONF_DEBUGGING +extern CC_AT_DATA uint8_t sp; -void -cc253x_stack_poison(void) -{ - __asm - mov r1, _SP -poison_loop: - inc r1 - mov @r1, #STACK_POISON - cjne r1, #0xFF, poison_loop - __endasm; -} +#define stack_dump(f) do { \ + putstring(f); \ + sp = SP; \ + puthex(sp); \ + putchar('\n'); \ +} while(0) -uint8_t -cc253x_get_max_stack(void) -{ - __data uint8_t * sp = (__data uint8_t *) 0xff; - uint8_t free = 0; - - while(*sp-- == STACK_POISON) { - free++; - } - - return 0xff - free; -} +#define stack_max_sp_print(f) do { \ + putstring(f); \ + sp = SP; \ + puthex(stack_get_max()); \ + putchar('\n'); \ +} while(0) +void stack_poison(void); +uint8_t stack_get_max(void); +#else +#define stack_dump(...) +#define stack_max_sp_print(...) +#define stack_poison() +#define stack_get_max() +#endif +#endif /* STACK_H_ */ diff --git a/platform/cc2530dk/contiki-conf.h b/platform/cc2530dk/contiki-conf.h index 25eac38..a5e2406 100644 --- a/platform/cc2530dk/contiki-conf.h +++ b/platform/cc2530dk/contiki-conf.h @@ -20,6 +20,10 @@ #define CLOCK_CONF_STACK_FRIENDLY 1 #endif +#ifndef STACK_CONF_DEBUGGING +#define STACK_CONF_DEBUGGING 0 +#endif + /* Energest Module */ #ifndef ENERGEST_CONF_ON #define ENERGEST_CONF_ON 0 diff --git a/platform/cc2530dk/contiki-main.c b/platform/cc2530dk/contiki-main.c index 83a6480..8c31c97 100644 --- a/platform/cc2530dk/contiki-main.c +++ b/platform/cc2530dk/contiki-main.c @@ -1,5 +1,6 @@ #include "contiki.h" #include "soc.h" +#include "stack.h" #include "sys/clock.h" #include "sys/autostart.h" #include "dev/serial-line.h" @@ -146,6 +147,8 @@ main(void) CC_NON_BANKED soc_init(); rtimer_init(); + stack_poison(); + /* Init LEDs here */ leds_init(); leds_off(LEDS_ALL); commit 9a63e8c027ba6912f2a2eb093c71b3e29b5d5269 Author: Philippe Rétornaz <phi...@ep...> Date: Thu Aug 23 16:16:04 2012 +0200 cc253x: Add stack monitoring helpers diff --git a/cpu/cc253x/soc.c b/cpu/cc253x/soc.c index 36d9531..94b3935 100644 --- a/cpu/cc253x/soc.c +++ b/cpu/cc253x/soc.c @@ -52,3 +52,33 @@ soc_init() ENABLE_INTERRUPTS(); } +#ifndef STACK_POISON +#define STACK_POISON 0xAA +#endif + +void +cc253x_stack_poison(void) +{ + __asm + mov r1, _SP +poison_loop: + inc r1 + mov @r1, #STACK_POISON + cjne r1, #0xFF, poison_loop + __endasm; +} + +uint8_t +cc253x_get_max_stack(void) +{ + __data uint8_t * sp = (__data uint8_t *) 0xff; + uint8_t free = 0; + + while(*sp-- == STACK_POISON) { + free++; + } + + return 0xff - free; +} + + diff --git a/cpu/cc253x/soc.h b/cpu/cc253x/soc.h index bcf858b..e4d4c85 100644 --- a/cpu/cc253x/soc.h +++ b/cpu/cc253x/soc.h @@ -61,4 +61,7 @@ void soc_init(); +void cc253x_stack_poison(void); +uint8_t cc253x_get_max_stack(void); + #endif /* __SOC_H__ */ commit 780e62d7e8e5b0ef0802cf94db46bb612a245cd3 Author: Philippe Rétornaz <phi...@ep...> Date: Fri Aug 24 09:43:43 2012 +0200 cc253x: add putdec debug function diff --git a/platform/cc2530dk/debug.c b/platform/cc2530dk/debug.c index 29efccf..1773eff 100644 --- a/platform/cc2530dk/debug.c +++ b/platform/cc2530dk/debug.c @@ -40,3 +40,18 @@ putbin(uint8_t c) } } /*---------------------------------------------------------------------------*/ +void +putdec(uint8_t c) +{ + uint8_t div; + uint8_t hassent = 0; + for(div = 100; div > 0; div /= 10) { + uint8_t disp = c / div; + c %= div; + if((disp != 0) || (hassent) || (div == 1)) { + hassent = 1; + putchar('0'+disp); + } + } +} + diff --git a/platform/cc2530dk/debug.h b/platform/cc2530dk/debug.h index a3c5cb0..d72fb00 100644 --- a/platform/cc2530dk/debug.h +++ b/platform/cc2530dk/debug.h @@ -50,5 +50,6 @@ void putchar(char c); void putstring(char *s); void puthex(uint8_t c); void putbin(uint8_t c); +void putdec(uint8_t c); #endif /* __DEBUG_H__ */ commit 48d99f15c8b71dcd4359c7391b415b4266de02ed Author: Philippe Rétornaz <phi...@ep...> Date: Fri Aug 3 17:04:11 2012 +0200 cc253x: fix dma interrupt enable flag diff --git a/cpu/cc253x/dev/dma.c b/cpu/cc253x/dev/dma.c index 7b0b570..8d07e83 100644 --- a/cpu/cc253x/dev/dma.c +++ b/cpu/cc253x/dev/dma.c @@ -46,7 +46,7 @@ dma_init(void) DMA1CFGL = tmp_ptr; #endif - IEN1_DMAIE = 1; /* Enable DMA interrupts */ + DMAIE = 1; /* Enable DMA interrupts */ } /*---------------------------------------------------------------------------*/ /* @@ -62,7 +62,7 @@ dma_associate_process(struct process * p, uint8_t c) if(p) { dma_conf[c].inc_prio |= 8; /* Enable interrupt generation */ - IEN1_DMAIE = 1; /* Make sure DMA interrupts are acknowledged */ + DMAIE = 1; /* Make sure DMA interrupts are acknowledged */ } dma_callback[c] = p; } commit c6ec22c4c867dce60b52cf625326bd671473404a Author: George Oikonomou <g.o...@br...> Date: Wed Sep 5 16:00:23 2012 +0100 cc2530: Added a method to maximise stack depth This was oringinally contributed/reported/discussed/patched by Philippe Retornaz (EPFL) but it's implemented in a more configurable fashion here. diff --git a/cpu/cc253x/8051def.h b/cpu/cc253x/8051def.h index 72945ca..2e1d92f 100644 --- a/cpu/cc253x/8051def.h +++ b/cpu/cc253x/8051def.h @@ -56,6 +56,26 @@ #define CC_NON_BANKED #endif +/* + * Max Stack Depth manipulation. It is possible to get up to 247 bytes + * allocated for the stack if: + * - You set this to 1 and + * - You have a patched toolchain and + * - You don't use __bit variables + * - You do not link libraries using BIT registers (e.g. printf_large) + * Enabling this will mean ISRs will NOT push bits (#pragma exclude bits) so + * make sure you know what you're doing + * + * More information on the wiki + */ +#define CC_CONF_OPTIMIZE_STACK_SIZE 0 + +#if CC_CONF_OPTIMIZE_STACK_SIZE +#define CC_AT_DATA +#else +#define CC_AT_DATA __data +#endif + /* Generic types. */ typedef unsigned short uip_stats_t; diff --git a/cpu/cc253x/dev/cc2530-rf.c b/cpu/cc253x/dev/cc2530-rf.c index b590b7f..5c16d09 100644 --- a/cpu/cc253x/dev/cc2530-rf.c +++ b/cpu/cc253x/dev/cc2530-rf.c @@ -107,7 +107,7 @@ static const uint8_t magic[] = { 0x53, 0x6E, 0x69, 0x66 }; /* Snif */ #define CC2530_RF_AUTOACK 1 #endif /*---------------------------------------------------------------------------*/ -static uint8_t __data rf_flags; +static uint8_t CC_AT_DATA rf_flags; static int on(void); /* prepare() needs our prototype */ static int off(void); /* transmit() needs our prototype */ diff --git a/cpu/cc253x/dev/clock.c b/cpu/cc253x/dev/clock.c index a2d4398..e91fcb9 100644 --- a/cpu/cc253x/dev/clock.c +++ b/cpu/cc253x/dev/clock.c @@ -55,8 +55,8 @@ volatile uint8_t sleep_flag; /* Do NOT remove the absolute address and do NOT remove the initialiser here */ __xdata __at(0x0000) static unsigned long timer_value = 0; -static volatile __data clock_time_t count = 0; /* Uptime in ticks */ -static volatile __data clock_time_t seconds = 0; /* Uptime in secs */ +static volatile CC_AT_DATA clock_time_t count = 0; /* Uptime in ticks */ +static volatile CC_AT_DATA clock_time_t seconds = 0; /* Uptime in secs */ /*---------------------------------------------------------------------------*/ /** * Each iteration is ~1.0xy usec, so this function delays for roughly len usec @@ -132,6 +132,11 @@ clock_init(void) STIE = 1; /* IEN0.STIE interrupt enable */ } /*---------------------------------------------------------------------------*/ +/* avoid referencing bits, we don't call code which use them */ +#pragma save +#if CC_CONF_OPTIMIZE_STACK_SIZE +#pragma exclude bits +#endif void clock_isr(void) __interrupt(ST_VECTOR) { @@ -177,4 +182,5 @@ clock_isr(void) __interrupt(ST_VECTOR) ENERGEST_OFF(ENERGEST_TYPE_IRQ); ENABLE_INTERRUPTS(); } +#pragma restore /*---------------------------------------------------------------------------*/ diff --git a/cpu/cc253x/dev/dma_intr.c b/cpu/cc253x/dev/dma_intr.c index 9f23362..222a9f3 100644 --- a/cpu/cc253x/dev/dma_intr.c +++ b/cpu/cc253x/dev/dma_intr.c @@ -32,6 +32,11 @@ extern void spi_rx_dma_callback(void); * * if callback defined a poll is made to that process */ +/* Avoid referencing bits, we don't call code which use them */ +#pragma save +#if CC_CONF_OPTIMIZE_STACK_SIZE +#pragma exclude bits +#endif void dma_isr(void) __interrupt (DMA_VECTOR) { @@ -65,4 +70,5 @@ dma_isr(void) __interrupt (DMA_VECTOR) #endif EA = 1; } +#pragma restore /*---------------------------------------------------------------------------*/ diff --git a/cpu/cc253x/dev/uart-intr.c b/cpu/cc253x/dev/uart-intr.c index b70acfb..ebe1814 100644 --- a/cpu/cc253x/dev/uart-intr.c +++ b/cpu/cc253x/dev/uart-intr.c @@ -33,6 +33,11 @@ uart0_set_input(int (*input)(unsigned char c)) } /*---------------------------------------------------------------------------*/ #if UART0_CONF_WITH_INPUT +/* avoid referencing bits since we're not using them */ +#pragma save +#if CC_CONF_OPTIMIZE_STACK_SIZE +#pragma exclude bits +#endif void uart0_rx_isr(void) __interrupt (URX0_VECTOR) { @@ -44,6 +49,7 @@ uart0_rx_isr(void) __interrupt (URX0_VECTOR) } ENERGEST_OFF(ENERGEST_TYPE_IRQ); } +#pragma restore #endif #endif /* UART0_ENABLE */ #if UART1_ENABLE @@ -55,6 +61,11 @@ uart1_set_input(int (*input)(unsigned char c)) } /*---------------------------------------------------------------------------*/ #if UART_ONE_CONF_WITH_INPUT +/* avoid referencing bits since we're not using them */ +#pragma save +#if CC_CONF_OPTIMIZE_STACK_SIZE +#pragma exclude bits +#endif void uart1_rx_isr(void) __interrupt (URX1_VECTOR) { @@ -65,6 +76,7 @@ uart1_rx_isr(void) __interrupt (URX1_VECTOR) } ENERGEST_OFF(ENERGEST_TYPE_IRQ); } +#pragma restore /*---------------------------------------------------------------------------*/ #endif /* UART_ONE_CONF_WITH_INPUT */ #endif /* UART1_ENABLE */ diff --git a/cpu/cc253x/rtimer-arch.c b/cpu/cc253x/rtimer-arch.c index 01512a7..6bf4405 100644 --- a/cpu/cc253x/rtimer-arch.c +++ b/cpu/cc253x/rtimer-arch.c @@ -96,6 +96,11 @@ rtimer_arch_schedule(rtimer_clock_t t) T1CCTL1 |= T1CCTL_IM; } /*---------------------------------------------------------------------------*/ +/* avoid referencing bits, we don't call code which use them */ +#pragma save +#if CC_CONF_OPTIMIZE_STACK_SIZE +#pragma exclude bits +#endif void rtimer_isr(void) __interrupt(T1_VECTOR) { @@ -111,3 +116,4 @@ rtimer_isr(void) __interrupt(T1_VECTOR) ENERGEST_OFF(ENERGEST_TYPE_IRQ); T1IE = 1; /* Acknowledge Timer 1 Interrupts */ } +#pragma restore diff --git a/platform/cc2530dk/contiki-main.c b/platform/cc2530dk/contiki-main.c index b102382..83a6480 100644 --- a/platform/cc2530dk/contiki-main.c +++ b/platform/cc2530dk/contiki-main.c @@ -44,6 +44,7 @@ extern volatile uint8_t sleep_flag; #endif /*---------------------------------------------------------------------------*/ extern rimeaddr_t rimeaddr_node_addr; +static CC_AT_DATA uint16_t len; /*---------------------------------------------------------------------------*/ #if ENERGEST_CONF_ON static unsigned long irq_energest = 0; @@ -260,7 +261,6 @@ main(void) CC_NON_BANKED while(1) { uint8_t r; - static uint16_t len; do { /* Reset watchdog and handle polls and events */ watchdog_periodic(); diff --git a/platform/cc2530dk/dev/button-sensor.c b/platform/cc2530dk/dev/button-sensor.c index 7ab7a3d..c1a6f59 100644 --- a/platform/cc2530dk/dev/button-sensor.c +++ b/platform/cc2530dk/dev/button-sensor.c @@ -36,7 +36,7 @@ #include "dev/button-sensor.h" #include "dev/watchdog.h" /*---------------------------------------------------------------------------*/ -static __data struct timer debouncetimer; +static CC_AT_DATA struct timer debouncetimer; /*---------------------------------------------------------------------------*/ /* Button 1 - SmartRF and cc2531 USB Dongle */ /*---------------------------------------------------------------------------*/ @@ -133,6 +133,11 @@ int configure_b2(int type, int value) /*---------------------------------------------------------------------------*/ /* ISRs */ /*---------------------------------------------------------------------------*/ +/* avoid referencing bits, we don't call code which use them */ +#pragma save +#if CC_CONF_OPTIMIZE_STACK_SIZE +#pragma exclude bits +#endif #if MODEL_CC2531 void port_1_isr(void) __interrupt(P1INT_VECTOR) @@ -187,6 +192,7 @@ port_0_isr(void) __interrupt(P0INT_VECTOR) EA = 1; } #endif +#pragma restore /*---------------------------------------------------------------------------*/ SENSORS_SENSOR(button_1_sensor, BUTTON_SENSOR, value_b1, configure_b1, status_b1); #if MODEL_CC2531 commit a0d29888469b4303cc13ed48bef006eeb29a93f1 Author: Philippe Rétornaz <phi...@ep...> Date: Wed Aug 29 18:43:16 2012 +0200 cc253x: Don't force __data usage SDCC optimize "r" and put it in a register. Don't force len to be in __data. diff --git a/platform/cc2530dk/contiki-main.c b/platform/cc2530dk/contiki-main.c index a8154e1..b102382 100644 --- a/platform/cc2530dk/contiki-main.c +++ b/platform/cc2530dk/contiki-main.c @@ -44,8 +44,6 @@ extern volatile uint8_t sleep_flag; #endif /*---------------------------------------------------------------------------*/ extern rimeaddr_t rimeaddr_node_addr; -static __data int r; -static __data int len; /*---------------------------------------------------------------------------*/ #if ENERGEST_CONF_ON static unsigned long irq_energest = 0; @@ -261,6 +259,8 @@ main(void) CC_NON_BANKED fade(LEDS_YELLOW); while(1) { + uint8_t r; + static uint16_t len; do { /* Reset watchdog and handle polls and events */ watchdog_periodic(); commit 666ff6ca55ede32fead7ae34bcc5f7979ad3589d Author: Philippe Rétornaz <phi...@ep...> Date: Wed Aug 29 17:50:23 2012 +0200 cc253x: use a uint8_t for sleep_flag __bit variables must be located after the 0x20 address This force the stack to start after 0x20, thus decrease the stack size by a considerable amount. diff --git a/cpu/cc253x/dev/clock.c b/cpu/cc253x/dev/clock.c index 08a32f0..a2d4398 100644 --- a/cpu/cc253x/dev/clock.c +++ b/cpu/cc253x/dev/clock.c @@ -48,7 +48,7 @@ #define TICK_VAL (32768/128) /* 256 */ /*---------------------------------------------------------------------------*/ #if CLOCK_CONF_STACK_FRIENDLY -volatile __bit sleep_flag; +volatile uint8_t sleep_flag; #else #endif /*---------------------------------------------------------------------------*/ diff --git a/platform/cc2530dk/contiki-main.c b/platform/cc2530dk/contiki-main.c index 512472b..a8154e1 100644 --- a/platform/cc2530dk/contiki-main.c +++ b/platform/cc2530dk/contiki-main.c @@ -40,7 +40,7 @@ PROCESS_NAME(viztool_process); #endif /*---------------------------------------------------------------------------*/ #if CLOCK_CONF_STACK_FRIENDLY -extern volatile __bit sleep_flag; +extern volatile uint8_t sleep_flag; #endif /*---------------------------------------------------------------------------*/ extern rimeaddr_t rimeaddr_node_addr; commit 44bcabe89c41329e4add03fd84e410dce83c6200 Author: Philippe Rétornaz <phi...@ep...> Date: Wed Aug 29 13:51:49 2012 +0200 cc253x: Change CFLAGS This add -fomit-frame-pointer by default, it decrease sliglty the stack usage when several function call are nested. On some specific case 30 bytes could be saved on the stack. diff --git a/cpu/cc253x/Makefile.cc253x b/cpu/cc253x/Makefile.cc253x index 800574f..ff499c7 100644 --- a/cpu/cc253x/Makefile.cc253x +++ b/cpu/cc253x/Makefile.cc253x @@ -16,6 +16,7 @@ SEGMENT_RULES = $(OBJECTDIR)/segment.rules CFLAGS += --model-$(MEMORY_MODEL) --stack-auto --std-c99 CFLAGS += -DCC2530_LAST_FLASH_BANK=$(HIGH_FLASH_BANK) +CFLAGS += --fomit-frame-pointer LDFLAGS += --model-$(MEMORY_MODEL) --stack-auto --out-fmt-ihx LDFLAGS += --xram-loc 0x0000 --xram-size 0x1F00 commit 8699f7741d7d23397e6bdcf4af23dcec5755b7d7 Author: George Oikonomou <g.o...@br...> Date: Mon Jul 16 12:55:39 2012 +0100 Fixed typos and a stray printf. Adjusted comments diff --git a/cpu/cc253x/dev/dma.c b/cpu/cc253x/dev/dma.c index 992c3dd..7b0b570 100644 --- a/cpu/cc253x/dev/dma.c +++ b/cpu/cc253x/dev/dma.c @@ -1,6 +1,7 @@ /** * \file - * Driver for the cc2430 DMA controller. Can be assigned to any bank + * Driver for the cc2530 DMA controller. Derived from the cc2430 + * equivalent * * \author * Original: Martti Huttunen <ma...@se...> diff --git a/examples/cc2530dk/border-router/border-router.c b/examples/cc2530dk/border-router/border-router.c index 3b6b54e..6eed3de 100644 --- a/examples/cc2530dk/border-router/border-router.c +++ b/examples/cc2530dk/border-router/border-router.c @@ -118,7 +118,7 @@ PROCESS_THREAD(border_router_process, ev, data) } cc2530_rf_channel_get(); /* We have created a new DODAG when we reach here */ - printf("On Channel %u\n", cc2530_rf_channel_get()); + PRINTF("On Channel %u\n", cc2530_rf_channel_get()); print_local_addresses(); diff --git a/platform/cc2530dk/dev/button-sensor.c b/platform/cc2530dk/dev/button-sensor.c index 7f40747..7ab7a3d 100644 --- a/platform/cc2530dk/dev/button-sensor.c +++ b/platform/cc2530dk/dev/button-sensor.c @@ -38,7 +38,7 @@ /*---------------------------------------------------------------------------*/ static __data struct timer debouncetimer; /*---------------------------------------------------------------------------*/ -/* Button 1 - SmartRT and cc2531 USb Dongle */ +/* Button 1 - SmartRF and cc2531 USB Dongle */ /*---------------------------------------------------------------------------*/ static int value_b1(int type) ----------------------------------------------------------------------- Summary of changes: cpu/cc253x/8051def.h | 20 +++++++++ cpu/cc253x/Makefile.cc253x | 3 +- cpu/cc253x/dev/cc2530-rf.c | 2 +- cpu/cc253x/dev/clock.c | 12 ++++- cpu/cc253x/dev/dma.c | 7 ++- cpu/cc253x/dev/dma_intr.c | 6 +++ cpu/cc253x/dev/uart-intr.c | 12 +++++ cpu/cc253x/rtimer-arch.c | 6 +++ cpu/cc253x/soc.c | 1 - cpu/cc253x/{soc.c => stack.c} | 41 +++++++++++++----- .../dev/smartrf-sensors.c => cpu/cc253x/stack.h | 44 ++++++++++++------- examples/cc2530dk/border-router/border-router.c | 2 +- platform/cc2530dk/contiki-conf.h | 4 ++ platform/cc2530dk/contiki-main.c | 9 +++- platform/cc2530dk/debug.c | 15 +++++++ platform/cc2530dk/debug.h | 1 + platform/cc2530dk/dev/button-sensor.c | 10 ++++- 17 files changed, 152 insertions(+), 43 deletions(-) copy cpu/cc253x/{soc.c => stack.c} (78%) copy platform/cc2530dk/dev/smartrf-sensors.c => cpu/cc253x/stack.h (74%) hooks/post-receive -- contiki |
From: Ivan D. <ide...@us...> - 2012-09-04 17:12:52
|
This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "contiki". The branch, master has been updated via b43dad00b0d598c7ee9f974b4a820a8fe5082d2e (commit) from 2e72ec3594fef4557742dd77eddd1e95ec483967 (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- commit b43dad00b0d598c7ee9f974b4a820a8fe5082d2e Author: Ivan Delamer <de...@in...> Date: Tue Sep 4 11:12:18 2012 -0600 Cleaned up RF230BB, and refactored FRAME_RETRIES and CSMA_RETRIES #defines. diff --git a/cpu/avr/radio/rf230bb/hal.h b/cpu/avr/radio/rf230bb/hal.h index 2044575..4b47534 100644 --- a/cpu/avr/radio/rf230bb/hal.h +++ b/cpu/avr/radio/rf230bb/hal.h @@ -10,6 +10,7 @@ * Kevin Brown kb...@uc... * Nate Bohlmann na...@el... * David Kopf da...@em... + * Ivan Delamer de...@ie... * * All rights reserved. * @@ -60,10 +61,6 @@ #include "contiki-conf.h" /*============================ MACROS ========================================*/ -// TEST CODE -#define TRIG1 DDRB |= 0x04, PINB |= 0x04 -#define TRIG2 DDRD |= 0x80, PIND |= 0x80 - /** \name This is the list of pin configurations needed for a given platform. * \brief Change these values to port to other platforms. * \{ @@ -97,10 +94,6 @@ # define IRQPIN (0x04) # define SLPTRPORT B # define SLPTRPIN (0x04) -# define USART 1 -# define USARTVECT USART1_RX_vect -# define TICKTIMER 3 -# define HAS_SPARE_TIMER #elif PLATFORM_TYPE == ZIGBIT /* 1281V Zigbit */ @@ -116,12 +109,6 @@ # define IRQPIN (0x05) # define SLPTRPORT B # define SLPTRPIN (0x04) -# define TXCWPORT B -# define TXCWPIN (0x07) -# define USART 1 -# define USARTVECT USART1_RX_vect -//# define TICKTIMER 3 -//# define HAS_SPARE_TIMER // Not used #elif PLATFORM_TYPE == RAVEN_D @@ -138,13 +125,6 @@ # define IRQPIN (0x06) # define SLPTRPORT B # define SLPTRPIN (0x03) -# define TXCWPORT B -# define TXCWPIN (0x00) -# define USART 1 -# define USARTVECT USART1_RX_vect -# define TICKTIMER 3 -# define HAS_CW_MODE -# define HAS_SPARE_TIMER #elif PLATFORM_TYPE == RAVENUSB_C /* 1287USB raven */ @@ -160,23 +140,11 @@ # define IRQPIN (0x04) # define SLPTRPORT B # define SLPTRPIN (0x04) -# define TXCWPORT B -# define TXCWPIN (0x07) -# define USART 1 -# define USARTVECT USART1_RX_vect -# define TICKTIMER 3 -# define HAS_CW_MODE -# define HAS_SPARE_TIMER #elif PLATFORM_TYPE == ATMEGA128RFA1 /* ATmega1281 with internal AT86RF231 radio */ # define SLPTRPORT TRXPR # define SLPTRPIN 1 -# define USART 1 -# define USARTVECT USART1_RX_vect -# define TICKTIMER 3 -# define HAS_CW_MODE -# define HAS_SPARE_TIMER #elif CONTIKI_TARGET_MULLE /* mulle 5.2 (TODO: move to platform specific) */ @@ -194,7 +162,6 @@ # define IRQPIN 3 # define SLPTRPORT 0 # define SLPTRPIN 7 -# define HAS_SPARE_TIMER #elif PLATFORM_TYPE == IRIS /* 1281 IRIS */ @@ -210,12 +177,6 @@ # define IRQPIN (0x04) # define SLPTRPORT B # define SLPTRPIN (0x07) -//# define TXCWPORT B -//# define TXCWPIN (0x07) -# define USART 1 -# define USARTVECT USART1_RX_vect -//# define TICKTIMER 3 -//# define HAS_SPARE_TIMER // Not used #else #error "PLATFORM_TYPE undefined in hal.h" @@ -252,63 +213,17 @@ */ #if defined(__AVR__) #define CAT(x, y) x##y -#define CAT2(x, y, z) x##y##z #define DDR(x) CAT(DDR, x) #define PORT(x) CAT(PORT, x) #define PIN(x) CAT(PIN, x) -#define UCSR(num, let) CAT2(UCSR,num,let) -#define RXEN(x) CAT(RXEN,x) -#define TXEN(x) CAT(TXEN,x) -#define TXC(x) CAT(TXC,x) -#define RXC(x) CAT(RXC,x) -#define RXCIE(x) CAT(RXCIE,x) -#define UCSZ(x,y) CAT2(UCSZ,x,y) -#define UBRR(x,y) CAT2(UBRR,x,y) -#define UDRE(x) CAT(UDRE,x) -#define UDRIE(x) CAT(UDRIE,x) -#define UDR(x) CAT(UDR,x) -#define TCNT(x) CAT(TCNT,x) -#define TIMSK(x) CAT(TIMSK,x) -#define TCCR(x,y) CAT2(TCCR,x,y) -#define COM(x,y) CAT2(COM,x,y) -#define OCR(x,y) CAT2(OCR,x,y) -#define CS(x,y) CAT2(CS,x,y) -#define WGM(x,y) CAT2(WGM,x,y) -#define OCIE(x,y) CAT2(OCIE,x,y) -#define COMPVECT(x) CAT2(TIMER,x,_COMPA_vect) -#define UDREVECT(x) CAT2(USART,x,_UDRE_vect) -#define RXVECT(x) CAT2(USART,x,_RX_vect) #endif /* TODO: Move to CPU specific */ #if defined(CONTIKI_TARGET_MULLE) #define CAT(x, y) x##y.BYTE -#define CAT2(x, y, z) x##y##z.BYTE #define DDR(x) CAT(PD, x) #define PORT(x) CAT(P, x) #define PIN(x) CAT(P, x) -#define UCSR(num, let) CAT2(UCSR,num,let) -#define RXEN(x) CAT(RXEN,x) -#define TXEN(x) CAT(TXEN,x) -#define TXC(x) CAT(TXC,x) -#define RXC(x) CAT(RXC,x) -#define RXCIE(x) CAT(RXCIE,x) -#define UCSZ(x,y) CAT2(UCSZ,x,y) -#define UBRR(x,y) CAT2(UBRR,x,y) -#define UDRE(x) CAT(UDRE,x) -#define UDRIE(x) CAT(UDRIE,x) -#define UDR(x) CAT(UDR,x) -#define TCNT(x) CAT(TCNT,x) -#define TIMSK(x) CAT(TIMSK,x) -#define TCCR(x,y) CAT2(TCCR,x,y) -#define COM(x,y) CAT2(COM,x,y) -#define OCR(x,y) CAT2(OCR,x,y) -#define CS(x,y) CAT2(CS,x,y) -#define WGM(x,y) CAT2(WGM,x,y) -#define OCIE(x,y) CAT2(OCIE,x,y) -#define COMPVECT(x) CAT2(TIMER,x,_COMPA_vect) -#define UDREVECT(x) CAT2(USART,x,_UDRE_vect) -#define RXVECT(x) CAT2(USART,x,_RX_vect) #endif /** \} */ @@ -325,7 +240,6 @@ #define hal_set_rst_high( ) ( TRXPR |= ( 1 << TRXRST ) ) /**< This macro pulls the RST pin high. */ #define hal_set_slptr_high( ) ( TRXPR |= ( 1 << SLPTR ) ) /**< This macro pulls the SLP_TR pin high. */ #define hal_set_slptr_low( ) ( TRXPR &= ~( 1 << SLPTR ) ) /**< This macro pulls the SLP_TR pin low. */ -//#define hal_get_slptr( ) ( ( TRXPR & ( 1 << SLPTR ) ) >> SLPTR ) /**< Read current state of the SLP_TR pin (High/Low). */ #define hal_get_slptr( ) ( TRXPR & ( 1 << SLPTR ) ) /**< Read current state of the SLP_TR pin (High/Low). */ #else @@ -335,7 +249,6 @@ #define PIN_SLP_TR PIN( SLPTRPORT ) /**< Pin (Read Access) where SLP_TR is connected. */ #define hal_set_slptr_high( ) ( PORT_SLP_TR |= ( 1 << SLP_TR ) ) /**< This macro pulls the SLP_TR pin high. */ #define hal_set_slptr_low( ) ( PORT_SLP_TR &= ~( 1 << SLP_TR ) ) /**< This macro pulls the SLP_TR pin low. */ -//#define hal_get_slptr( ) ( ( PIN_SLP_TR & ( 1 << SLP_TR ) ) >> SLP_TR ) /**< Read current state of the SLP_TR pin (High/Low). */ #define hal_get_slptr( ) ( PIN_SLP_TR & ( 1 << SLP_TR ) ) /**< Read current state of the SLP_TR pin (High/Low). */ #define RST RSTPIN /**< Pin number that corresponds to the RST pin. */ #define DDR_RST DDR( RSTPORT ) /**< Data Direction Register that corresponds to the port where RST is */ @@ -370,42 +283,7 @@ #define HAL_SS_HIGH( ) (HAL_PORT_SS |= ( 1 << HAL_SS_PIN )) /**< MACRO for pulling SS high. */ #define HAL_SS_LOW( ) (HAL_PORT_SS &= ~( 1 << HAL_SS_PIN )) /**< MACRO for pulling SS low. */ -/** \brief Macros defined for HAL_TIMER1. - * - * These macros are used to define the correct setupt of the AVR's Timer1, and - * to ensure that the hal_get_system_time function returns the system time in - * symbols (16 us ticks). - */ - #if defined(__AVR__) -#if ( F_CPU == 16000000UL ) - #define HAL_TCCR1B_CONFIG ( ( 1 << ICES1 ) | ( 1 << CS12 ) ) - #define HAL_US_PER_SYMBOL ( 1 ) - #define HAL_SYMBOL_MASK ( 0xFFFFffff ) -#elif ( F_CPU == 0x800000UL ) - #define HAL_TCCR1B_CONFIG ( ( 1 << ICES1 ) | ( 1 << CS11 ) | ( 1 << CS10 ) ) - #define HAL_US_PER_SYMBOL ( 2 ) - #define HAL_SYMBOL_MASK ( 0x7FFFffff ) -#elif ( F_CPU == 8000000UL ) - #define HAL_TCCR1B_CONFIG ( ( 1 << ICES1 ) | ( 1 << CS11 ) | ( 1 << CS10 ) ) - #define HAL_US_PER_SYMBOL ( 2 ) - #define HAL_SYMBOL_MASK ( 0x7FFFffff ) -//#elif ( F_CPU == 7953408UL ) -#elif ( F_CPU == 7954432UL ) - #define HAL_TCCR1B_CONFIG ( ( 1 << ICES1 ) | ( 1 << CS11 ) | ( 1 << CS10 ) ) - #define HAL_US_PER_SYMBOL ( 2 ) - #define HAL_SYMBOL_MASK ( 0x7FFFffff ) -#elif ( F_CPU == 4000000UL ) - #define HAL_TCCR1B_CONFIG ( ( 1 << ICES1 ) | ( 1 << CS11 ) | ( 1 << CS10 ) ) - #define HAL_US_PER_SYMBOL ( 1 ) - #define HAL_SYMBOL_MASK ( 0xFFFFffff ) -#elif ( F_CPU == 1000000UL ) - #define HAL_TCCR1B_CONFIG ( ( 1 << ICES1 ) | ( 1 << CS11 ) ) - #define HAL_US_PER_SYMBOL ( 2 ) - #define HAL_SYMBOL_MASK ( 0x7FFFffff ) -#else - #error "Clock speed not supported." -#endif #if PLATFORM_TYPE == ZIGBIT // IRQ E5 for Zigbit example @@ -485,32 +363,10 @@ typedef struct{ bool crc; /**< Flag - did CRC pass for received frame? */ } hal_rx_frame_t; -/** RX_START event handler callback type. Is called with timestamp in IEEE 802.15.4 symbols and frame length. See hal_set_rx_start_event_handler(). */ -typedef void (*hal_rx_start_isr_event_handler_t)(uint32_t const isr_timestamp, uint8_t const frame_length); - -/** RRX_END event handler callback type. Is called with timestamp in IEEE 802.15.4 symbols and frame length. See hal_set_trx_end_event_handler(). */ -typedef void (*hal_trx_end_isr_event_handler_t)(uint32_t const isr_timestamp); - -typedef void (*rx_callback_t) (uint16_t data); /*============================ PROTOTYPES ====================================*/ void hal_init( void ); -void hal_reset_flags( void ); -uint8_t hal_get_bat_low_flag( void ); -void hal_clear_bat_low_flag( void ); - -hal_trx_end_isr_event_handler_t hal_get_trx_end_event_handler( void ); -void hal_set_trx_end_event_handler( hal_trx_end_isr_event_handler_t trx_end_callback_handle ); -void hal_clear_trx_end_event_handler( void ); - -hal_rx_start_isr_event_handler_t hal_get_rx_start_event_handler( void ); -void hal_set_rx_start_event_handler( hal_rx_start_isr_event_handler_t rx_start_callback_handle ); -void hal_clear_rx_start_event_handler( void ); - -uint8_t hal_get_pll_lock_flag( void ); -void hal_clear_pll_lock_flag( void ); - /* Hack for atmega128rfa1 with integrated radio. Access registers directly, not through SPI */ #if defined(__AVR_ATmega128RFA1__) //#define hal_register_read(address) _SFR_MEM8((uint16_t)address) @@ -534,8 +390,6 @@ void hal_subregister_write( uint8_t address, uint8_t mask, uint8_t position, -//void hal_frame_read(hal_rx_frame_t *rx_frame, rx_callback_t rx_callback); -/* For speed RF230BB does not use a callback */ void hal_frame_read(hal_rx_frame_t *rx_frame); void hal_frame_write( uint8_t *write_buffer, uint8_t length ); void hal_sram_read( uint8_t address, uint8_t length, uint8_t *data ); diff --git a/cpu/avr/radio/rf230bb/halbb.c b/cpu/avr/radio/rf230bb/halbb.c index 4b31fd9..53deb1c 100644 --- a/cpu/avr/radio/rf230bb/halbb.c +++ b/cpu/avr/radio/rf230bb/halbb.c @@ -10,6 +10,7 @@ * Kevin Brown kb...@uc... * Nate Bohlmann na...@el... * David Kopf da...@em... + * Ivan Delamer de...@ie... * * All rights reserved. * @@ -80,66 +81,18 @@ extern uint8_t debugflowsize,debugflow[DEBUGFLOWSIZE]; #endif /*============================ VARIABLES =====================================*/ -/** \brief This is a file internal variable that contains the 16 MSB of the - * system time. - * - * The system time (32-bit) is the current time in microseconds. For the - * AVR microcontroller implementation this is solved by using a 16-bit - * timer (Timer1) with a clock frequency of 1MHz. The hal_system_time is - * incremented when the 16-bit timer overflows, representing the 16 MSB. - * The timer value it self (TCNT1) is then the 16 LSB. - * - * \see hal_get_system_time - */ -static uint16_t hal_system_time = 0; -volatile extern signed char rf230_last_rssi; -//static uint8_t volatile hal_bat_low_flag; -//static uint8_t volatile hal_pll_lock_flag; +volatile extern signed char rf230_last_rssi; /*============================ CALLBACKS =====================================*/ -/** \brief This function is called when a rx_start interrupt is signaled. - * - * If this function pointer is set to something else than NULL, it will - * be called when a RX_START event is signaled. The function takes two - * parameters: timestamp in IEEE 802.15.4 symbols (16 us resolution) and - * frame length. The event handler will be called in the interrupt domain, - * so the function must be kept short and not be blocking! Otherwise the - * system performance will be greatly degraded. - * - * \see hal_set_rx_start_event_handler - */ -//static hal_rx_start_isr_event_handler_t rx_start_callback; - -/** \brief This function is called when a trx_end interrupt is signaled. - * - * If this function pointer is set to something else than NULL, it will - * be called when a TRX_END event is signaled. The function takes one - * parameter: timestamp in IEEE 802.15.4 symbols (16 us resolution). - * The event handler will be called in the interrupt domain, - * so the function must not block! - * - * \see hal_set_trx_end_event_handler - */ -//static hal_trx_end_isr_event_handler_t trx_end_callback; /*============================ IMPLEMENTATION ================================*/ #if defined(__AVR_ATmega128RFA1__) -//#include <avr/io.h> -#include <avr/interrupt.h> + /* AVR1281 with internal RF231 radio */ -#define HAL_SPI_TRANSFER_OPEN() -//#define HAL_SPI_TRANSFER_WRITE(to_write) (SPDR = (to_write)) -#define HAL_SPI_TRANSFER_WAIT() -#define HAL_SPI_TRANSFER_READ() (SPDR) -#define HAL_SPI_TRANSFER_CLOSE() -#if 0 -#define HAL_SPI_TRANSFER(to_write) ( \ - HAL_SPI_TRANSFER_WRITE(to_write), \ - HAL_SPI_TRANSFER_WAIT(), \ - HAL_SPI_TRANSFER_READ() ) -#endif +#include <avr/interrupt.h> + #elif defined(__AVR__) /* * AVR with hardware SPI tranfers (TODO: move to hw spi hal for avr cpu) @@ -206,30 +159,22 @@ inline uint8_t spiWrite(uint8_t byte) /** \brief This function initializes the Hardware Abstraction Layer. */ #if defined(__AVR_ATmega128RFA1__) -//#define HAL_RF230_ISR() ISR(RADIO_VECT) -#define HAL_TIME_ISR() ISR(TIMER1_OVF_vect) -#define HAL_TICK_UPCNT() (TCNT1) + void hal_init(void) { /*Reset variables used in file.*/ - hal_system_time = 0; - // TCCR1B = HAL_TCCR1B_CONFIG; /* Set clock prescaler */ - // TIFR1 |= (1 << ICF1); /* Clear Input Capture Flag. */ - // HAL_ENABLE_OVERFLOW_INTERRUPT(); /* Enable Timer1 overflow interrupt. */ - //hal_enable_trx_interrupt(); /* NOT USED: Enable interrupt pin from the radio transceiver. */ + /* (none at the moment) */ } #elif defined(__AVR__) + #define HAL_RF230_ISR() ISR(RADIO_VECT) -#define HAL_TIME_ISR() ISR(TIMER1_OVF_vect) -#define HAL_TICK_UPCNT() (TCNT1) + void hal_init(void) { /*Reset variables used in file.*/ - hal_system_time = 0; -// hal_reset_flags(); /*IO Specific Initialization - sleep and reset pins. */ /* Set pins low before they are initialized as output? Does not seem to matter */ @@ -249,11 +194,8 @@ hal_init(void) SPCR = (1 << SPE) | (1 << MSTR); /* Enable SPI module and master operation. */ SPSR = (1 << SPI2X); /* Enable doubled SPI speed in master mode. */ - /*TIMER1 Specific Initialization.*/ - TCCR1B = HAL_TCCR1B_CONFIG; /* Set clock prescaler */ - TIFR1 |= (1 << ICF1); /* Clear Input Capture Flag. */ - HAL_ENABLE_OVERFLOW_INTERRUPT(); /* Enable Timer1 overflow interrupt. */ - hal_enable_trx_interrupt(); /* Enable interrupts from the radio transceiver. */ + /* Enable interrupts from the radio transceiver. */ + hal_enable_trx_interrupt(); } #else /* __AVR__ */ @@ -266,8 +208,6 @@ void hal_init(void) { /*Reset variables used in file.*/ - hal_system_time = 0; -// hal_reset_flags(); /*IO Specific Initialization - sleep and reset pins. */ DDR_SLP_TR |= (1 << SLP_TR); /* Enable SLP_TR as output. */ @@ -295,144 +235,12 @@ hal_init(void) TBSR.BIT.TB4S = 1; // Start Timer B4 INT1IC.BIT.POL = 1; // Select rising edge HAL_ENABLE_OVERFLOW_INTERRUPT(); /* Enable Timer overflow interrupt. */ - hal_enable_trx_interrupt(); /* Enable interrupts from the radio transceiver. */ + + /* Enable interrupts from the radio transceiver. */ + hal_enable_trx_interrupt(); } #endif /* !__AVR__ */ -/*----------------------------------------------------------------------------*/ -/** \brief This function reset the interrupt flags and interrupt event handlers - * (Callbacks) to their default value. - */ -//void -//hal_reset_flags(void) -//{ -// HAL_ENTER_CRITICAL_REGION(); - - /* Reset Flags. */ -// hal_bat_low_flag = 0; -// hal_pll_lock_flag = 0; - - /* Reset Associated Event Handlers. */ -// rx_start_callback = NULL; -// trx_end_callback = NULL; - -// HAL_LEAVE_CRITICAL_REGION(); -//} - -/*----------------------------------------------------------------------------*/ -/** \brief This function returns the current value of the BAT_LOW flag. - * - * The BAT_LOW flag is incremented each time a BAT_LOW event is signaled from the - * radio transceiver. This way it is possible for the end user to poll the flag - * for new event occurances. - */ -//uint8_t -//hal_get_bat_low_flag(void) -//{ -// return hal_bat_low_flag; -//} - -/*----------------------------------------------------------------------------*/ -/** \brief This function clears the BAT_LOW flag. - */ -//void -//hal_clear_bat_low_flag(void) -//{ -// HAL_ENTER_CRITICAL_REGION(); -// hal_bat_low_flag = 0; -// HAL_LEAVE_CRITICAL_REGION(); -//} - -/*----------------------------------------------------------------------------*/ -/** \brief This function is used to set new TRX_END event handler, overriding - * old handler reference. - */ -//hal_trx_end_isr_event_handler_t -//hal_get_trx_end_event_handler(void) -//{ -// return trx_end_callback; -//} - -/*----------------------------------------------------------------------------*/ -/** \brief This function is used to set new TRX_END event handler, overriding - * old handler reference. - */ -//void -//hal_set_trx_end_event_handler(hal_trx_end_isr_event_handler_t trx_end_callback_handle) -//{ -// HAL_ENTER_CRITICAL_REGION(); -// trx_end_callback = trx_end_callback_handle; -// HAL_LEAVE_CRITICAL_REGION(); -//} - -/*----------------------------------------------------------------------------*/ -/** \brief Remove event handler reference. - */ -//void -//hal_clear_trx_end_event_handler(void) -//{ -// HAL_ENTER_CRITICAL_REGION(); -// trx_end_callback = NULL; -// HAL_LEAVE_CRITICAL_REGION(); -//} - -/*----------------------------------------------------------------------------*/ -/** \brief This function returns the active RX_START event handler - * - * \return Current RX_START event handler registered. - */ -//hal_rx_start_isr_event_handler_t -//hal_get_rx_start_event_handler(void) -//{ -// return rx_start_callback; -//} - -/*----------------------------------------------------------------------------*/ -/** \brief This function is used to set new RX_START event handler, overriding - * old handler reference. - */ -//void -//hal_set_rx_start_event_handler(hal_rx_start_isr_event_handler_t rx_start_callback_handle) -//{ -// HAL_ENTER_CRITICAL_REGION(); -// rx_start_callback = rx_start_callback_handle; -// HAL_LEAVE_CRITICAL_REGION(); -//} - -/*----------------------------------------------------------------------------*/ -/** \brief Remove event handler reference. - */ -//void -//hal_clear_rx_start_event_handler(void) -//{ -// HAL_ENTER_CRITICAL_REGION(); -// rx_start_callback = NULL; -// HAL_LEAVE_CRITICAL_REGION(); -//} - -/*----------------------------------------------------------------------------*/ -/** \brief This function returns the current value of the PLL_LOCK flag. - * - * The PLL_LOCK flag is incremented each time a PLL_LOCK event is signaled from the - * radio transceiver. This way it is possible for the end user to poll the flag - * for new event occurances. - */ -//uint8_t -//hal_get_pll_lock_flag(void) -//{ -// return hal_pll_lock_flag; -//} - -/*----------------------------------------------------------------------------*/ -/** \brief This function clears the PLL_LOCK flag. - */ -//void -//hal_clear_pll_lock_flag(void) -//{ -// HAL_ENTER_CRITICAL_REGION(); -// hal_pll_lock_flag = 0; -// HAL_LEAVE_CRITICAL_REGION(); -//} #if defined(__AVR_ATmega128RFA1__) /* Hack for internal radio registers. hal_register_read and hal_register_write are @@ -459,14 +267,16 @@ void hal_subregister_write(uint16_t address, uint8_t mask, uint8_t position, uint8_t value) { - cli(); + HAL_ENTER_CRITICAL_REGION(); + uint8_t register_value = _SFR_MEM8(address); register_value &= ~mask; value <<= position; value &= mask; value |= register_value; _SFR_MEM8(address) = value; - sei(); + + HAL_LEAVE_CRITICAL_REGION(); } #else /* defined(__AVR_ATmega128RFA1__) */ @@ -597,41 +407,57 @@ hal_frame_read(hal_rx_frame_t *rx_frame) * Bypassing the length check can result in overrun if buffer is < 256 bytes. */ frame_length = TST_RX_LENGTH; - if ( 0 || ((frame_length >= HAL_MIN_FRAME_LENGTH) && (frame_length <= HAL_MAX_FRAME_LENGTH))) { - rx_frame->length = frame_length; + if ((frame_length < HAL_MIN_FRAME_LENGTH) || (frame_length > HAL_MAX_FRAME_LENGTH)) { + /* Length test failed */ + rx_frame->length = 0; + rx_frame->lqi = 0; + rx_frame->crc = false; + return; + } + rx_frame->length = frame_length; - /* Start of buffer in I/O space, pointer to RAM buffer */ - rx_buffer=(uint8_t *)0x180; - rx_data = (rx_frame->data); + /* Start of buffer in I/O space, pointer to RAM buffer */ + rx_buffer=(uint8_t *)0x180; + rx_data = (rx_frame->data); - do{ - *rx_data++ = _SFR_MEM8(rx_buffer++); - } while (--frame_length > 0); + do{ + *rx_data++ = _SFR_MEM8(rx_buffer++); + } while (--frame_length > 0); - /*Read LQI value for this frame.*/ - rx_frame->lqi = *rx_buffer; + /*Read LQI value for this frame.*/ + rx_frame->lqi = *rx_buffer; + + /* If crc was calculated set crc field in hal_rx_frame_t accordingly. + * Else show the crc has passed the hardware check. + */ + rx_frame->crc = true; #else /* defined(__AVR_ATmega128RFA1__) */ - uint8_t *rx_data; + uint8_t frame_length, *rx_data; /*Send frame read (long mode) command.*/ HAL_SPI_TRANSFER_OPEN(); HAL_SPI_TRANSFER(0x20); /*Read frame length. This includes the checksum. */ - uint8_t frame_length = HAL_SPI_TRANSFER(0); + frame_length = HAL_SPI_TRANSFER(0); /*Check for correct frame length. Bypassing this test can result in a buffer overrun! */ - if ( 0 || ((frame_length >= HAL_MIN_FRAME_LENGTH) && (frame_length <= HAL_MAX_FRAME_LENGTH))) { - + if ((frame_length < HAL_MIN_FRAME_LENGTH) || (frame_length > HAL_MAX_FRAME_LENGTH)) { + /* Length test failed */ + rx_frame->length = 0; + rx_frame->lqi = 0; + rx_frame->crc = false; + } + else { rx_data = (rx_frame->data); rx_frame->length = frame_length; /*Transfer frame buffer to RAM buffer */ - HAL_SPI_TRANSFER_WRITE(0); - HAL_SPI_TRANSFER_WAIT(); + HAL_SPI_TRANSFER_WRITE(0); + HAL_SPI_TRANSFER_WAIT(); do{ *rx_data++ = HAL_SPI_TRANSFER_READ(); HAL_SPI_TRANSFER_WRITE(0); @@ -643,7 +469,7 @@ hal_frame_read(hal_rx_frame_t *rx_frame) * The 802.15.4 standard requires 640us after a greater than 18 byte frame. * With a low interrupt latency overwrites should never occur. */ -// crc = _crc_ccitt_update(crc, tempData); + // crc = _crc_ccitt_update(crc, tempData); HAL_SPI_TRANSFER_WAIT(); @@ -651,23 +477,17 @@ hal_frame_read(hal_rx_frame_t *rx_frame) /*Read LQI value for this frame.*/ - rx_frame->lqi = HAL_SPI_TRANSFER_READ(); - -#endif /* defined(__AVR_ATmega128RFA1__) */ + rx_frame->lqi = HAL_SPI_TRANSFER_READ(); /* If crc was calculated set crc field in hal_rx_frame_t accordingly. * Else show the crc has passed the hardware check. */ rx_frame->crc = true; - - } else { - /* Length test failed */ - rx_frame->length = 0; - rx_frame->lqi = 0; - rx_frame->crc = false; } HAL_SPI_TRANSFER_CLOSE(); + +#endif /* defined(__AVR_ATmega128RFA1__) */ } /*----------------------------------------------------------------------------*/ @@ -765,25 +585,27 @@ hal_sram_read(uint8_t address, uint8_t length, uint8_t *data) * \param length Length of the write burst * \param data Pointer to an array of bytes that should be written */ -//void -//hal_sram_write(uint8_t address, uint8_t length, uint8_t *data) -//{ -// HAL_SPI_TRANSFER_OPEN(); +#if 0 //omit unless needed +void +hal_sram_write(uint8_t address, uint8_t length, uint8_t *data) +{ + HAL_SPI_TRANSFER_OPEN(); /*Send SRAM write command.*/ -// HAL_SPI_TRANSFER(0x40); + HAL_SPI_TRANSFER(0x40); /*Send address where to start writing to.*/ -// HAL_SPI_TRANSFER(address); + HAL_SPI_TRANSFER(address); /*Upload the chosen memory area.*/ -// do{ -// HAL_SPI_TRANSFER(*data++); -// } while (--length > 0); + do{ + HAL_SPI_TRANSFER(*data++); + } while (--length > 0); -// HAL_SPI_TRANSFER_CLOSE(); + HAL_SPI_TRANSFER_CLOSE(); -//} +} +#endif /*----------------------------------------------------------------------------*/ /* This #if compile switch is used to provide a "standard" function body for the */ @@ -862,28 +684,26 @@ ISR(TRX24_PLL_UNLOCK_vect) DEBUGFLOW('5'); } /* Flag is set by the following interrupts */ -extern volatile uint8_t rf230_interruptwait,rf230_ccawait; +extern volatile uint8_t rf230_wakewait, rf230_txendwait,rf230_ccawait; /* Wake has finished */ ISR(TRX24_AWAKE_vect) { // DEBUGFLOW('6'); - rf230_interruptwait=0; + rf230_wakewait=0; } /* Transmission has ended */ ISR(TRX24_TX_END_vect) { // DEBUGFLOW('7'); - rf230_interruptwait=0; + rf230_txendwait=0; } /* Frame address has matched ours */ -extern volatile uint8_t rf230_pending; ISR(TRX24_XAH_AMI_vect) { // DEBUGFLOW('8'); - rf230_pending=1; } /* CCAED measurement has completed */ @@ -897,14 +717,6 @@ ISR(TRX24_CCA_ED_DONE_vect) /* Separate RF230 has a single radio interrupt and the source must be read from the IRQ_STATUS register */ HAL_RF230_ISR() { - /*The following code reads the current system time. This is done by first - reading the hal_system_time and then adding the 16 LSB directly from the - hardware counter. - */ -// uint32_t isr_timestamp = hal_system_time; -// isr_timestamp <<= 16; -// isr_timestamp |= HAL_TICK_UPCNT(); // TODO: what if this wraps after reading hal_system_time? - volatile uint8_t state; uint8_t interrupt_source; /* used after HAL_SPI_TRANSFER_OPEN/CLOSE block */ @@ -919,22 +731,10 @@ HAL_RF230_ISR() /*Send Register address and read register content.*/ HAL_SPI_TRANSFER_WRITE(0x80 | RG_IRQ_STATUS); - /* This is the second part of the convertion of system time to a 16 us time - base. The division is moved here so we can spend less time waiting for SPI - data. - */ -// isr_timestamp /= HAL_US_PER_SYMBOL; /* Divide so that we get time in 16us resolution. */ -// isr_timestamp &= HAL_SYMBOL_MASK; - HAL_SPI_TRANSFER_WAIT(); /* AFTER possible interleaved processing */ -#if 0 //dak - interrupt_source = HAL_SPI_TRANSFER_READ(); /* The interrupt variable is used as a dummy read. */ - - interrupt_source = HAL_SPI_TRANSFER(interrupt_source); -#else interrupt_source = HAL_SPI_TRANSFER(0); -#endif + HAL_SPI_TRANSFER_CLOSE(); /*Handle the incomming interrupt. Prioritized.*/ @@ -950,44 +750,30 @@ HAL_RF230_ISR() rf230_last_rssi = 3 * hal_subregister_read(SR_RSSI); #endif #endif -// if(rx_start_callback != NULL){ -// /* Read Frame length and call rx_start callback. */ -// HAL_SPI_TRANSFER_OPEN(); -// uint8_t frame_length = HAL_SPI_TRANSFER(0x20); -// frame_length = HAL_SPI_TRANSFER(frame_length); -// HAL_SPI_TRANSFER_CLOSE(); - -// rx_start_callback(isr_timestamp, frame_length); -// } } else if (interrupt_source & HAL_TRX_END_MASK){ INTERRUPTDEBUG(11); -// if(trx_end_callback != NULL){ -// trx_end_callback(isr_timestamp); -// } state = hal_subregister_read(SR_TRX_STATUS); if((state == BUSY_RX_AACK) || (state == RX_ON) || (state == BUSY_RX) || (state == RX_AACK_ON)){ - /* Received packet interrupt */ - /* Buffer the frame and call rf230_interrupt to schedule poll for rf230 receive process */ -// if (rxframe.length) break; //toss packet if last one not processed yet + /* Received packet interrupt */ + /* Buffer the frame and call rf230_interrupt to schedule poll for rf230 receive process */ if (rxframe[rxframe_tail].length) INTERRUPTDEBUG(42); else INTERRUPTDEBUG(12); #ifdef RF230_MIN_RX_POWER - /* Discard packets weaker than the minimum if defined. This is for testing miniature meshes.*/ - /* Save the rssi for printing in the main loop */ + /* Discard packets weaker than the minimum if defined. This is for testing miniature meshes.*/ + /* Save the rssi for printing in the main loop */ #if RF230_CONF_AUTOACK - // rf230_last_rssi=hal_subregister_read(SR_ED_LEVEL); - rf230_last_rssi=hal_register_read(RG_PHY_ED_LEVEL); + //rf230_last_rssi=hal_subregister_read(SR_ED_LEVEL); + rf230_last_rssi=hal_register_read(RG_PHY_ED_LEVEL); #endif - if (rf230_last_rssi >= RF230_MIN_RX_POWER) { + if (rf230_last_rssi >= RF230_MIN_RX_POWER) { #endif - hal_frame_read(&rxframe[rxframe_tail]); - rxframe_tail++;if (rxframe_tail >= RF230_CONF_RX_BUFFERS) rxframe_tail=0; - rf230_interrupt(); -// trx_end_callback(isr_timestamp); + hal_frame_read(&rxframe[rxframe_tail]); + rxframe_tail++;if (rxframe_tail >= RF230_CONF_RX_BUFFERS) rxframe_tail=0; + rf230_interrupt(); #ifdef RF230_MIN_RX_POWER - } + } #endif } @@ -1000,7 +786,6 @@ HAL_RF230_ISR() ; } else if (interrupt_source & HAL_PLL_LOCK_MASK){ INTERRUPTDEBUG(15); -// hal_pll_lock_flag++; ; } else if (interrupt_source & HAL_BAT_LOW_MASK){ /* Disable BAT_LOW interrupt to prevent endless interrupts. The interrupt */ @@ -1009,7 +794,6 @@ HAL_RF230_ISR() uint8_t trx_isr_mask = hal_register_read(RG_IRQ_MASK); trx_isr_mask &= ~HAL_BAT_LOW_MASK; hal_register_write(RG_IRQ_MASK, trx_isr_mask); -// hal_bat_low_flag++; /* Increment BAT_LOW flag. */ INTERRUPTDEBUG(16); ; } else { @@ -1020,21 +804,6 @@ HAL_RF230_ISR() #endif /* defined(__AVR_ATmega128RFA1__) */ # endif /* defined(DOXYGEN) */ -/*----------------------------------------------------------------------------*/ -/* This #if compile switch is used to provide a "standard" function body for the */ -/* doxygen documentation. */ -#if defined(DOXYGEN) -/** \brief Timer Overflow ISR - * This is the interrupt service routine for timer1 overflow. - */ -void TIMER1_OVF_vect(void); -#else /* !DOXYGEN */ -HAL_TIME_ISR() -{ - hal_system_time++; -} -#endif - /** @} */ /** @} */ diff --git a/cpu/avr/radio/rf230bb/rf230bb.c b/cpu/avr/radio/rf230bb/rf230bb.c index cc3eb4d..65f9616 100644 --- a/cpu/avr/radio/rf230bb/rf230bb.c +++ b/cpu/avr/radio/rf230bb/rf230bb.c @@ -2,6 +2,11 @@ * Copyright (c) 2007, Swedish Institute of Computer Science * All rights reserved. * + * Additional fixes for AVR contributed by: + * + * David Kopf da...@em... + * Ivan Delamer de...@ie... + * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: @@ -91,13 +96,17 @@ static bool is_promiscuous; #endif -/* RF230_CONF_AUTORETRIES is 1 plus the number written to the hardware. */ +/* RF230_CONF_FRAME_RETRIES is 1 plus the number written to the hardware. */ /* Valid range 1-16, zero disables extended mode. */ -#ifndef RF230_CONF_AUTORETRIES -#define RF230_CONF_AUTORETRIES 3 +#ifndef RF230_CONF_FRAME_RETRIES +#ifdef RF230_CONF_AUTORETRIES /* Support legacy definition. */ +#define RF230_CONF_FRAME_RETRIES RF230_CONF_AUTORETRIES +#else +#define RF230_CONF_FRAME_RETRIES 0 /* Extended mode disabled by default. */ +#endif #endif -/* In extended mode (AUTORETRIES>0) the tx routine waits for hardware +/* In extended mode (FRAME_RETRIES>0) the tx routine waits for hardware * processing of an expected ACK and returns RADIO_TX_OK/NOACK result. * In non-extended mode the ACK is treated as a normal rx packet. * If the caller needs the ACK to be returned as an rx packet, @@ -109,15 +118,19 @@ static bool is_promiscuous; * that use the TX_OK result to signal a successful ACK. * Adds 100 bytes of program flash and two bytes of RAM. */ -#if RF320_CONF_INSERTACK && RF230_CONF_AUTORETRIES +#if RF320_CONF_INSERTACK && RF230_CONF_FRAME_RETRIES #define RF230_INSERTACK 1 uint8_t ack_pending,ack_seqnum; #endif -/* RF230_CONF_CSMARETRIES is number of random-backoff/CCA retries. */ +/* RF230_CONF_CSMA_RETRIES is number of random-backoff/CCA retries. */ /* The hardware will accept 0-7, but 802.15.4-2003 only allows 5 maximum */ -#ifndef RF230_CONF_CSMARETRIES -#define RF230_CONF_CSMARETRIES 5 +/* In RF231/128RFA1, a value of 7 means no CSMA bebofe the Tx. */ +/* CSMA backoffs are long and can block radio duty cycling + * over several channel check periods! */ +/* Used only if RF230_CONF_FRAME_RETRIES > 0. */ +#ifndef RF230_CONF_CSMA_RETRIES +#define RF230_CONF_CSMA_RETRIES 5 #endif //Automatic and manual CRC both append 2 bytes to packets @@ -191,18 +204,18 @@ extern uint8_t debugflowsize,debugflow[DEBUGFLOWSIZE]; #endif /* XXX hack: these will be made as Chameleon packet attributes */ +#if RF230_CONF_TIMESTAMPS rtimer_clock_t rf230_time_of_arrival, rf230_time_of_departure; int rf230_authority_level_of_sender; -#if RF230_CONF_TIMESTAMPS static rtimer_clock_t setup_time_for_transmission; static unsigned long total_time_for_transmission, total_transmission_len; static int num_transmissions; #endif #if defined(__AVR_ATmega128RFA1__) -volatile uint8_t rf230_interruptwait,rf230_ccawait; +volatile uint8_t rf230_wakewait, rf230_txendwait, rf230_ccawait; #endif uint8_t volatile rf230_pending; @@ -226,8 +239,8 @@ typedef enum{ PROCESS(rf230_process, "RF230 driver"); /*---------------------------------------------------------------------------*/ -int rf230_on(void); -int rf230_off(void); +static int rf230_on(void); +static int rf230_off(void); static int rf230_read(void *buf, unsigned short bufsize); @@ -340,9 +353,17 @@ static bool radio_is_sleeping(void) static void radio_reset_state_machine(void) { - if (hal_get_slptr()) DEBUGFLOW('"'); - hal_set_slptr_low(); - delay_us(TIME_NOCLK_TO_WAKE); + /* The data sheet is not clear on what happens when slptr is raised in RX on + * states, it "remains in the new state and returns to the preceding state + * when slptr is lowered". Possibly that is why there is an undocumented + * TIME_NOCLK_TO_WAKE delay here? + */ + if (hal_get_slptr()) { + DEBUGFLOW('V'); + hal_set_slptr_low(); + delay_us(TIME_NOCLK_TO_WAKE); + } + hal_subregister_write(SR_TRX_CMD, CMD_FORCE_TRX_OFF); delay_us(TIME_CMD_FORCE_TRX_OFF); } @@ -351,33 +372,36 @@ static char rf230_isidle(void) { uint8_t radio_state; + /* Contikimac can turn the radio off during an interrupt, so we always check + * slptr before doing the SPI transfer. The caller must also make this test + * if it could otherwise hang waiting for idle! */ if (hal_get_slptr()) { - DEBUGFLOW(']'); - return 1; - } else { - radio_state = hal_subregister_read(SR_TRX_STATUS); - if (radio_state != BUSY_TX_ARET && + if (RF230_receive_on) DEBUGFLOW('-'); + return 1; + } + else { + radio_state = hal_subregister_read(SR_TRX_STATUS); + if (radio_state != BUSY_TX_ARET && radio_state != BUSY_RX_AACK && radio_state != STATE_TRANSITION && radio_state != BUSY_RX && radio_state != BUSY_TX) { - return(1); - } else { -// printf(".%u",radio_state); - return(0); - } + return(1); + } + else { + return(0); + } } } static void rf230_waitidle(void) { -int i; - for (i=0;i<10000;i++) { //to avoid potential hangs - // while (1) { + /* TX_ARET with multiple csma retries can take a very long time to finish */ + while (1) { + if (hal_get_slptr()) return; if (rf230_isidle()) break; } - if (i>=10000) {DEBUGFLOW('H');DEBUGFLOW('R');} } /*----------------------------------------------------------------------------*/ @@ -402,9 +426,9 @@ int i; static radio_status_t radio_set_trx_state(uint8_t new_state) { - uint8_t original_state; + uint8_t current_state; - /*Check function paramter and current state of the radio transceiver.*/ + /*Check function parameter and current state of the radio transceiver.*/ if (!((new_state == TRX_OFF) || (new_state == RX_ON) || (new_state == PLL_ON) || @@ -413,23 +437,16 @@ radio_set_trx_state(uint8_t new_state) return RADIO_INVALID_ARGUMENT; } - if (hal_get_slptr()) { + if (hal_get_slptr()) { + DEBUGFLOW('W'); return RADIO_WRONG_STATE; } /* Wait for radio to finish previous operation */ rf230_waitidle(); - // for(;;) - // { - original_state = radio_get_trx_state(); - // if (original_state != BUSY_TX_ARET && - // original_state != BUSY_RX_AACK && - // original_state != BUSY_RX && - // original_state != BUSY_TX) - // break; - // } - - if (new_state == original_state){ + current_state = radio_get_trx_state(); + + if (new_state == current_state){ return RADIO_SUCCESS; } @@ -440,14 +457,15 @@ radio_set_trx_state(uint8_t new_state) /* The radio transceiver can be in one of the following states: */ /* TRX_OFF, RX_ON, PLL_ON, RX_AACK_ON, TX_ARET_ON. */ if(new_state == TRX_OFF){ + if (hal_get_slptr()) DEBUGFLOW('K');DEBUGFLOW('K');DEBUGFLOW('A'+hal_subregister_read(SR_TRX_STATUS)); radio_reset_state_machine(); /* Go to TRX_OFF from any state. */ } else { /* It is not allowed to go from RX_AACK_ON or TX_AACK_ON and directly to */ /* TX_AACK_ON or RX_AACK_ON respectively. Need to go via PLL_ON. */ /* (Old datasheets allowed other transitions, but this code complies with */ /* the current specification for RF230, RF231 and 128RFA1.) */ - if (((new_state == TX_ARET_ON) && (original_state == RX_AACK_ON)) || - ((new_state == RX_AACK_ON) && (original_state == TX_ARET_ON))){ + if (((new_state == TX_ARET_ON) && (current_state == RX_AACK_ON)) || + ((new_state == RX_AACK_ON) && (current_state == TX_ARET_ON))){ /* First do intermediate state transition to PLL_ON. */ /* The final state transition is handled after the if-else if. */ hal_subregister_write(SR_TRX_CMD, PLL_ON); @@ -459,21 +477,28 @@ radio_set_trx_state(uint8_t new_state) /* When the PLL is active most states can be reached in 1us. However, from */ /* TRX_OFF the PLL needs time to activate. */ - if (original_state == TRX_OFF){ + if (current_state == TRX_OFF){ delay_us(TIME_TRX_OFF_TO_PLL_ACTIVE); } else { delay_us(TIME_STATE_TRANSITION_PLL_ACTIVE); } } /* end: if(new_state == TRX_OFF) ... */ - /*Verify state transition.*/ - radio_status_t set_state_status = RADIO_TIMED_OUT; - - if (radio_get_trx_state() == new_state){ - set_state_status = RADIO_SUCCESS; + /* Verify state transition. + * Radio could have already switched to an RX_BUSY state, at least in cooja. + * Don't know what the hardware does but this would not be an error.*/ + current_state = radio_get_trx_state(); + if (current_state != new_state) { + if (((new_state == RX_ON) && (current_state == BUSY_RX)) || + ((new_state == RX_AACK_ON) && (current_state == BUSY_RX_AACK))) { + /* This is OK. */ + } else { + DEBUGFLOW('N');DEBUGFLOW('A'+new_state);DEBUGFLOW('A'+radio_get_trx_state());DEBUGFLOW('N'); + return RADIO_TIMED_OUT; + } } - return set_state_status; + return RADIO_SUCCESS; } void @@ -504,7 +529,7 @@ flushrx(void) } /*---------------------------------------------------------------------------*/ static void -on(void) +radio_on(void) { // ENERGEST_OFF(ENERGEST_TYPE_LISTEN);//testing ENERGEST_ON(ENERGEST_TYPE_LISTEN); @@ -520,11 +545,22 @@ on(void) PORTE|=(1<<PE1); //ledon #endif #if defined(__AVR_ATmega128RFA1__) -/* Use the poweron interrupt for delay */ - rf230_interruptwait=1; - sei(); - hal_set_slptr_low(); - while (rf230_interruptwait) {} + /* Use the poweron interrupt for delay */ + rf230_wakewait=1; + { + uint8_t sreg = SREG; + sei(); + if (hal_get_slptr() == 0) DEBUGFLOW('$'); + hal_set_slptr_low(); + { + int i; + for (i=0;i<10000;i++) { + if (!rf230_wakewait) break; + } + if (i>=10000) {DEBUGFLOW('G');DEBUGFLOW('g');DEBUGFLOW('A'+hal_subregister_read(SR_TRX_STATUS));} + } + SREG = sreg; + } #else /* SPI based radios. The wake time depends on board capacitance. * Make sure the delay is long enough, as using SPI too soon will reset the MCU! @@ -533,7 +569,6 @@ on(void) // uint8_t sreg = SREG;cli(); hal_set_slptr_low(); delay_us(2*TIME_SLEEP_TO_TRX_OFF); -// delay_us(TIME_SLEEP_TO_TRX_OFF+TIME_SLEEP_TO_TRX_OFF/2); // SREG=sreg; #endif } @@ -547,8 +582,14 @@ on(void) rf230_waitidle(); } static void -off(void) +radio_off(void) { + RF230_receive_on = 0; + if (hal_get_slptr()) { + DEBUGFLOW('F'); + return; + } + #if RF230BB_CONF_LEDONPORTE1 PORTE&=~(1<<PE1); //ledoff #endif @@ -563,7 +604,12 @@ off(void) /* Do not transmit autoacks when stack thinks radio is off */ radio_set_trx_state(RX_ON); #else - /* Force the device into TRX_OFF. */ + /* Force the device into TRX_OFF. + * First make sure an interrupt did not initiate a sleep. */ + if (hal_get_slptr()) { + DEBUGFLOW('?'); + return; + } radio_reset_state_machine(); #if RADIOSLEEPSWHENOFF /* Sleep Radio */ @@ -572,7 +618,6 @@ off(void) #endif #endif /* RADIOALWAYSON */ - RF230_receive_on = 0; ENERGEST_OFF(ENERGEST_TYPE_LISTEN); } /*---------------------------------------------------------------------------*/ @@ -586,7 +631,7 @@ set_txpower(uint8_t power) DEBUGFLOW('f'); PRINTF("rf230_set_txpower:Sleeping"); //happens with cxmac } else { - DEBUGFLOW('g'); + //DEBUGFLOW('g'); hal_subregister_write(SR_TX_PWR, power); } } @@ -718,13 +763,14 @@ rf230_init(void) // printf_P(PSTR("After calibration OSCCAL=%x\n"),OSCCAL); /* Set receive buffers empty and point to the first */ - for (i=0;i<RF230_CONF_RX_BUFFERS;i++) rxframe[i].length=0; + for (i=0;i<RF230_CONF_RX_BUFFERS;i++) { + rxframe[i].length=0; + } rxframe_head=0;rxframe_tail=0; /* Do full rf230 Reset */ hal_set_rst_low(); hal_set_slptr_low(); -#if 1 /* On powerup a TIME_RESET delay is needed here, however on some other MCU reset * (JTAG, WDT, Brownout) the radio may be sleeping. It can enter an uncertain * state (sending wrong hardware FCS for example) unless the full wakeup delay @@ -733,9 +779,7 @@ rf230_init(void) * See www.avrfreaks.net/index.php?name=PNphpBB2&file=viewtopic&t=78725 */ delay_us(2*TIME_SLEEP_TO_TRX_OFF); -#else - delay_us(TIME_RESET); -#endif + //delay_us(TIME_RESET); /* Old impl. */ hal_set_rst_high(); /* Force transition to TRX_OFF */ @@ -761,7 +805,7 @@ rf230_init(void) process_start(&rf230_process, NULL); /* Leave radio in on state (?)*/ - on(); + radio_on(); return 1; } @@ -777,11 +821,13 @@ void rf230_warm_reset(void) { hal_register_write(RG_IRQ_MASK, RF230_SUPPORTED_INTERRUPT_MASK); - /* Set up number of automatic retries 0-15 (0 implies PLL_ON sends instead of the extended TX_ARET mode */ - hal_subregister_write(SR_MAX_FRAME_RETRIES, RF230_CONF_AUTORETRIES ); + /* Set up number of automatic retries 0-15 + * (0 implies PLL_ON sends instead of the extended TX_ARET mode */ + hal_subregister_write(SR_MAX_FRAME_RETRIES, + (RF230_CONF_FRAME_RETRIES > 0) ? (RF230_CONF_FRAME_RETRIES - 1) : 0 ); /* Set up carrier sense/clear channel assesment parameters for extended operating mode */ - hal_subregister_write(SR_MAX_CSMA_RETRIES, 5 );//highest allowed retries + hal_subregister_write(SR_MAX_CSMA_RETRIES, RF230_CONF_CSMA_RETRIES );//highest allowed retries hal_register_write(RG_CSMA_BE, 0x80); //min backoff exponent 0, max 8 (highest allowed) hal_register_write(RG_CSMA_SEED_0,hal_register_read(RG_PHY_RSSI) );//upper two RSSI reg bits RND_VALUE are random in rf231 // hal_register_write(CSMA_SEED_1,42 ); @@ -855,20 +901,19 @@ rf230_transmit(unsigned short payload_len) #if RF230BB_CONF_LEDONPORTE1 PORTE|=(1<<PE1); //ledon #endif - rf230_interruptwait=1; - hal_set_slptr_low(); -// while (rf230_interruptwait) {} + rf230_wakewait=1; + hal_set_slptr_low(); { int i; for (i=0;i<10000;i++) { - if (!rf230_interruptwait) break; + if (!rf230_wakewait) break; } + if (i>=10000) {DEBUGFLOW('G');DEBUGFLOW('G');DEBUGFLOW('A'+hal_subregister_read(SR_TRX_STATUS));} } #else hal_set_slptr_low(); DEBUGFLOW('j'); - delay_us(2*TIME_SLEEP_TO_TRX_OFF); //extra delay depends on board capacitance -// delay_us(TIME_SLEEP_TO_TRX_OFF+TIME_SLEEP_TO_TRX_OFF/2); + delay_us(2*TIME_SLEEP_TO_TRX_OFF); //extra delay (2x) depends on board capacitance #endif } else { @@ -891,7 +936,7 @@ rf230_transmit(unsigned short payload_len) ENERGEST_OFF(ENERGEST_TYPE_LISTEN); } /* Prepare to transmit */ -#if RF230_CONF_AUTORETRIES +#if RF230_CONF_FRAME_RETRIES radio_set_trx_state(TX_ARET_ON); DEBUGFLOW('t'); #else @@ -916,20 +961,17 @@ rf230_transmit(unsigned short payload_len) ENERGEST_ON(ENERGEST_TYPE_TRANSMIT); -#if defined(__AVR_ATmega128RFA1__) /* No interrupts across frame download! */ - cli(); -/* slow down the transmit? */ - // delay_us(500); -#endif - /* Toggle the SLP_TR pin to initiate the frame transmission */ + HAL_ENTER_CRITICAL_REGION(); + + /* Toggle the SLP_TR pin to initiate the frame transmission */ hal_set_slptr_high(); hal_set_slptr_low(); hal_frame_write(buffer, total_len); -#if defined(__AVR_ATmega128RFA1__) - sei(); -#endif + + HAL_LEAVE_CRITICAL_REGION(); PRINTF("rf230_transmit: %d\n", (int)total_len); + #if DEBUG>1 /* Note the dumped packet will have a zero checksum unless compiled with RF230_CONF_CHECKSUM * since we don't know what it will be if calculated by the hardware. @@ -951,7 +993,7 @@ rf230_transmit(unsigned short payload_len) rf230_waitidle(); /* Get the transmission result */ -#if RF230_CONF_AUTORETRIES +#if RF230_CONF_FRAME_RETRIES tx_result = hal_subregister_read(SR_TRAC_STATUS); #else tx_result=RADIO_TX_OK; @@ -981,13 +1023,13 @@ rf230_transmit(unsigned short payload_len) if(RF230_receive_on) { DEBUGFLOW('l'); ENERGEST_ON(ENERGEST_TYPE_LISTEN); - on(); + radio_on(); } else { #if RADIOALWAYSON /* Enable reception */ - on(); + radio_on(); #else - off(); + radio_off(); PRINTF("rf230_transmit: turning radio off\n"); #endif } @@ -1123,36 +1165,39 @@ bail: return ret; } /*---------------------------------------------------------------------------*/ -int +static int rf230_off(void) { /* Don't do anything if we are already turned off. */ if(RF230_receive_on == 0) { + //if (!hal_get_slptr()) DEBUGFLOW('5'); return 0; } + //if (hal_get_slptr()) DEBUGFLOW('6'); - /* If we are currently receiving a packet, we still call off(), + /* If we are currently receiving a packet, we still call radio_off(), as that routine waits until Rx is complete (packet uploaded in ISR - so no worries about losing it). If using RX_AACK_MODE, chances are - the packet is not for us and will be discarded. */ + so no worries about losing it). The transmit routine may also turn ++ the radio off on a return to sleep. rf230_isidle checks for that. */ if (!rf230_isidle()) { + //DEBUGFLOW('X');DEBUGFLOW('X');DEBUGFLOW('A'+hal_subregister_read(SR_TRX_STATUS)); PRINTF("rf230_off: busy receiving\r\n"); //return 1; } - off(); + radio_off(); return 0; } /*---------------------------------------------------------------------------*/ -int +static int rf230_on(void) { if(RF230_receive_on) { - DEBUGFLOW('q'); + //if (hal_get_slptr()) DEBUGFLOW('Q');//Cooja TODO: shows sleeping occasionally return 1; } - on(); + radio_on(); return 1; } /*---------------------------------------------------------------------------*/ @@ -1296,18 +1341,26 @@ PROCESS_THREAD(rf230_process, ev, data) TIMETABLE_TIMESTAMP(rf230_timetable, "poll"); #endif /* RF230_TIMETABLE_PROFILING */ - rf230_pending = 0; - packetbuf_clear(); /* Turn off interrupts to avoid ISR writing to the same buffers we are reading. */ HAL_ENTER_CRITICAL_REGION(); - len = rf230_read(packetbuf_dataptr(), PACKETBUF_SIZE); + len = rf230_read(packetbuf_dataptr(), PACKETBUF_SIZE); /* Restore interrupts. */ HAL_LEAVE_CRITICAL_REGION(); PRINTF("rf230_read: %u bytes lqi %u\n",len,rf230_last_correlation); +#if DEBUG>1 + { + uint8_t i; + unsigned const char * rxdata = packetbuf_dataptr(); + PRINTF("0000"); + for (i=0;i<len+AUX_LEN;i++) PRINTF(" %02x",rxdata[i]); + PRINTF("\n"); + } +#endif + RF230PROCESSFLAG(1); if(len > 0) { @@ -1372,19 +1425,6 @@ rf230_read(void *buf, unsigned short bufsize) return 0; } -#if RADIOALWAYSON -if (RF230_receive_on) { -#else -if (hal_get_slptr()) { - DEBUGFLOW('!'); - return 0; -} -if (!RF230_receive_on) { - DEBUGFLOW('['); - return 0; -} -#endif - #if RF230_CONF_TIMESTAMPS if(interrupt_time_set) { rf230_time_of_arrival = interrupt_time; @@ -1395,19 +1435,6 @@ if (!RF230_receive_on) { rf230_time_of_departure = 0; #endif /* RF230_CONF_TIMESTAMPS */ - // can't use PRINTF as interrupts are disabled -// PRINTSHORT("r%d",rxframe[rxframe_head].length); - //PRINTF("rf230_read: %u bytes lqi %u crc %u\n",rxframe[rxframe_head].length,rxframe[rxframe_head].lqi,rxframe[rxframe_head].crc); -#if DEBUG>1 - { - //uint8_t i; - //PRINTF("0000"); - //for (i=0;i<rxframe[rxframe_head].length;i++) PRINTF(" %02x",rxframe[rxframe_head].data[i]); - //PRINTF("\n"); - } -#endif - -//if(len > RF230_MAX_PACKET_LEN) { if(len > RF230_MAX_TX_FRAME_LENGTH) { /* Oops, we must be out of sync. */ DEBUGFLOW('u'); @@ -1431,6 +1458,7 @@ if (!RF230_receive_on) { RIMESTATS_ADD(toolong); return 0; } + /* Transfer the frame, stripping the footer, but copying the checksum */ framep=&(rxframe[rxframe_head].data[0]); memcpy(buf,framep,len-AUX_LEN+CHECKSUM_LEN); @@ -1438,9 +1466,17 @@ if (!RF230_receive_on) { /* Clear the length field to allow buffering of the next packet */ rxframe[rxframe_head].length=0; - rxframe_head++;if (rxframe_head >= RF230_CONF_RX_BUFFERS) rxframe_head=0; + rxframe_head++; + if (rxframe_head >= RF230_CONF_RX_BUFFERS) { + rxframe_head=0; + } /* If another packet has been buffered, schedule another receive poll */ - if (rxframe[rxframe_head].length) rf230_interrupt(); + if (rxframe[rxframe_head].length) { + rf230_interrupt(); + } + else { + rf230_pending = 0; + } /* Point to the checksum */ framep+=len-AUX_LEN; @@ -1518,13 +1554,6 @@ if (!RF230_receive_on) { /* Here return just the data length. The checksum is however still in the buffer for packet sniffing */ return len - AUX_LEN; - -#if RADIOALWAYSON -} else { - DEBUGFLOW('y'); //Stack thought radio was off - return 0; -} -#endif } /*---------------------------------------------------------------------------*/ void @@ -1589,13 +1618,17 @@ rf230_cca(void) uint8_t radio_was_off = 0; /* Turn radio on if necessary. If radio is currently busy return busy channel */ - /* This may happen when testing radio duty cycling with RADIOALWAYSON */ + /* This may happen when testing radio duty cycling with RADIOALWAYSON, + * or because a packet just started. */ if(RF230_receive_on) { if (hal_get_slptr()) { //should not be sleeping! DEBUGFLOW('<'); goto busyexit; } else { - if (!rf230_isidle()) {DEBUGFLOW('2');goto busyexit;} + if (!rf230_isidle()) { + //DEBUGFLOW('2'); + goto busyexit; + } } } else { radio_was_off = 1; @@ -1611,18 +1644,30 @@ rf230_cca(void) /* Note reading the TRX_STATUS register clears both CCA_STATUS and CCA_DONE bits */ #if defined(__AVR_ATmega128RFA1__) #if 1 //interrupt method - sei(); -//rf230_waitidle(); -//TODO:disable reception for version bug - radio_set_trx_state(RX_ON); -// rf230_waitidle(); + /* Disable rx transitions to busy (RX_PDT_BIT) */ + /* Note: for speed this resets rx threshold to the compiled default */ +#ifdef RF230_MIN_RX_POWER + hal_register_write(RG_RX_SYN, RF230_MIN_RX_POWER/6 + 0x81); +#else + hal_register_write(RG_RX_SYN, 0x80); +#endif + /* Switch to RX_ON for measurement. This will wait if a packet is being received */ + radio_set_trx_state(RX_ON); + rf230_ccawait=1; //CCA_REQUEST is supposed to trigger the interrupt but it doesn't // hal_subregister_write(SR_CCA_REQUEST,1); - hal_register_write(PHY_ED_LEVEL,0); -// delay_us(TIME_CCA); -// if (hal_register_read(RG_PHY_ED_LEVEL)<(91-77)) cca=0xff; - while (rf230_ccawait) {} + + /* Write to ED_LEVEL register to start CCA */ + { + uint8_t volatile saved_sreg = SREG; + sei( ); + hal_register_write(PHY_ED_LEVEL,0); + while (rf230_ccawait) {} + SREG = saved_sreg; + } + + /* Use ED register to determine result. 77dBm is poweron csma default.*/ #ifdef RF230_CONF_CCA_THRES if (hal_register_read(RG_PHY_ED_LEVEL)<(91+RF230_CONF_CCA_THRES) cca=0xff; #else @@ -1631,8 +1676,17 @@ rf230_cca(void) //TODO:see if the status register works! // cca=hal_register_read(RG_TRX_STATUS); #if RF230_CONF_AUTOACK - radio_set_trx_state(RX_AACK_ON); + radio_set_trx_state(RX_AACK_ON); #endif + + /* Enable packet reception */ +#ifdef RF230_MIN_RX_POWER + hal_register_write(RG_RX_SYN, RF230_MIN_RX_POWER/6 + 0x01); +#else + hal_register_write(RG_RX_SYN, 0x00); +#endif + + #else /* If already in receive mode can read the current ED register without delay */ /* CCA energy threshold = -91dB + 2*SR_CCA_ED_THRESH. Reset defaults to -77dB */ @@ -1654,6 +1708,10 @@ rf230_cca(void) hal_subregister_write(SR_CCA_REQUEST,1); delay_us(TIME_CCA); while ((cca & 0x80) == 0 ) { + if (hal_get_slptr()) { + DEBUGFLOW('S'); + break; + } cca=hal_register_read(RG_TRX_STATUS); } SREG=saved_sreg; @@ -1684,7 +1742,6 @@ rf230_receiving_packet(void) radio_state = hal_subregister_read(SR_TRX_STATUS); if ((radio_state==BUSY_RX) || (radio_state==BUSY_RX_AACK)) { // DEBUGFLOW('8'); -// rf230_pending=1; return 1; } } diff --git a/cpu/avr/radio/rf230bb/rf230bb.h b/cpu/avr/radio/rf230bb/rf230bb.h index 2cadfa6..020c325 100644 --- a/cpu/avr/radio/rf230bb/rf230bb.h +++ b/cpu/avr/radio/rf230bb/rf230bb.h @@ -10,6 +10,7 @@ * Kevin Brown kb...@uc... * Nate Bohlmann na...@el... * David Kopf da...@em... + * Ivan Delamer de...@ie... * * All rights reserved. * @@ -82,7 +83,6 @@ #define RF230_MIN_ED_THRESHOLD ( 0 ) #define RF230_MAX_ED_THRESHOLD ( 15 ) #define RF230_MAX_TX_FRAME_LENGTH ( 127 ) /**< 127 Byte PSDU. */ -//#define RF230_MAX_PACKET_LEN 127 #define TX_PWR_3DBM ( 0 ) #define TX_PWR_17_2DBM ( 15 ) @@ -166,7 +166,6 @@ typedef enum{ * */ typedef enum{ -// CCA_ED = 0, /**< Use energy detection above threshold mode. */ conflicts with atmega128rfa1 mcu definition CCA_ENERGY_DETECT = 0, /**< Use energy detection above threshold mode. */ CCA_CARRIER_SENSE = 1, /**< Use carrier sense mode. */ CCA_CARRIER_SENSE_WITH_ED = 2 /**< Use a combination of both energy detection and carrier sense. */ @@ -210,8 +209,6 @@ const struct radio_driver rf230_driver; int rf230_init(void); void rf230_warm_reset(void); void rf230_start_sneeze(void); -//int rf230_on(void); -//int rf230_off(void); void rf230_set_channel(uint8_t channel); void rf230_listen_channel(uint8_t channel); uint8_t rf230_get_channel(void); diff --git a/platform/avr-atmega128rfa1/contiki-conf.h b/platform/avr-atmega128rfa1/contiki-conf.h index 0cf995e..aeec695 100644 --- a/platform/avr-atmega128rfa1/contiki-conf.h +++ b/platform/avr-atmega128rfa1/contiki-conf.h @@ -137,7 +137,7 @@ typedef unsigned short uip_stats_t; /* Network setup */ /* TX routine passes the cca/ack result in the return parameter */ #define RDC_CONF_HARDWARE_ACK 1 -/* TX routine does automatic cca and optional backoff */ +/* TX routine does automatic cca and optional backoffs */ #define RDC_CONF_HARDWARE_CSMA 1 /* Allow MCU sleeping between channel checks */ #define RDC_CONF_MCU_SLEEP 1 @@ -193,8 +193,10 @@ typedef unsigned short uip_stats_t; #define RF230_CONF_AUTOACK 1 /* Request 802.15.4 ACK on all packets sent (else autoretry). This is primarily for testing. */ #define SICSLOWPAN_CONF_ACK_ALL 0 -/* Number of auto retry attempts 0-15 (0 implies don't use extended TX_ARET_ON mode with CCA) */ -#define RF230_CONF_AUTORETRIES 2 +/* 1 + Number of auto retry attempts 0-15 (0 implies don't use extended TX_ARET_ON mode) */ +#define RF230_CONF_FRAME_RETRIES 2 +/* Number of csma retry attempts 0-5 in extended tx mode (7 does immediate tx with no csma) */ +#define RF230_CONF_CSMA_RETRIES 5 /* Default is one RAM buffer for received packets. More than one may benefit multiple TCP connections or ports */ #define RF230_CONF_RX_BUFFERS 3 #define SICSLOWPAN_CONF_FRAG 1 @@ -250,9 +252,10 @@ typedef unsigned short uip_stats_t; #define RTIMER_CONF_NESTED_INTERRUPTS 1 #define RF230_CONF_AUTOACK 1 /* A 0 here means non-extended mode; 1 means extended mode with no retry, >1 for retrys */ -#define RF230_CONF_AUTORETRIES 1 -/* A 0 here means no cca; 1 means extended mode with cca but no retry, >1 for backoff retrys */ -#define RF230_CONF_CSMARETRIES 1 +/* Contikimac strobes on its own, but hardware retries are faster */ +#define RF230_CONF_FRAME_RETRIES 1 +/* Long csma backoffs will compromise radio cycling; set to 0 for 1 csma */ +#define RF230_CONF_CSMA_RETRIES 0 #define SICSLOWPAN_CONF_FRAG 1 #define SICSLOWPAN_CONF_MAXAGE 3 /* 211 bytes per qu... [truncated message content] |
From: Ivan D. <ide...@us...> - 2012-09-01 21:24:34
|
This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "contiki". The branch, master has been updated via 2e72ec3594fef4557742dd77eddd1e95ec483967 (commit) via 5636357243e6bc96fcd470473f14387a10e9a6ea (commit) from 1bb055bae6633d520477a133e5d866416c4dfa40 (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- commit 2e72ec3594fef4557742dd77eddd1e95ec483967 Author: Ivan Delamer <de...@in...> Date: Sat Sep 1 15:22:13 2012 -0600 Place ATmega1281 define in correct section (it does have compare C unit, avoid duplicate define and compiler warning). diff --git a/cpu/avr/rtimer-arch.c b/cpu/avr/rtimer-arch.c index 6958e39..2a38e66 100644 --- a/cpu/avr/rtimer-arch.c +++ b/cpu/avr/rtimer-arch.c @@ -51,7 +51,7 @@ #include "sys/rtimer.h" #include "rtimer-arch.h" -#if defined(__AVR_ATmega1281__) || defined(__AVR_ATmega1284P__) +#if defined(__AVR_ATmega1284P__) #define ETIMSK TIMSK3 #define ETIFR TIFR3 #define TICIE3 ICIE3 @@ -65,7 +65,7 @@ #define OCF3C OCF3B #endif -#if defined(__AVR_AT90USB1287__) || defined(__AVR_ATmega128RFA1__) +#if defined(__AVR_ATmega1281__) || defined(__AVR_AT90USB1287__) || defined(__AVR_ATmega128RFA1__) #define ETIMSK TIMSK3 #define ETIFR TIFR3 #define TICIE3 ICIE3 commit 5636357243e6bc96fcd470473f14387a10e9a6ea Author: Ivan Delamer <de...@in...> Date: Sat Sep 1 15:20:00 2012 -0600 Fix RF230 transition: RX_AACK_ON -> TX_ARET_ON (go through PLL_ON, as per datasheet). Tested on RF230 and 128RFA1 (RF231). diff --git a/cpu/avr/radio/rf230bb/rf230bb.c b/cpu/avr/radio/rf230bb/rf230bb.c index 477c561..cc3eb4d 100644 --- a/cpu/avr/radio/rf230bb/rf230bb.c +++ b/cpu/avr/radio/rf230bb/rf230bb.c @@ -443,19 +443,15 @@ radio_set_trx_state(uint8_t new_state) radio_reset_state_machine(); /* Go to TRX_OFF from any state. */ } else { /* It is not allowed to go from RX_AACK_ON or TX_AACK_ON and directly to */ - /* TX_AACK_ON or RX_AACK_ON respectively. Need to go via RX_ON or PLL_ON. */ - if ((new_state == TX_ARET_ON) && - (original_state == RX_AACK_ON)){ - /* First do intermediate state transition to PLL_ON, then to TX_ARET_ON. */ - /* The final state transition to TX_ARET_ON is handled after the if-else if. */ + /* TX_AACK_ON or RX_AACK_ON respectively. Need to go via PLL_ON. */ + /* (Old datasheets allowed other transitions, but this code complies with */ + /* the current specification for RF230, RF231 and 128RFA1.) */ + if (((new_state == TX_ARET_ON) && (original_state == RX_AACK_ON)) || + ((new_state == RX_AACK_ON) && (original_state == TX_ARET_ON))){ + /* First do intermediate state transition to PLL_ON. */ + /* The final state transition is handled after the if-else if. */ hal_subregister_write(SR_TRX_CMD, PLL_ON); delay_us(TIME_STATE_TRANSITION_PLL_ACTIVE); - } else if ((new_state == RX_AACK_ON) && - (original_state == TX_ARET_ON)){ - /* First do intermediate state transition to RX_ON, then to RX_AACK_ON. */ - /* The final state transition to RX_AACK_ON is handled after the if-else if. */ - hal_subregister_write(SR_TRX_CMD, RX_ON); - delay_us(TIME_STATE_TRANSITION_PLL_ACTIVE); } /* Any other state transition can be done directly. */ ----------------------------------------------------------------------- Summary of changes: cpu/avr/radio/rf230bb/rf230bb.c | 18 +++++++----------- cpu/avr/rtimer-arch.c | 4 ++-- 2 files changed, 9 insertions(+), 13 deletions(-) hooks/post-receive -- contiki |
From: Simon D. <sim...@us...> - 2012-08-30 11:25:27
|
This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "contiki". The branch, master has been updated via 1bb055bae6633d520477a133e5d866416c4dfa40 (commit) from c425e51911827e9182f651ff9df1cc9ba671f936 (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- commit 1bb055bae6633d520477a133e5d866416c4dfa40 Author: simonduq <sim...@si...> Date: Thu Aug 30 13:12:26 2012 +0200 Fixed the udp-stream example: use the new RPL interface, reduce RAM usage diff --git a/examples/udp-stream/project-conf.h b/examples/udp-stream/project-conf.h index d90849f..7e70346 100644 --- a/examples/udp-stream/project-conf.h +++ b/examples/udp-stream/project-conf.h @@ -35,13 +35,13 @@ /* Free some code and RAM space */ #define UIP_CONF_TCP 0 #undef UIP_CONF_DS6_NBR_NBU -#define UIP_CONF_DS6_NBR_NBU 12 +#define UIP_CONF_DS6_NBR_NBU 8 #undef UIP_CONF_DS6_ROUTE_NBU -#define UIP_CONF_DS6_ROUTE_NBU 12 +#define UIP_CONF_DS6_ROUTE_NBU 8 /* The total number of queuebuf */ #undef QUEUEBUF_CONF_NUM -#define QUEUEBUF_CONF_NUM 140 +#define QUEUEBUF_CONF_NUM 128 /* The number of queuebuf actually stored in RAM. If not set or equal to the total number of queuebuf, swapping is disabled, and CFS not linked. */ diff --git a/examples/udp-stream/udp-stream.c b/examples/udp-stream/udp-stream.c index a00d552..c53e72e 100644 --- a/examples/udp-stream/udp-stream.c +++ b/examples/udp-stream/udp-stream.c @@ -101,8 +101,8 @@ create_rpl_dag(uip_ipaddr_t *ipaddr) rpl_dag_t *dag; uip_ipaddr_t prefix; - rpl_set_root(ipaddr); - dag = rpl_get_dag(RPL_ANY_INSTANCE); + rpl_set_root(RPL_DEFAULT_INSTANCE, ipaddr); + dag = rpl_get_any_dag(); uip_ip6addr(&prefix, 0xaaaa, 0, 0, 0, 0, 0, 0, 0); rpl_set_prefix(dag, &prefix, 64); printf("created a new RPL dag\n"); ----------------------------------------------------------------------- Summary of changes: examples/udp-stream/project-conf.h | 6 +++--- examples/udp-stream/udp-stream.c | 4 ++-- 2 files changed, 5 insertions(+), 5 deletions(-) hooks/post-receive -- contiki |
From: Niclas F. <ni...@us...> - 2012-08-22 12:18:30
|
This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "contiki". The branch, master has been updated via c425e51911827e9182f651ff9df1cc9ba671f936 (commit) via 24dba740e21a5cf479a7a9353dfd10483c0c9751 (commit) from c5e9d688a5a6589669e5e4553a3d2c35df264dc6 (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- commit c425e51911827e9182f651ff9df1cc9ba671f936 Author: Niclas Finne <nf...@si...> Date: Wed Aug 22 14:13:31 2012 +0200 Added support for nested quotes in arguments when calling external commands from Cooja diff --git a/tools/cooja/java/se/sics/cooja/dialogs/CompileContiki.java b/tools/cooja/java/se/sics/cooja/dialogs/CompileContiki.java index 9978d77..fda1b86 100644 --- a/tools/cooja/java/se/sics/cooja/dialogs/CompileContiki.java +++ b/tools/cooja/java/se/sics/cooja/dialogs/CompileContiki.java @@ -43,7 +43,6 @@ import java.io.InputStreamReader; import java.io.OutputStreamWriter; import java.io.Reader; import java.util.ArrayList; -import java.util.Arrays; import java.util.regex.Pattern; import java.util.regex.Matcher; @@ -89,11 +88,15 @@ public class CompileContiki { final MessageList compilationOutput, boolean synchronous) throws Exception { - Pattern p = Pattern.compile("([^\\s\"']|\"[^\"]*\"|'[^']*')+"); + Pattern p = Pattern.compile("([^\\s\"']+|\"[^\"]*\"|'[^']*')"); Matcher m = p.matcher(command); ArrayList<String> commandList = new ArrayList<String>(); - while(m.find()) { - commandList.add(m.group().replaceAll("['\"]","")); + while(m.find()) { + String arg = m.group(); + if (arg.length() > 1 && (arg.charAt(0) == '"' || arg.charAt(0) == '\'')) { + arg = arg.substring(1, arg.length() - 1); + } + commandList.add(arg); } return compile(commandList.toArray(new String[commandList.size()]), env, outputFile, directory, onSuccess, onFailure, compilationOutput, synchronous); } commit 24dba740e21a5cf479a7a9353dfd10483c0c9751 Author: simonduq <sim...@si...> Date: Wed Aug 15 17:15:26 2012 +0200 Added support for quote-delimited arguments when calling external commands from Cooja diff --git a/tools/cooja/java/se/sics/cooja/dialogs/CompileContiki.java b/tools/cooja/java/se/sics/cooja/dialogs/CompileContiki.java index abc9c31..9978d77 100644 --- a/tools/cooja/java/se/sics/cooja/dialogs/CompileContiki.java +++ b/tools/cooja/java/se/sics/cooja/dialogs/CompileContiki.java @@ -44,6 +44,8 @@ import java.io.OutputStreamWriter; import java.io.Reader; import java.util.ArrayList; import java.util.Arrays; +import java.util.regex.Pattern; +import java.util.regex.Matcher; import javax.swing.Action; @@ -87,8 +89,13 @@ public class CompileContiki { final MessageList compilationOutput, boolean synchronous) throws Exception { - /* TODO Split into correct arguments: parse " and ' */ - return compile(command.split(" "), env, outputFile, directory, onSuccess, onFailure, compilationOutput, synchronous); + Pattern p = Pattern.compile("([^\\s\"']|\"[^\"]*\"|'[^']*')+"); + Matcher m = p.matcher(command); + ArrayList<String> commandList = new ArrayList<String>(); + while(m.find()) { + commandList.add(m.group().replaceAll("['\"]","")); + } + return compile(commandList.toArray(new String[commandList.size()]), env, outputFile, directory, onSuccess, onFailure, compilationOutput, synchronous); } /** ----------------------------------------------------------------------- Summary of changes: .../java/se/sics/cooja/dialogs/CompileContiki.java | 16 +++++++++++++--- 1 files changed, 13 insertions(+), 3 deletions(-) hooks/post-receive -- contiki |
From: Antonio L. <a-l...@us...> - 2012-08-16 12:13:33
|
This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "contiki". The branch, master has been updated via c5e9d688a5a6589669e5e4553a3d2c35df264dc6 (commit) from 73e7f25cbc5a506457776881c545e40e8ab11c6b (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- commit c5e9d688a5a6589669e5e4553a3d2c35df264dc6 Author: Antonio Lignan <al...@zo...> Date: Thu Aug 16 13:38:11 2012 +0200 Fixed sht11 driver, now ensures the i2c bus is disabled when initializing diff --git a/core/dev/sht11.c b/core/dev/sht11.c index 2b7f255..9577281 100644 --- a/core/dev/sht11.c +++ b/core/dev/sht11.c @@ -212,6 +212,17 @@ sht11_init(void) #ifdef SHT11_INIT SHT11_INIT(); #else + /* As this driver is bit-bang based, disable the I2C first + This assumes the SDA/SCL pins passed in the -arch.h file are + actually the same used for I2C operation, else comment out the following + */ + #warning SHT11: DISABLING I2C BUS + SHT11_PxSEL &= ~(BV(SHT11_ARCH_SDA) | BV(SHT11_ARCH_SCL)); + #if defined(__MSP430_HAS_MSP430X_CPU__) || defined(__MSP430_HAS_MSP430XV2_CPU__) + SHT11_PxREN &= ~(BV(SHT11_ARCH_SDA) | BV(SHT11_ARCH_SCL)); + #endif + + /* Configure SDA/SCL as GPIOs */ SHT11_PxOUT |= BV(SHT11_ARCH_PWR); SHT11_PxOUT &= ~(BV(SHT11_ARCH_SDA) | BV(SHT11_ARCH_SCL)); SHT11_PxDIR |= BV(SHT11_ARCH_PWR) | BV(SHT11_ARCH_SCL); diff --git a/examples/z1/Makefile b/examples/z1/Makefile index b9065d5..3e9362b 100644 --- a/examples/z1/Makefile +++ b/examples/z1/Makefile @@ -3,7 +3,7 @@ TARGET=z1 endif CONTIKI_PROJECT = test-phidgets blink test-adxl345 test-tmp102 test-light-ziglet test-battery test-sht11 test-relay-phidget #test-potent -CONTIKI_SOURCEFILES += sht11.c potentiometer-sensor.c +CONTIKI_SOURCEFILES += sht11.c# potentiometer-sensor.c APPS=serial-shell diff --git a/platform/wismote/dev/sht11-arch.h b/platform/wismote/dev/sht11-arch.h index 8df629f..1cc7c90 100644 --- a/platform/wismote/dev/sht11-arch.h +++ b/platform/wismote/dev/sht11-arch.h @@ -48,5 +48,6 @@ #define SHT11_PxIN P1IN #define SHT11_PxOUT P1OUT #define SHT11_PxSEL P1SEL +#define SHT11_PxREN P1REN #endif diff --git a/platform/z1/dev/sht11-arch.h b/platform/z1/dev/sht11-arch.h index d1d833d..6c190e3 100644 --- a/platform/z1/dev/sht11-arch.h +++ b/platform/z1/dev/sht11-arch.h @@ -56,5 +56,6 @@ #define SHT11_PxIN P5IN #define SHT11_PxOUT P5OUT #define SHT11_PxSEL P5SEL +#define SHT11_PxREN P5REN #endif ----------------------------------------------------------------------- Summary of changes: core/dev/sht11.c | 11 +++++++++++ examples/z1/Makefile | 2 +- platform/wismote/dev/sht11-arch.h | 1 + platform/z1/dev/sht11-arch.h | 1 + 4 files changed, 14 insertions(+), 1 deletions(-) hooks/post-receive -- contiki |
From: Antonio L. <a-l...@us...> - 2012-07-30 10:00:27
|
This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "contiki". The branch, master has been updated via 73e7f25cbc5a506457776881c545e40e8ab11c6b (commit) from a3e56371a59e27f49464b41cdebc30c5e0ef00c1 (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- commit 73e7f25cbc5a506457776881c545e40e8ab11c6b Author: Antonio Lignan <al...@zo...> Date: Mon Jul 30 11:27:13 2012 +0200 Simple phidget-like relay driver for the Z1 mote with basic functionalities diff --git a/examples/z1/Makefile b/examples/z1/Makefile index 17c4399..b9065d5 100644 --- a/examples/z1/Makefile +++ b/examples/z1/Makefile @@ -2,7 +2,7 @@ ifndef TARGET TARGET=z1 endif -CONTIKI_PROJECT = test-phidgets blink test-adxl345 test-tmp102 test-light-ziglet test-battery test-sht11 #test-potent +CONTIKI_PROJECT = test-phidgets blink test-adxl345 test-tmp102 test-light-ziglet test-battery test-sht11 test-relay-phidget #test-potent CONTIKI_SOURCEFILES += sht11.c potentiometer-sensor.c APPS=serial-shell diff --git a/examples/z1/test-relay-phidget.c b/examples/z1/test-relay-phidget.c new file mode 100644 index 0000000..9aad55f --- /dev/null +++ b/examples/z1/test-relay-phidget.c @@ -0,0 +1,83 @@ +/* + * Copyright (c) 2011, Zolertia(TM) is a trademark of Advancare,SL + * 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 Institute 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 INSTITUTE 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 INSTITUTE 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. + * + * This file is part of the Contiki operating system. + * + */ + +/** + * \file + * A quick program for testing a generic relay device connected in the + * phidget port + * \author + * Antonio Lignan <al...@zo...> + */ + +#include <stdio.h> +#include "contiki.h" +#include "dev/relay-phidget.h" + + +#if 1 +#define PRINTF(...) printf(__VA_ARGS__) +#else +#define PRINTF(...) +#endif + + +#if 0 +#define PRINTFDEBUG(...) printf(__VA_ARGS__) +#else +#define PRINTFDEBUG(...) +#endif + + +#define RELAY_INTERVAL (CLOCK_SECOND) + +PROCESS(test_process, "Relay test process"); +AUTOSTART_PROCESSES(&test_process); +/*---------------------------------------------------------------------------*/ +static struct etimer et; +static uint8_t status; + +PROCESS_THREAD(test_process, ev, data) +{ + PROCESS_BEGIN(); + + /* Selects P6.7 as control pin of the relay module */ + relay_enable(7); + + while(1) { + etimer_set(&et, RELAY_INTERVAL); + PROCESS_WAIT_EVENT_UNTIL(etimer_expired(&et)); + + status = relay_toggle(); + PRINTF("Relay [%d]\n", status); + } + PROCESS_END(); +} diff --git a/platform/z1/Makefile.common b/platform/z1/Makefile.common index 522bffc..6afab08 100644 --- a/platform/z1/Makefile.common +++ b/platform/z1/Makefile.common @@ -18,7 +18,8 @@ ARCH=msp430.c leds.c watchdog.c xmem.c \ radio-sensor.c uart0.c uart0-putchar.c uip-ipchksum.c \ checkpoint-arch.c slip.c slip_uart0.c \ z1-phidgets.c sht11.c sht11-sensor.c light-sensor.c \ - battery-sensor.c sky-sensors.c tmp102.c temperature-sensor.c light-ziglet.c + battery-sensor.c sky-sensors.c tmp102.c temperature-sensor.c light-ziglet.c \ + relay-phidget.c CONTIKI_TARGET_DIRS = . dev apps net ifndef CONTIKI_TARGET_MAIN diff --git a/platform/z1/dev/relay-phidget.c b/platform/z1/dev/relay-phidget.c new file mode 100644 index 0000000..88b1e4e --- /dev/null +++ b/platform/z1/dev/relay-phidget.c @@ -0,0 +1,107 @@ +/* + * Copyright (c) 2010, Swedish Institute of Computer Science. + * 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 Institute 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 INSTITUTE 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 INSTITUTE 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. + * + * This file is part of the Contiki operating system. + * + * + * ----------------------------------------------------------------- + * + * \file + * Device simple driver for generic relay in phidget port of Zolertia Z1 + * \author + * Antonio Lignan, Zolertia <al...@zo...> + * + */ + +#include "contiki.h" +#include "relay-phidget.h" + +static uint8_t controlPin; + +enum PHIDGET_RELAY_STATUSTYPES +{ + /* must be a bit and not more, not using 0x00. */ + INITED = 0x01, + RUNNING = 0x02, + STOPPED = 0x04, +}; + +static enum PHIDGET_RELAY_STATUSTYPES _RELAY_STATUS = 0x00; + +/*---------------------------------------------------------------------------*/ + +void +relay_enable(uint8_t pin) +{ + + if (!(_RELAY_STATUS & INITED)){ + + _RELAY_STATUS |= INITED; + + // Selects the pin to be configure as the control pin of the relay module + controlPin = (1 << pin); + + // Configures the control pin + P6SEL &= ~controlPin; + P6DIR |= controlPin; + } +} + +/*---------------------------------------------------------------------------*/ + +void +relay_on() +{ + if ((_RELAY_STATUS & INITED)){ + P6OUT |= controlPin; + } +} + +/*---------------------------------------------------------------------------*/ +void +relay_off() +{ + if ((_RELAY_STATUS & INITED)){ + P6OUT &= ~controlPin; + } +} + +/*---------------------------------------------------------------------------*/ + +uint8_t +relay_toggle() +{ + uint8_t status; + if ((_RELAY_STATUS & INITED)){ + P6OUT ^= controlPin; + if((P6OUT & controlPin)) return 1; + return 0; + } +} +/*---------------------------------------------------------------------------*/ + diff --git a/platform/z1/dev/relay-phidget.h b/platform/z1/dev/relay-phidget.h new file mode 100644 index 0000000..431b97b --- /dev/null +++ b/platform/z1/dev/relay-phidget.h @@ -0,0 +1,50 @@ +/* + * Copyright (c) 2010, Swedish Institute of Computer Science. + * 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 Institute 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 INSTITUTE 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 INSTITUTE 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. + * + * This file is part of the Contiki operating system. + * + * ----------------------------------------------------------------- + * + * \file + * Device simple driver for generic relay in phidget port of Zolertia Z1 + * \author + * Antonio Lignan, Zolertia <al...@zo...> + * + */ + +#ifndef __RELAY_PHIDGET_H__ +#define __RELAY_PHIDGETS_H__ + +void relay_enable(uint8_t pin); + +void relay_on(); +void relay_off(); +uint8_t relay_toogle(); + + +#endif /* __RELAY_PHIDGET_H__ */ ----------------------------------------------------------------------- Summary of changes: examples/z1/Makefile | 2 +- .../{test-light-ziglet.c => test-relay-phidget.c} | 24 +++--- platform/z1/Makefile.common | 3 +- .../z1/dev/relay-phidget.c | 102 ++++++++++---------- .../dev/sky-sensors.h => z1/dev/relay-phidget.h} | 24 +++-- 5 files changed, 81 insertions(+), 74 deletions(-) copy examples/z1/{test-light-ziglet.c => test-relay-phidget.c} (84%) copy cpu/msp430/f1xxx/rtimer-arch.c => platform/z1/dev/relay-phidget.c (64%) copy platform/{wismote/dev/sky-sensors.h => z1/dev/relay-phidget.h} (83%) hooks/post-receive -- contiki |
From: Adam D. <ada...@us...> - 2012-07-16 20:25:54
|
This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "contiki". The annotated tag, 2.6 has been created at b8dd4672f5a7b78bb84852ee8479a2b8126728ba (tag) tagging a3e56371a59e27f49464b41cdebc30c5e0ef00c1 (commit) tagged by Adam Dunkels on Mon Jul 16 22:25:15 2012 +0200 - Log ----------------------------------------------------------------- Version 2.6 Adam Dunkels (142): Test commit test commit testing commit testing commit Yet another test commit Testing another commit Set default number of retries to 8 to make the netperf command more robust Merge branch 'master' of github.com:adamdunkels/contiki-2.x Added the low-power streaming mode where frequent channel checks are performed when streaming is on. Enabling this will (by setting WITH_STREAMING to 1), however, significantly slow down Cooja/MSPsim simulations. Added a PACKETBUF_ATTR_STREAM_END packet flag Explicitly turn LEDs off if the command is interrupted Set the end-of-stream flag on the TCP FIN packet Scripts for manipulating and calculating statistics from .csc files Rewrote the parent selection to favour parents with a low ETX and a good rank. The old parent selection would always favour parents with a lower rank, regardless of their ETX, which in some cases lead to suboptimal parent selections. Also, the old code was buggy in that it would always pick the worst parent (the one with the highest ETX). Changed the variable name local_confidence to etx to better reflect what it was used for Added a hysteresis when choosing a new parent: don't switch parent unless the ETX is significantly better (1.5 ETX better). Slight code complexity reduction Don't remove all parents that have a worse rank than an incoming DIO: we may inadvertently remove our preferred parent. Instead, remove parents with a rank that is worse than our preferred parent. If we are lucky, this will give us enough space for the new parent. Don't add neighbor as a potential parent if its rank is too high. Use DAG_RANK() macro to compute rank Changed the name of macros defined in neighbor-info.h to have the NEIGHBOR_INFO prefix. Changed the name of macros defined in neighbor-info.h to have the NEIGHBOR_INFO prefix. Changed the name of macros defined in neighbor-info.h to have the NEIGHBOR_INFO prefix. Make sure we don't remove the preferred parent Made the number of MAC sequence numbers to remember configurable Made the number of MAC sequence numbers to remember configurable; fixed bug with power attribution to the idle state. Moved the backyard/ directory to contikiprojects Merge branch 'master' of ssh://contiki.git.sourceforge.net/gitroot/contiki/contiki Added the computation of average loss rate Fixed bugs in the types to the printf arguments Merge branch 'master' of ssh://contiki.git.sourceforge.net/gitroot/contiki/contiki Bugfix: print out the correct total idle transmit and listen time Flush before computing accumulative power Bugfix: idle power consumption was sometimes misestimated for transmissions, when a duty cycle rtimer fired in the middle of a transmission Bugfix: energy consumption for retransmissions was miscounted Rime sniffers must be called for all transmissions, even if they failed, to get energy attribution right. This means that rime output sniffers now also must take the MAC transmission status as an argument. Made ContikiMAC/8 default on z1 platform; enabled power profiling by default Added a motelist target that is the same on both sky and z1 Collect view for z1 Bugfix: IPv6 address to Rime address traslation did not appear correctly in the Collect-View GUI. Bugfix: removed extreanous asterix character The Z1 platform has LEDs A significantly simpler API for sending UDP packets A significantly simpler API for sending UDP packets Merge branch 'master' of ssh://contiki.git.sourceforge.net/gitroot/contiki/contiki Example code for the simple UDP API Simulation file for the broadcast example Simulation file for the unicast example Made the simple UDP examples simpler To avoid ambiguity, address should be explicitly set by caller, not automatically by the module. Explicitly initialize module if it wasn't initialized before the first registration Update to new API Added some defensive programming Made the number of phase neighbors configurable Copyright headers Updated for git (intermediate commit - not sure this works yet!) Merge branch 'master' of ssh://contiki.git.sourceforge.net/gitroot/contiki/contiki Include stdlib.h for the NULL macro Copy the string first, since shell_output_str() does not ensure constness of the first string Don't include the deprecated netsim platform Fixed includes Fixed previously erroneously fixed include Print out sender IPv6 address when receiving data. When sending data, include a counter in the message. Removed the deprecated netsim platform. Added z1 and redbee. bugfix Minor code style fixes Made the ContikiMAC header configurable from contiki-conf.h Added a SICSLOWPAN_CONF_COMPRESSION_THRESHOLD that can be used to set a threshold under which header compression should not be used. Below this threshold, headers are not compressed but sent as full IPv6 packets. This is useful for RDC layers, such as ContikiMAC, which set a lower bound for packet size. Small spelling bugfix Use the SICSLOWPAN_CONF_COMPRESSION_THRESHOLD to avoid compressing IPv6 packets smaller than 60 bytes. This allows us to use ContikiMAC without its header, making it 802.15.4 compliant again. Cleanup of the ContikiMAC code; removed the old an unused announcement code Cleanup of the ContikiMAC code; removed the old an unused announcement code Include string header Be a little more conservative in terms of what headers not to compress Fix names of avr-raven platform Made the sky and z1 platform handling of PROJECT_CONF_H the same as the other platforms: the makefile should define PROJECT_CONF_H to be the name of the header file to include. This header file should #undef everything it #defines, as it is included after all the other configuration options in contiki-conf.h Merge branch 'master' of ssh://contiki.git.sourceforge.net/gitroot/contiki/contiki Remove debug output to save space Added a safeguard to fragmentation reassembly: if there are additional bytes in the final fragment, we shave them off in the spirit of being 'liberal in what we accept' Removed the obsolete MAC_CONF_CHANNEL_CHECK_RATE (now replaced with NETSTACK_CONF_RDC_CHANNEL_CHECK_RATE) Removed the obsolete MAC_CONF_CHANNEL_CHECK_RATE (now replaced with NETSTACK_CONF_RDC_CHANNEL_CHECK_RATE) Set default RDC wakeup rate to 8 hz Removed the obsolete MAC_CONF_CHANNEL_CHECK_RATE (now replaced with NETSTACK_CONF_RDC_CHANNEL_CHECK_RATE) Removed the obsolete MAC_CONF_CHANNEL_CHECK_RATE (now replaced with NETSTACK_CONF_RDC_CHANNEL_CHECK_RATE) Merge branch 'master' of ssh://contiki.git.sourceforge.net/gitroot/contiki/contiki If no MAC is defined, create one from the node ID Merge branch 'master' of ssh://contiki.git.sourceforge.net/gitroot/contiki/contiki Updated to use latest Rime APIs Compile with SMALL=1 to make binary fit in memory Compile with SMALL=1 to make binary fit in memory Added SMALL=1 to make code fit on Tmote Sky Merge branch 'master' of ssh://contiki.git.sourceforge.net/gitroot/contiki/contiki Bugfix: PROCESS_PAUSE() must explicitly check the event type, otherwise we may cause the process event queue to fill up if we repeatedly call PROCESS_PAUSE() while other (broadcast) events are posted as well, such as timer events. style fix; added fas check for cycle_time being a power of two or not. Removed obsolete platforms Merge branch 'master' of ssh://contiki.git.sourceforge.net/gitroot/contiki/contiki Disable phase shift correction by default Merge branch 'master' of ssh://contiki.git.sourceforge.net/gitroot/contiki/contiki Made collect retransmissions and broadcast announcements timers depend on the rdc wakeup rate Update to the newest RPL API Default to SMALL unless otherwise specified, to get size of binaries smaller so that Contiki with RPL/IPv6 fits on the Tmote Sky again. Reduce size of the neighbor table entries to make RPL fit into the Tmote Sky RAM. Contiki port to the TI EXP5438 MSP430x5438a experimenters board MSPsim with support for the MSP430x architecture Removed erroneous character from first line of file. Increased wait time between main loop polls; cleaned up the code to Contiki code style standards; moved process autostart code to after network setup simple-udp should be included in the IPv4 build as well. small code style fixes; removed left-over function call Set executable flag on binaries Set CCA threshold before starting, to make ContikiMAC more efficient. Fix compilation problem with non-IPv6 compiles. Various style fixes. Bugfix in clock_wait() declaration. Various style fixes. Refactored window title that was duplicated in multiple places General cleanup and fixes of texts and labels General cleanup and fixes of texts and labels Renamed simulation visualizers to simulation visualizers, from simulation visualizer skins Updated control panel quickhelp Ping slower to allow routes to settle Set default look and feel on Linux to Nimbus. If Nimbus is not available, Added an isRunnable() method that returns true if the simulation can be run. Updated menu item name to indicate that a window is opened when selecting it. Placed the radio medium selection in the Advanced settings frame. Close window when clicking the Save button. Fixed menu item name to be consistent with others Reimplementation of the context menu, which was difficult for newcomers to find, Set Notes window to open by default. Reimplemented the context menu, which was difficult for newcomers to find, Rewrote the context menu and the custom left pane as menus, to make the Rewrote the script editor to use real menus instead of the custom buttons Removed traffic counters from the main canvas. Rewrote the code to use real menus instead of relying on context menus for top-level operaions. Updated menu item name to indicate that a window is opened. Updated menu item name to indicate that a window is opened. Updated imports The __delay_cycles() function in the latest mspgcc takes an unsigned long argument but does not allow it to be larger than 65536. Bugfix: viewers were not correctly ticked off in the menu when a simulation was loaded from file. The current fix feels like a hack through. Rewrote the traffic history visualization with blue arrows that fade Merge branch 'master' of ssh://contiki.git.sourceforge.net/gitroot/contiki/contiki Updated file permissions Merge branch 'master' of ssh://contiki.git.sourceforge.net/gitroot/contiki/contiki Bumped version number Updated README with new website and shorter text Bumped version number Antonio Lignan (3): Squeeze websense example Add disable function to I2C driver Zolertia's light sensor ziglet David Kopf (129): Test git commit Merge branch 'master' of https://github.com/adamdunkels/contiki-2.x Test TortoiseGit commit from Vista laptop Update description of make process. Implement SRAM routine of Georg von Zengen Add RPL nodes and border router to minimal-net platform (cygwin only) Allow ipv6 builds on win32 platform. (webserver6 builds with cygwin, needs changes for VC++ compiler) Restore lines that were excluded for VC++ test build Include status cgi's with explicit define Change ctimer startup order, add multihop to wpcap and minimal-net platform. Add higher baud rates, fix occasional buffer overflow Add template for AUTOSTART_PROCESS Tag version commits and override CONTIKI_VERSION_STRING with git describe Replace WEBSERVER by AVR_WEBSERVER Clock seconds since startup on minimal-net Add WITH_WEBSERVER=<webserver> options Add /apps/webserver-nano Add file needed for rpl border router Raven-webserver needs raven-lcd-interface Fix avr progmem string accesses, add DEBUGLOGIC, configure sky defaults Add explicit RADIOSTATS to platform contiki-conf.h gcc 4.4.1 - 4.6.0 compiler bug workaround. Add Iris port of Shinta Hatatani Use PROCESS_NAME_STRING macro to handle NO_PROCESS_NAMES avr-libc %.*s workaround Add stk500 platform and changes suggested by Daniel Willmann Restore micaz/dev/clock.c, mysteriously renamed to iris/dev/sensors/battery-sensor.c Assign aaaa:: prefix if HARD_CODED_ADDRESS not defined Add gitclean and distclean options to /tools/Makefile Change timer setups for arbitrary CLOCK_CONF_SECOND Remove duplicate code block CCA measurement was always returning busy Get random seed from noisy ADC conversion at startup. Option for nested rtimer interrupts Update to proper webserver define Add changes needed for contikimac Let RPL examples enable platform RPL Free rtimer for contikimac, add print-stats option Use 128rfa1 interrupts instead of timing. Free internal webserver from dependency on /apps/webserver. [Forget to add to previous commit] Minor tweaks based on maniacbug commits. Add CONTIKI_PROJECT to the makefile, enabling make upload. Remove inclusion of preprocessor directive in macro expansion. Some gcc's do not like that. Calculate best prescaler based on F_CPU and CLOCK_CONF_SECONDS. Inspired by patch from Ivan Delamer. Apply patch of Ivan Delamer for atmega1281 @ 4 MHz Account for 16 bit rtimer wraparound, else ENERGEST way underreports AVR times. Use correct prescale factor Make comparison endian-safe, thanks Ivan. 128rfa1 cca fix, NETSTACK_RADIO.off now returns 0/1 if radio off/on More reliable webserver-nano build Add periodic prints and stack monitor Add warning about slip overrun Add timestamp option, print strings after CR Move LEDONPORTE1 define to contiki-conf.h, fixing typo. Correct typo Trap CR in framed debug string Allow selection of slip port makefsdata must be run with HTTPD_STRING_ADDR Fix typos and file endings Implement WITH_RPL option in makefile Add serial logging tool. Add settings manager with program flash defaults, random routine, periodic prints with ENERGEST, node-id. Use enumerated tx return values Refactor with params.c, h Print elf size if ELF_SIZE is defined output buffer unused at present, save some RAM This fixes commit 9a1ce7 for spaces instead of .... flash led on tcp get, fix pingbacks on rpl build, patch web data for params Adjust sleep time by ticks instead of seconds, proposed by Ivan Delamer Drop unneded null byte at end of httpd-fsdata files. Revert rules to rebuild httpd-fs.c and httpd-fsdata.c Merge branch 'master' of git://contiki.git.sourceforge.net/gitroot/contiki/contiki Add ENERGEST, RIMESTATS, COMPOWER to status page Better formatting of webserver-nano status page Add missing includes, remove unimplemented function declaration. Fix sd6 typo Use fixed font for neighbors and routes Avoid infinite loop when printing garbled packets Add streaming ajax page with csv text buffer Condense js file and hopefully convert to unix line endings. Move r.abort to stop button so IE9 can stop ajax streaming. atmega128rfa1 ajax power and sensor reporting, longint calculation bugfixes. atmega128rfa1 cca fixes, energest and rimestat macros. Reverse node_id bytes, patch from Geog von Zengen Add rtimer_arch_sleep function, enabled with RDC_CONF_MCU_SLEEP Merge branch 'master' of ssh://contiki.git.sourceforge.net/gitroot/contiki/contiki Add general unsupported interrupt vector suggested by Daniel Willmann Add Raven battery display to status page Improve rf23x cca procesing Get better random seed on startup Add params.c to Raven and sync with 128rfa1 contiki-conf.h Add RDC_CONF_HARDWARE_CSMA, RDC_CONF_HARDWARE_ACK, RDC_CONF_MCU_SLEEP, CONTIKIMAC_CONF_SHORTEST_PACKET_SIZE for use with hardware having those modes. Better fix for hardware FCS error on JTAG reset Bugfix: use 16 bit tick count to adjust clock after sleep Add optional correction for phase drift of receiver. Add 921600 baud to slip options, fix compiler warnings Add wpcap for cygwin/Windows native border router Add F_CPU=0x800000 option with phase lock to external 32768 Hz crystal Adjust cycle starts when RTIMER_ARCH_SECOND not a power of two. Access uart registers directly instead of through intermediate addresses in a RAM struct. Merge branch 'master' of github.com:contiki/contiki-mirror Merge branch 'master' of git://contiki.git.sourceforge.net/gitroot/contiki/contiki Remove unused SPI initializer flag from AVR. Comment out in the msp-430 template. Merge branch 'master' of ssh://contiki.git.sourceforge.net/gitroot/contiki/contiki rf230bb updates: involves setting the 801.15.4 pending bit, Make static buffer the default, add comments. Webserver-nano: Add page load times, remove workaround code for bug in arm strformat.c, correct the double count of leading zeros there. Fix minimal-net webserver6, broken after native border router changes. Turn off RDC before SLIP prefix interchange. Disable SIN/SUT prints, leave off-route prints. Move address initialization to after proce_init. Something in that now wiping the address array. PROGMEM changes needed for newer avr-gcc compiler Add missing mtarch_stop function Several bugfixes Add PAGETITLE option to webserver-nano, compress status page white space. Eliminate unused variable warnings. Dummy test of PT_YIELD_FLAG does not change program size. Add higher baud rates, option for link-local address assignment Redo html output, more options, httpd state variables to allow neighbors and routes to span tcp segments. Add display options to border router web page, default now uses stack instead of static buffer. Add variable update time for Ajax display. Update status.shtml with <pre> tag now used by cgi. Fix wrong register addresses. Restart ajax on changed update time, remove unused variable. RPL is now default. Change Huginn and Muninn for params.c storage Add clock_delay_us and clock_set_seconds to clock.h. Modify clock_wait to use clock_time_t. Reorder includes to prefer platform routines. Remove redundant RPL define. Ensure MAXDADNS is defined in uip-ds6.h Enable check on received length to prevent buffer overflow. Thank you Cooja! Prefer UART0 for stdout; move DEBUFGLOW macro below definition of uint8_t Patch from Landon Fuller adds const to PROGMEM, required for newer avr-gcc Enric (1): updated .gitignore with _del/ and tools/ Enric M. Calvo (47): Corrected some typos in the PORT1 ISR function. Updated *-sensor.c files from the sky platform. Merge commit 'upstreamsf/master' Added MAC overwriting/burning capability to the Z1 Updated *-sensor.c files from the sky platform. Added MAC overwriting/burning capability to the Z1 Merge branch 'master' of gi...@gi...:enricmcalvo/contiki-2.x Added Potentiometer sensor in Z1 Platform .gitignore file added Definition of Z1 Starter Platform in contiki/platforms + LEDs + Potentiometer Removed unwanted files modified .gitignore Added a quick sht11 sensor driver support for Z1 Fixed radio and contiki conf to get RIME working corrected adxl345, ISR was not disabled, now it is. optional lines in Makefile.common Set QUEUEBUF_CONF_NUM to 4 to avoid .data overflow XXX Interrupts by cc2420 & adxl345 compatible now Corrected contiki-conf.h to include project-conf.h Sky-websense compiles for Z1 (testing) Added dummy light driver. Now skywebsense likes Z1 examples/sky-shell now runs out-of-the-box on Z1 Modified contiki-conf.h and added sensys-scanner. Correceted cc2420 function calls+modified makefile Added ViewRSSI3D example. Merge branch '500-rime-examples' Cleaned up rssi-scanner example directory added example unicast with temperature added makefile added example-unicast2.c Modified Makefile and test-potent.c for ICTPWSN added mV test-battery file added example-unicast2 and 3 for ictp Merge branch 'master' of gi...@gi...:enricmcalvo/contiki-2.x M Makefile.common to add tmp102 sensor by default ICTP: lowered radio power + print unicast data added temperature-sensor to Makefile.common Added IPv6 z1-websense demo w/MSP batt&temp sensor Meaningful units for msp temp&batt sensors ictp:z1-websense with battery in mV minor tweaks to z1-websense and .gitignore modified gitignore Cleaned up z1-websense.c file Cleaned up some files, moved z1-websense example Merge branch 'master' of git://contiki.git.sourceforge.net/gitroot/contiki/contiki into master_cleanup removed modif. to sky files cleaned up main François Revol (1): Fix some typos. Fredrik Osterlind (184): LEDS_ALL configurable fixed line endings Merge branch 'refs/heads/master' of https://fro...@gi.../adamdunkels/contiki-2.x.git into HEAD example of adding cooja-platform mote interface manually support for tinyos style node ids, to simplify testbed experiments using memory breakpoints instead of polling memory region during prerequisites download info fixed line endings removed debugging output disabled tos mode for serial output (appears to be broken) + log fixed line endings only show error dialog when visualized Merge branch 'refs/heads/master' of https://fro...@gi.../adamdunkels/contiki-2.x.git into HEAD removed CVS-specific ignore files noise radio, to be observed by radio mediums doc tracked components shown in tooltip capture effect (3dB) + noise source radio support removed debugging output moved radio interface visualizer code to shared abstract radio replacing unterminated binary data with warning log message moved radio interface visualizer code to shared abstract radio implementing noise source radio include source radio when noise level changes moved radio interface visualizer code to this abstract radio handle pending simulation thread events before simulation starts, just bug fix: signal strenghts may not be registered organized imports towards importing testbed profiles into dgrm removed execute flag of source files (avoids diff problems with egit) removed obsolete leds_[color]() functions, replaced by leds_{on,off}() added simple example demonstrating user-defined timeout function get[Started]Plugin method returns plugins that end with argument + added sim and gui variables accessible from test scripts bugfix in writing tinyos addresses added clean button to compile dialog, added compilation tip tab for msp motes unregistering visualizer skin removed incorrect visualizer skin registration simplified mote selection in visualizer skins enables sharing mote-specific properties minor fix on locating config file improved api read .gz files example code for manually configuring sky motes MAC addresses added writeFile method to be used from scripts quick hack for reloading script from disk when script is activated help class that simplifies implementing serial forwarders * bugfixed and rewrote MRM to improve configurability example directional antenna try to restore edges loaded from old simulation configuration improved capture effect support in mrm: capture effect is effective if the latter transmission is stronger and no later than half the preamble updated doc append to file static method for compressing ipv6 addresses new cooja plugin for monitoring memory areas, similar to the log listener. Merge branch 'master' of ssh://contiki.git.sourceforge.net/gitroot/contiki/contiki no newline added by echo command using dma by default hex conversion and crc shell commands added cooja mote type using mspsim's msp430x platforms (ti's exp5438) Merge branch 'master' of ssh://contiki.git.sourceforge.net/gitroot/contiki/contiki activated exp5438 platform in cooja help method for converting from hex string to binary make clean method public public clean method, and broke out add log messages method updated to mspsims new watchpoint api new watchpoint api, and method that allows for manipulating simulation time without affecting the method that returns the next wakeup time save command history with configs method for emptying simulation event queue minor bug fix to avoid need for updating filesystem twice initially bleeding edge mspsim.jar new mspsim.jar with msp430x fix: test failed since shell echo no longer appends a newline bug fix: rpl was not included correctly more informative error messages at simulation error improved source info, added optional stack trace tooltip possibility to disable individual columns from auto-resize added stack trace method stub improved mspsim-connected regarding command handlers and context, implemented stack track method using new mspsim cli api new mspsim.jar, supporting the recent changes in bufferlistener bugfixed stacktrace tooltip avoid awt thread floods from mspsim cli output minor bugfix: side panel height was wrong when plugin started removed unnecessary overrided methods bugfix: mspsim may not have pc information, causing exception in buffer listener Merge branch 'master' of ssh://contiki.git.sourceforge.net/gitroot/contiki/contiki capturing exceptions from radio logger - some packet analyzers seems to be buggy improved code: uses log mote interfaces observers directly, instead of going via the sim event central added mote interface method to be called when add mote interfaces have been added. useful if the mote interfaces want to observe each Merge branch 'master' of ssh://contiki.git.sourceforge.net/gitroot/contiki/contiki all mote memories now support symbol addresses added support for mapping Cooja motes' and Contiki's address using memory monitor instead of previously used time events added objcopy external tools configuration implemented memory monitor support (moved previous functionality from MspMote to MspMoteMemory) added memory monitor stubs to avr memory added target to force running cooja in 64-bit mode simulating 1 ms turnaround time (before transmissions) by default, and no transmissions on channel busy updated contiki mote compiler tests to again reflect contiki-cooja-main.c and the updated ContikiMoteType added support for readonly memory sections rewrote code completely: radio medium bugfix: a combination of changing channels while radio is off and with a nearby ongoing transmission, and added missing objcopy external paths config send empty packet if node reboots during transmission removed debugging output, code style added jsyntaxpane library, to be used by MspCodeWatcher and the Contiki Test Editor plugins simplified usage of Watchpoint and WatchpointMote interfaces mspsim motes now implements new WatchpointMote interface, simplified code reworked MspCodeWatcher plugin: using jsyntaxpane to display Contiki code, using tabs instead of splitpanes, easier to using jsyntaxpane as javascript editor, added ui controls to link test scripts to a file on disk ensure mouse-triggered event popups are not outside screen, updated to use new watchpoint interface quickfix to allow running in headless mode some bugfixes regarding timeouts in test scripts, with simplified code removed debugging output code style documenting potential bug supporting multiple path substituion rules in mspcodewatcher bugfixed parsing of files read from mspsim added temporary workaround that removes file duplicates, removed warning message disable editor when no source code is showing added powertracker plugin as default cooja plugin. the powertracker plugin was previously available via contiki projects. example script demonstrating how to interface powertracker plugin added possibility to save default visualizer skins avoid exception when cooja runs in testmode bugfixed race condition removed debugging output bugfix: breakpoints should only trigger once Added new annonation with which Cooja components (e.g. mote plugins) can be activated minor bugfix: did not compile with PROCESS_CONF_NO_PROCESS_NAMES=1 Demo simulation and nightly test of rpl border router and coap rest server, based on the simulation example in resizable dialog improved debugging output default compiler set to mingw32-gcc (verified to work on version 4.5.2/4.6.2), removed obsolete -mno-cygwin flags when compiling under cygwin new experimental feature: possibility to change mote types when loading a simulation disallowed starting plugins/visualizer skins for non-compatible motes/simulations disable plugin menu items if not supported cleaned up some unnecessary methods: empty mote constructors (created from mote type), setInterfaces/setMoteType methods reverted previous patch that broke compiling on Instant Contiki bugfix in fragmentation test mode: avoid reading from outside buffer placed on stack added radio logger with 6lowpan filter cleaned up the mote type visualizer code cleaned up more mote type visualizer code using loopback as default network interface bugfix: transfer did not terminate correctly when last packet was full updated test: shell command echo no longer includes a newline -> updated expected final file size, improved debugging output increased inter-rucb-transfer delay to avoid problems in lossy networks compiling with SMALL=0 to avoid problems with Contiki's elf loader removed io.h include, now handled by Contiki to support more compilers bugfix: ptr must be preserved until psock has finished bugfix: slip must be initialized after ctimer, as it uses ctimers set loopback to default network interface, improved simulation layout updated to use the renamed examples under /examples/er-rest-example, bugfix: gui-dependency caused nullpointer exception in test mode using example-specific connect-router-cooja target, to automatically build dependencies (e.g. tunslip6) avoid gcc optimization bug by extracting struct values bugfix: control messages were lost due to lack of buffers; wait for buffer before sending added getting started quickhelp menu item, made quick help sticky simplified the external tools configuration with a single common file that is always loaded extracted quick help interface to a separate file, moved plugin-specific quick help from quickhelp.txt to the plugins themselves verify that visualizer skin is compatible with the current simulation before starting it, fixed Tools menu mnemonic (P->T) minor window title fix simplified and bugfixed Cooja's IP address interface, added two save simulation before exit renamed radio method isReceiverOn() to isRadioOn() replaced Simulation's setDelayTime(ms) method with more intuitive setSpeedLimit(ratio) bugfix: use new setSpeedLimit(ratio) method in simulation instead of old setDelayTime() Merge branch 'master' of ssh://contiki.git.sourceforge.net/gitroot/contiki/contiki added hello world simulation tests for exp5438, z1, and wismote. removed unused code including simulation observers, making the code cleaner and more efficient simplified skin menu implementation, removed unused skin button code removed unnecessary warning fixed menu bug that caused menu items to be enabled although script was active improved repaint efficiency and fixed concurrent modification bug improved workaround to disable the code editor pane's built in run functionality: remove keyboard shortcut instead of implemented zoom menu and added keyboard shortcuts added support for mote interface requirements in SupportedArguments annotation minor bugfix: start/stop simulation keyboard shortcut was not enabled correctly removed obsolete exit cooja keyboard shortcut from quick help rewrote tools menu code to allow access to mote tools directly from the main menu simplified SerialUI implementation: code was both complex, buggy and contained unused broken functionality (slip, tos mode) reverted previous plugin name changes, instead build displayed names when menu is created removed unused ipdistributor code: was previously used to assign IP addresses to simulated motes, George Oikonomou (56): Fix compile errors with SDCC sicslowpan doesn't need to remember the mac driver Reincarnate the sensinode/cc2430 port New platform: TI cc2530 Development Kit Fixed the stub-rdc driver used by various cc2x30 examples Turn off printf for sensinode examples which will otherwise not fit our flash Fixed mis-formatted printfs Some uN_t had crept back in cc2530dk and sensinode. Adjusted check to determine if we are being built with SDCC Changes to the ping part of the cc2530 and Sensinode udp-ipv6 examples Wrapped cc2x30 SOFT_RESET() macro inside do {...} while(0) We've not been using the cc2430 converter for a while now Deleted the old Sensinode 'read mac from flash' routine. Solved a text encoding issue For cc2x30, moved CLOCK_CONF_SENCOND to the cpu dir. Renamed sensinode-debug to debug Removed obsolete #if config from cc2530dk's main Renamed a config define to better match contiki's naming philosophy cc2x3x clock driver cleanup Deleted obsolete macros. Minor formatting Stack-friendly cc243x clock ISR enabled by default Comment rewording and formatting Ported the stack-friendly clock ISR code over from cc243x to cc253x The cc2530 UART driver was sending a 0 down the line on init Added an ASM(foo) macro for cc243x cc2x3x clock_delay(len) now delays for approx. len usecs Improved cc2x30 timer test examples Fixed a documentation typo Simplified the cc2530dk STARTUP_CONF_VERBOSE spaghetti and made it project-configurable The cc253x Makefile specifies SoC flavor Added support for reading MAC from the cc253x flash We can now use SDCC's __nonbanked feature The cc2530dk Makefile was adding a source twice cc2531 LED support cc2531 B1 support. B2 to come Redefined LEDS_ALL for cc2531s The cc2530dk blink-hello example now makes sense for cc2531 Platform cc2530dk now uses models.h to configure differences between the SmartRF and the 2531 USB stick cc2531 Button 2 driver cc2530dk example comment fix Offload some bytes off the cc2x3x stack for the sensinode & cc2530dk udp server example Fixed a typo which was preventing the cc253x watchdog from starting cc2530 watchdog improvements and cleanup The cc2530 button driver would fail to compile if the user disabled button support Easily configure B2 on the cc2531 USB stick as a General-Purpose or Reset button cc2530dk and Sensinode example udp server code cleanup Adjust cc2x3x ports to the new clock API Minor Sensinode build cleanup cc2x3x RPL/non-RPL handling: Fixed an SDCC compile error when UIP_CONF_ROUTER is 0. UIP_CONF_ROUTER can be configured in project-conf.h Bugfixed the cc253x UART0 init (Thanks, Deng Jian) Fixed the cc2530 RSSI adjustment Renamed a cc253x SFRX to stop namespace conflicts Bugfixed the cc2530 LOW_POWER_RX configuration Added channel_get() to the cc2x3x RF drivers Improved handling of cc2x3x rf_flags HATATANI Shinta (11): create iris directory IRIS port is working with uIPv6 Now iris port works with tunslip6 (Thanks to Suhas K) create iris directory IRIS port is working with uIPv6 Now iris port works with tunslip6 (Thanks to Suhas K) some trivial change Merge branch 'master' of https://github.com/shinta-h/contiki-iris merge iris and micaz change some examples for iris some fix Ilya Dmitrichenko (9): Simplified host OS platform detection in Makefiles Missed `ifeq ...` Added TODO note regarding flavours of Windows. Fixed TARGET=native compilation issues on Darwin. Fixed baudrate issue on Darwin. Fixed ifconfig for Darwin Use `__APPLE__` instead of `__MACH__`. Avoid deprecated error on Darwin. Fixed TARGET=minimal-net compilation issues on Darwin. Ivan Delamer (12): Fixes small bug in uip-nd6.c: when a packet is sent before DAD is Bug fix: do not overwrite NS or RA messages otherwise generated in the Compress UDP header when UIP_CONF_UDP is disabled but we are routing Improved rf230bb.c synchronization/locking. Removed unnecessary locks Do not remove infinite default routers when PROBE fails. Ignore 6LowPAN fragments which won't fit in UIP_BUFSIZE (in case Separated processed_ip_len into processed_ip_in_len and 6LowPAN: check tx result, if fail then do not send subsequent remove unnecessary stimer call in tcpip_ipv6_output() Simplified reachability detections by sending probes only in PROBE Remove compiler warning for remove_ext_header(). ATmega128RFA1 bug fix: no interrupt pin used (embedded radio). Jim Paris (38): Allow parent makefile to override these variables Use "rm -f" in clean rules to ignore errors Add script to invoke kermit with a particular port and speed Add missing type for TMR0_COMP2 Makefile cleanup. Add structure-based timer register definitions Add structure-based GPIO register definitions Fix typo -- no ROMVARS for normal targets. Remove old config.mk Pretty-print the output by default. Fix typo, used wrong name for TARGETS_WITH_ROM_VARS. Handle empty board.a (no COBJS defined) Put main dir on include path Fix #ifdefs in board files Add pin definitions for each timer, they're fixed Move startup code into its own section so the linker can place it first Remove unused code Add macro to help compute TMR.ENBL values (useful when using #defined Force linker to treat "_start" as undefined, so it pulls it in from src.a. Add structure-based CRM definitions Add cal_isr() support REF_OSC is a 32-bit number, not 64-bit number Add structure-based ITC access Register definitions: get rid of some macro magic that doesn't help much Add some useful timer macros Add rule to disassemble .o files Add TMR_ADDR helper Another rule to disassemble board objects Support hardcoded dependencies, for generated files Use a variable for all target objects Fix a makefile dependency with libraries Clear BSS at startup Move stack near BSS so it doesn't take up space in the .bin Add the disable_int({}) macro Provide a function to change timer interrrupt handlers Name the GPIO structure so we can set multiple bits at once Add gpio_set and gpio_reset Always make directories before building files in OBJDIR Joakim Eriksson (78): made rank calculation depend on selected parent when joining DAG fixed bug in coojas iphc packet analyzer added more verbose data on RPL-DIO messages fixed so that minhoprankinc is configurable fixed of0 to respect min hop rank increase added annotate when setting root and joining dag made DIO parameters configurable Merge branch 'master' of ssh://contiki.git.sourceforge.net/gitroot/contiki/contiki fixed format of transit subopt 16-bit addr compression fix minor cleanup of 16-bit compressable macro and comment reverted to byte-based iid check Merge branch '6lowpan-16bit-fix' fixed the prefix query fixed RPL statistics bug and added parent switch stats Merge branch 'master' of ssh://contiki.git.sourceforge.net/gitroot/contiki/contiki Merge branch 'master' of ssh://contiki.git.sourceforge.net/gitroot/contiki/contiki fixed so that the specified interface mac address is used when adding neighbors fixed parsing of address to handle [<addr>] Merge branch 'master' of ssh://contiki.git.sourceforge.net/gitroot/contiki/contiki fixed so that ] is accepted as end of IPv6 address added psock function for reading specified number of bytes fixed bug in 6lowpan compression when compressing fixed support for IAR compiler Merge branch 'master' of ssh://contiki.git.sourceforge.net/gitroot/contiki/contiki set expected reception sequence no to zero - to get initial connection to avoid having ack-number other than zero changed ext to link_metric fixed cpu/msp430 for compilation with IAR compiler fixed for compilation with IAR compiler Merge branch 'master' of ssh://contiki.git.sourceforge.net/gitroot/contiki/contiki fixed RPL to handle inifinite rank better Merge branch 'master' of ssh://contiki.git.sourceforge.net/gitroot/contiki/contiki fixed IAR compilation paths fixed the z1 platform and generic code used by z1 to work with IAR compiler added debug to sht11 driver and made it more configurable Merge branch 'master' of ssh://contiki.git.sourceforge.net/gitroot/contiki/contiki added delays in CC2420 to avoid risk of configuring before CC2420 is powered on improved support for IAR compiler for z1 added line to parse when receiving UDP packets fixed bug in UDP packet handling Merge branch 'master' of ssh://contiki.git.sourceforge.net/gitroot/contiki/contiki added analyzer for raw IPv6 Send DAOs if dtsn differs instead of only when larger than last dtsn in DIO Merge branch 'master' of ssh://contiki.git.sourceforge.net/gitroot/contiki/contiki fixed bug in analyzers that caused looping analyzers and exceptions fixed Sky platform for IAR compiler some fixes to cut some extension headers before TCP processing moved io and signal and IAR-GCC checks from driver files into contiki include file added static on the list send functions to get less compiler errors with IAR compiler added powertrace to IPv6 including an example fixed so that rpl avoids sending no-path DAOs when changing parent when in NO_DOWNWARD mode of operation Merge branch 'master' of ssh://contiki.git.sourceforge.net/gitroot/contiki/contiki fixed powertrace attribution for 6lowpan traffic added debug callbacks made linkable with IAR linker - avoiding multiple defs of rime_sniffer, etc Changed FRAMER to return negative values for error to allow 0 size headers. Added api for reading out tmp100 x100 temps Fixed uiplib to stop parsing IPv6 address when at length part Made native main loop sleep a bit more fixed so that it works for non IPv6 applications added parsing of frame to get receiver address, etc changed so that ext hdr len code checks against buffer size instead of link mtu added timestamp to neighbor info fixed loop detection bug in RPL fixed extension header handling increase uip buffer size for native border router fixed lollipop counter Merge branch 'master' of ssh://contiki.git.sourceforge.net/gitroot/contiki/contiki tuned RPL parameters and improved calculation of path etx Merge branch 'master' of ssh://contiki.git.sourceforge.net/gitroot/contiki/contiki always send DAO to refresh routes fixed compilation error replaced inet6 with inet for linux to get tunbridge working. Merge branch 'master' of ssh://contiki.git.sourceforge.net/gitroot/contiki/contiki added sub resource macro added config for serializing attributes quick fix for enabling native-border router to run under windows - need to cleanup the arguments * Simple JSON parser and generator. Laurent Deru (3): Sky motelist support for MacOS X Fix for baudrate and ifconfig on MacOS X Reactivate flash protection after maca init Lionel Debroux (1): Several compiler warning fixes: Mariano Alvira (561): initial commit. new makefile should let me have multiple targets changed name over to test-blink.c checkpoint... working on multiple test objects. multiple tests work now. this works, but there are unexplained things like why it can't print comment noting what I set mod and inc to. looks like the bootload needs a character delay to work reliably --- working test loopback. Baudrate value is still unexplained. baudrate mystery was my bad code. starting a rftest rx test. This will put it in the continuous receive checkpoint lots of code. Still doesn't work though. maybe the modem syn. needs to be set right. updated other tests with startup section make system is not really right... added maca files that got missed. found some magic data. best guess so far. fill with the magic data... going to try this in place of their radio next debugging steps addes a disassembly of something that works. doesn't work. best guess so far. moved ws.dis to a safer place (away from distclean) initial qemu support. initial qemu support. update with gdb instructions. update with gdb instructions. added a image of the mc13224v test to make a rom image correct memory locations -mtdblock loads an image into the ROM section. added a way to load the rom image remove debug print I need to allocate some mem for the cpu regs. note about how I'm loading in the images load memory with images directly. emulation runs correctly now. progress.. need to make distclean not delete stuff in doc ready to give this a shot. I think that does what they do except for ram_fill_init and more compact. checkpoint working on a replacment radioinit using their calls. correction my interpretaion of the get_ctov/radio_buffer_init loop was Lots of progress! working on initfromflash 9a000 is the RF_BASE, evidently. found what I need to dump, just need the addr. notes. I think that is set_power that's how you set the channel removed old table added missing semicolon found problems and fixed them. didn't actually do the last step. fixed. set channel is good. Ha! I make you work! rftest-rx is done for now. it prints out each received packet with a fixed term cmdline option this is working well Merge branch 'untested' rename ws.dis to ws-dis so distclean stops killing it. Merge branch 'untested' note about performance and suspicion that InitFromFlash is a factory notes about initfromflash. verified that there is important init in template for new nvm-read test removed dump_regs --- can add it back later if we need it. turn on thumb. untested. thumb code starts up properly now. This makefile seems to do better. ok. I think this is right. I think this dis. output is better. startup code startup with rom reserved vars and patch tables performs rom_data_init nvm read works now. full dis of init exec entry. ready to implement this now. Merge branch 'untested' initial try at init entry execution flash init --- makes them work much better. added my info to the copyright. blink blue but with the timer. initial interrupt stuff nvm source file modified at91 interrupt code from contiki to use the mc1322x registers added function sections and long-calls preliminary interrupts. looks like it is entering the isr but isn't initial isr. has problems. tmr imts works. I'm not thrilled with how the interrupts and modes are only go into usermode in the interrupt test... still sorting out the enabling thumb only enter user mode in tmr-ints. Merge branch 'untested' changed tmr test to blink purple Merge branch 'untested' better way to do irqs using weak links for individual isrs Merge branch 'untested' slight timer cleanup fixed typo --- everything still works. address for nvm write. send big packets. nvm write test this version of nvm-write works because it erases the sector first cleanup change write address to be the same as what I'm using as my RIME flash and burn first try at dual stage loading. fixed syntax errors. first try at dual stage loading. finish merge of fast with repeat with second stage loading this version of flasher works. Merge branch 'untested' of git://git.devl.org/git/malvira/mc1322x-tests into untested this version of mc1322x can flash code with flasher. Merge branch 'untested' of ssh://git.devl.org/home/malvira/git-pub/mc1322x-tests into untested flashing needs a little more time. catch the aux. send. Merge branch 'untested' of git://git.devl.org/git/malvira/mc1322x-tests into untested send aux data on the command line after writing the files. Merge branch 'untested' of ssh://git.devl.org/home/malvira/git-pub/mc1322x-tests into untested changed the test condition to match the end of the captured string. terminate extra data string with a comma for flasher.c add support for extra write data string. print appended , to the extra data clean up debug. Merge branch 'untested' of git://git.devl.org/git/malvira/mc1322x-tests into untested Merge branch 'untested' of ssh://git.devl.org/home/malvira/git-pub/mc1322x-tests into untested clean up and flash type workaround. Merge branch 'untested' of git://git.devl.org/git/malvira/mc1322x-tests into untested don't hose the cpu by using read instead of input Merge branch 'untested' of ssh://git.devl.org/home/malvira/git-pub/mc1322x-tests into untested reverting this file back to dumping the calibration section. Merge branch 'untested' of git://git.devl.org/git/malvira/mc1322x-tests into untested Merge branch 'untested' only send the aux string if there is one to send Merge branch 'untested' of ssh://git.devl.org/home/malvira/git-pub/mc1322x-tests into untested send aux string only when there is one to send Merge branch 'untested' add radio_on and radio_off. sleep tests. this test demonstrates sleeping in both hibernate and doze. added a few comments corrected comments about ram retention added crm.h from contiki Sleep works now. Make sure to turn the radio off first. longer delay when flashing seems necessary. Merge branch 'master' of git://git.devl.org/git/malvira/mc1322x-tests added a tool to enter mesh data from a RIME collect sink into rrd's update after creating a new rrd added a script that creates a webpage of all the collected data. check if $count is defined. cause TX_ON to flash when transmitting Merge branch 'master' of git://git.devl.org/git/malvira/mc1322x-tests this code starts up the 32kHZ clock more current data with hobby board. 32kHZ mode doesn't seem to use moved crm addresses to crm.h generate ctov properly. almost working. Merge branch 'master' of git://git.devl.org/git/malvira/mc1322x-tests there was an extra byte, proably because of a newline or something. offset by one for now. Works much better now. Needs more testing. updated to use the leds on the RedBee hardware and made it a little more general. Merge branch 'master' of git://git.devl.org/git/malvira/mc1322x-tests added output of rrdtool lastupdate final rftest2pcap script localtime instead of gmtime put rftests back to channel 11 Merge branch 'master' of git://git.devl.org/git/malvira/mc1322x-tests removing the old hardcoded type stuff from flasher. added error messages for file not found. Merge branch 'master' of git://git.devl.org/git/malvira/mc1322x-tests adding a test that blinks all the GPIO --- good for testing soldering Not all pins default to GPIO. Setting func_sel to 3 enables GPIO for added TODO item for XTAL_CNTL newer kernels need $ob->rts_active(1); invesitgated how OpenOCD flashing should work. a few little cleanups to the makefile clean up starting libmc1322x.a checkpoint -- reorganizing and fixing errors checkpoint Hi Mar. getting there... this is working kind of correctly. add new base makefile fix linker flags put object files in OBJDIR clean up more for now you must define BOARD. don't need entry _start set the default goal to be 'all' build libmc1322x.a clean up gpio and leds fix blink-red board.h works now led and gpio cleanup better variable defs. update blinks cleanup main makefile now running just 'make' builds all the targets for all the boards. finish blink tests force links removed extra line cleaned up uart1-loopback uart1.h need a way to run board specific lowlevel inits makefile hints clean up default_vreg_init working on nvm-read. turn on more warnings fix warnings update nvm-write update build system for board specific code that's 'local' to the place all the config into config.h config is in config.h now add romimg add flasher tmr tmr-ints sleep. cleaned up rftest-rx a little forgot to add these fix broken build system (since I moved put) cleaned up rftest-tx. overall cleanup clean the current directory also (incase mc1322x is a submodule) Add a readme to explain how to use this new build system and how to small clarifications to the README. add ref. crystal trimming. add econotag and usb boards econotag and usb boards need to fix deps and board.h link generation Merge branch 'master' of git://git.devl.org/git/malvira/libmc1322x removed bad touch auto-gen dependencies initial printf build lib with thumb add jim's map2dot tool add -Werror back it and fix all the errors. It would be nice to not unecessarily use rom data vars. better name renamed libmc1322x to lib Now you can build targets with or without the reserved ROM var space. Added ROM_VAR targets fix these for the putchr and putstr name changes updated todo list link objects in as archives so only what we need gets linked. add uart1_init to loopback test better start file correctly order the libs use printf instead of put removed old include directory. changed maca.c over to printf pulled put out of lib add command line option to set flow control mode remove put from lib convert to printf status is 16-bit fix board message add bitfield macros fill out MACA_CONTROL fields change rf_tests over to using new MACA_CONTROL fields. initial packet error rate test skeleton general header updates isr updates disable thumb for now (gdb isn't working with thumb) progress on maca overhaul more TODO items forgot to add packet.h added locking and interrupt disables. this does 127 B packets as fast as possible (with these settings). lots of fixes. this receive works add timestamps someday commented the data indication printf this receive seems to work well. this is pretty close to working together. update rftest-rx to use new maca. LEDs now indicate bit position (instead of (1 << pos)) which is more rftest-tx and refine post_tx for fast transmission condense print_packet output add an offset to packet_t to compensate for the added length byte on add the 4 byte preamble get the newlines straight in packet_print fix print_packet so that it doesn't break everything transmit at max power sort out the length details. enabled softclk timeouts post_receive still needs to timeout if it can't find any free add starting maca_isr call. first byte can't be anything you want it to be. add maca_init() use thumb again. Merge branch 'master' of git://git.devl.org/git/malvira/libmc1322x don't send ack's in rftest-tx add dir set and reset turn on tx_on handle case when buffers are full and we need to transmit. change the receive timeout to be 32 large packets implement rx callback rx callback surpress warning. faster transmit delay set the third bit to avoid acks. did something sensible to the leds removed some stale comments added interrupt based uarts. trim values for the production econotags make an empty board.a remove unused variable turn on -Werror fix radio_off for interrupts debug PRINTF fixes clear the offset when freeing a packet fix how board.a is created and linked add a way to disable FCS checking. handle empty COBJS make it work when COBJS is defined. add the submodule init. We don't need it, but people are suppose to new Makefile with errorchecks for make version number and checks that Workaround DEFAULT_GOAL so that you can use older versions of make. add PHONYs TODO: set radio modes Merge branch 'master' of git://git.devl.org/git/malvira/libmc1322x many warning cleanups. fix board.a creation: only the first COBJ would get built and added to add ftditools and Bit-Bang-MC. Right now bbmc can toggle reset on the update usage for flow control switch update usage for flow control switch finish up print and prompt device selection. fix up long types in printfs add a way to switch layouts init_phy was doing phy initialization and maca reset. maca_reset was protect set_chann... [truncated message content] |
From: Adam D. <ada...@us...> - 2012-07-16 13:25:39
|
This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "contiki". The annotated tag, 2.6-rc0 has been created at 1e48fc6c06554daaa9ca38e2975d465a39103716 (tag) tagging a3e56371a59e27f49464b41cdebc30c5e0ef00c1 (commit) tagged by Adam Dunkels on Mon Jul 16 15:24:28 2012 +0200 - Log ----------------------------------------------------------------- Version 2.6 release candidate 0 Adam Dunkels (142): Test commit test commit testing commit testing commit Yet another test commit Testing another commit Set default number of retries to 8 to make the netperf command more robust Merge branch 'master' of github.com:adamdunkels/contiki-2.x Added the low-power streaming mode where frequent channel checks are performed when streaming is on. Enabling this will (by setting WITH_STREAMING to 1), however, significantly slow down Cooja/MSPsim simulations. Added a PACKETBUF_ATTR_STREAM_END packet flag Explicitly turn LEDs off if the command is interrupted Set the end-of-stream flag on the TCP FIN packet Scripts for manipulating and calculating statistics from .csc files Rewrote the parent selection to favour parents with a low ETX and a good rank. The old parent selection would always favour parents with a lower rank, regardless of their ETX, which in some cases lead to suboptimal parent selections. Also, the old code was buggy in that it would always pick the worst parent (the one with the highest ETX). Changed the variable name local_confidence to etx to better reflect what it was used for Added a hysteresis when choosing a new parent: don't switch parent unless the ETX is significantly better (1.5 ETX better). Slight code complexity reduction Don't remove all parents that have a worse rank than an incoming DIO: we may inadvertently remove our preferred parent. Instead, remove parents with a rank that is worse than our preferred parent. If we are lucky, this will give us enough space for the new parent. Don't add neighbor as a potential parent if its rank is too high. Use DAG_RANK() macro to compute rank Changed the name of macros defined in neighbor-info.h to have the NEIGHBOR_INFO prefix. Changed the name of macros defined in neighbor-info.h to have the NEIGHBOR_INFO prefix. Changed the name of macros defined in neighbor-info.h to have the NEIGHBOR_INFO prefix. Make sure we don't remove the preferred parent Made the number of MAC sequence numbers to remember configurable Made the number of MAC sequence numbers to remember configurable; fixed bug with power attribution to the idle state. Moved the backyard/ directory to contikiprojects Merge branch 'master' of ssh://contiki.git.sourceforge.net/gitroot/contiki/contiki Added the computation of average loss rate Fixed bugs in the types to the printf arguments Merge branch 'master' of ssh://contiki.git.sourceforge.net/gitroot/contiki/contiki Bugfix: print out the correct total idle transmit and listen time Flush before computing accumulative power Bugfix: idle power consumption was sometimes misestimated for transmissions, when a duty cycle rtimer fired in the middle of a transmission Bugfix: energy consumption for retransmissions was miscounted Rime sniffers must be called for all transmissions, even if they failed, to get energy attribution right. This means that rime output sniffers now also must take the MAC transmission status as an argument. Made ContikiMAC/8 default on z1 platform; enabled power profiling by default Added a motelist target that is the same on both sky and z1 Collect view for z1 Bugfix: IPv6 address to Rime address traslation did not appear correctly in the Collect-View GUI. Bugfix: removed extreanous asterix character The Z1 platform has LEDs A significantly simpler API for sending UDP packets A significantly simpler API for sending UDP packets Merge branch 'master' of ssh://contiki.git.sourceforge.net/gitroot/contiki/contiki Example code for the simple UDP API Simulation file for the broadcast example Simulation file for the unicast example Made the simple UDP examples simpler To avoid ambiguity, address should be explicitly set by caller, not automatically by the module. Explicitly initialize module if it wasn't initialized before the first registration Update to new API Added some defensive programming Made the number of phase neighbors configurable Copyright headers Updated for git (intermediate commit - not sure this works yet!) Merge branch 'master' of ssh://contiki.git.sourceforge.net/gitroot/contiki/contiki Include stdlib.h for the NULL macro Copy the string first, since shell_output_str() does not ensure constness of the first string Don't include the deprecated netsim platform Fixed includes Fixed previously erroneously fixed include Print out sender IPv6 address when receiving data. When sending data, include a counter in the message. Removed the deprecated netsim platform. Added z1 and redbee. bugfix Minor code style fixes Made the ContikiMAC header configurable from contiki-conf.h Added a SICSLOWPAN_CONF_COMPRESSION_THRESHOLD that can be used to set a threshold under which header compression should not be used. Below this threshold, headers are not compressed but sent as full IPv6 packets. This is useful for RDC layers, such as ContikiMAC, which set a lower bound for packet size. Small spelling bugfix Use the SICSLOWPAN_CONF_COMPRESSION_THRESHOLD to avoid compressing IPv6 packets smaller than 60 bytes. This allows us to use ContikiMAC without its header, making it 802.15.4 compliant again. Cleanup of the ContikiMAC code; removed the old an unused announcement code Cleanup of the ContikiMAC code; removed the old an unused announcement code Include string header Be a little more conservative in terms of what headers not to compress Fix names of avr-raven platform Made the sky and z1 platform handling of PROJECT_CONF_H the same as the other platforms: the makefile should define PROJECT_CONF_H to be the name of the header file to include. This header file should #undef everything it #defines, as it is included after all the other configuration options in contiki-conf.h Merge branch 'master' of ssh://contiki.git.sourceforge.net/gitroot/contiki/contiki Remove debug output to save space Added a safeguard to fragmentation reassembly: if there are additional bytes in the final fragment, we shave them off in the spirit of being 'liberal in what we accept' Removed the obsolete MAC_CONF_CHANNEL_CHECK_RATE (now replaced with NETSTACK_CONF_RDC_CHANNEL_CHECK_RATE) Removed the obsolete MAC_CONF_CHANNEL_CHECK_RATE (now replaced with NETSTACK_CONF_RDC_CHANNEL_CHECK_RATE) Set default RDC wakeup rate to 8 hz Removed the obsolete MAC_CONF_CHANNEL_CHECK_RATE (now replaced with NETSTACK_CONF_RDC_CHANNEL_CHECK_RATE) Removed the obsolete MAC_CONF_CHANNEL_CHECK_RATE (now replaced with NETSTACK_CONF_RDC_CHANNEL_CHECK_RATE) Merge branch 'master' of ssh://contiki.git.sourceforge.net/gitroot/contiki/contiki If no MAC is defined, create one from the node ID Merge branch 'master' of ssh://contiki.git.sourceforge.net/gitroot/contiki/contiki Updated to use latest Rime APIs Compile with SMALL=1 to make binary fit in memory Compile with SMALL=1 to make binary fit in memory Added SMALL=1 to make code fit on Tmote Sky Merge branch 'master' of ssh://contiki.git.sourceforge.net/gitroot/contiki/contiki Bugfix: PROCESS_PAUSE() must explicitly check the event type, otherwise we may cause the process event queue to fill up if we repeatedly call PROCESS_PAUSE() while other (broadcast) events are posted as well, such as timer events. style fix; added fas check for cycle_time being a power of two or not. Removed obsolete platforms Merge branch 'master' of ssh://contiki.git.sourceforge.net/gitroot/contiki/contiki Disable phase shift correction by default Merge branch 'master' of ssh://contiki.git.sourceforge.net/gitroot/contiki/contiki Made collect retransmissions and broadcast announcements timers depend on the rdc wakeup rate Update to the newest RPL API Default to SMALL unless otherwise specified, to get size of binaries smaller so that Contiki with RPL/IPv6 fits on the Tmote Sky again. Reduce size of the neighbor table entries to make RPL fit into the Tmote Sky RAM. Contiki port to the TI EXP5438 MSP430x5438a experimenters board MSPsim with support for the MSP430x architecture Removed erroneous character from first line of file. Increased wait time between main loop polls; cleaned up the code to Contiki code style standards; moved process autostart code to after network setup simple-udp should be included in the IPv4 build as well. small code style fixes; removed left-over function call Set executable flag on binaries Set CCA threshold before starting, to make ContikiMAC more efficient. Fix compilation problem with non-IPv6 compiles. Various style fixes. Bugfix in clock_wait() declaration. Various style fixes. Refactored window title that was duplicated in multiple places General cleanup and fixes of texts and labels General cleanup and fixes of texts and labels Renamed simulation visualizers to simulation visualizers, from simulation visualizer skins Updated control panel quickhelp Ping slower to allow routes to settle Set default look and feel on Linux to Nimbus. If Nimbus is not available, Added an isRunnable() method that returns true if the simulation can be run. Updated menu item name to indicate that a window is opened when selecting it. Placed the radio medium selection in the Advanced settings frame. Close window when clicking the Save button. Fixed menu item name to be consistent with others Reimplementation of the context menu, which was difficult for newcomers to find, Set Notes window to open by default. Reimplemented the context menu, which was difficult for newcomers to find, Rewrote the context menu and the custom left pane as menus, to make the Rewrote the script editor to use real menus instead of the custom buttons Removed traffic counters from the main canvas. Rewrote the code to use real menus instead of relying on context menus for top-level operaions. Updated menu item name to indicate that a window is opened. Updated menu item name to indicate that a window is opened. Updated imports The __delay_cycles() function in the latest mspgcc takes an unsigned long argument but does not allow it to be larger than 65536. Bugfix: viewers were not correctly ticked off in the menu when a simulation was loaded from file. The current fix feels like a hack through. Rewrote the traffic history visualization with blue arrows that fade Merge branch 'master' of ssh://contiki.git.sourceforge.net/gitroot/contiki/contiki Updated file permissions Merge branch 'master' of ssh://contiki.git.sourceforge.net/gitroot/contiki/contiki Bumped version number Updated README with new website and shorter text Bumped version number Antonio Lignan (3): Squeeze websense example Add disable function to I2C driver Zolertia's light sensor ziglet David Kopf (129): Test git commit Merge branch 'master' of https://github.com/adamdunkels/contiki-2.x Test TortoiseGit commit from Vista laptop Update description of make process. Implement SRAM routine of Georg von Zengen Add RPL nodes and border router to minimal-net platform (cygwin only) Allow ipv6 builds on win32 platform. (webserver6 builds with cygwin, needs changes for VC++ compiler) Restore lines that were excluded for VC++ test build Include status cgi's with explicit define Change ctimer startup order, add multihop to wpcap and minimal-net platform. Add higher baud rates, fix occasional buffer overflow Add template for AUTOSTART_PROCESS Tag version commits and override CONTIKI_VERSION_STRING with git describe Replace WEBSERVER by AVR_WEBSERVER Clock seconds since startup on minimal-net Add WITH_WEBSERVER=<webserver> options Add /apps/webserver-nano Add file needed for rpl border router Raven-webserver needs raven-lcd-interface Fix avr progmem string accesses, add DEBUGLOGIC, configure sky defaults Add explicit RADIOSTATS to platform contiki-conf.h gcc 4.4.1 - 4.6.0 compiler bug workaround. Add Iris port of Shinta Hatatani Use PROCESS_NAME_STRING macro to handle NO_PROCESS_NAMES avr-libc %.*s workaround Add stk500 platform and changes suggested by Daniel Willmann Restore micaz/dev/clock.c, mysteriously renamed to iris/dev/sensors/battery-sensor.c Assign aaaa:: prefix if HARD_CODED_ADDRESS not defined Add gitclean and distclean options to /tools/Makefile Change timer setups for arbitrary CLOCK_CONF_SECOND Remove duplicate code block CCA measurement was always returning busy Get random seed from noisy ADC conversion at startup. Option for nested rtimer interrupts Update to proper webserver define Add changes needed for contikimac Let RPL examples enable platform RPL Free rtimer for contikimac, add print-stats option Use 128rfa1 interrupts instead of timing. Free internal webserver from dependency on /apps/webserver. [Forget to add to previous commit] Minor tweaks based on maniacbug commits. Add CONTIKI_PROJECT to the makefile, enabling make upload. Remove inclusion of preprocessor directive in macro expansion. Some gcc's do not like that. Calculate best prescaler based on F_CPU and CLOCK_CONF_SECONDS. Inspired by patch from Ivan Delamer. Apply patch of Ivan Delamer for atmega1281 @ 4 MHz Account for 16 bit rtimer wraparound, else ENERGEST way underreports AVR times. Use correct prescale factor Make comparison endian-safe, thanks Ivan. 128rfa1 cca fix, NETSTACK_RADIO.off now returns 0/1 if radio off/on More reliable webserver-nano build Add periodic prints and stack monitor Add warning about slip overrun Add timestamp option, print strings after CR Move LEDONPORTE1 define to contiki-conf.h, fixing typo. Correct typo Trap CR in framed debug string Allow selection of slip port makefsdata must be run with HTTPD_STRING_ADDR Fix typos and file endings Implement WITH_RPL option in makefile Add serial logging tool. Add settings manager with program flash defaults, random routine, periodic prints with ENERGEST, node-id. Use enumerated tx return values Refactor with params.c, h Print elf size if ELF_SIZE is defined output buffer unused at present, save some RAM This fixes commit 9a1ce7 for spaces instead of .... flash led on tcp get, fix pingbacks on rpl build, patch web data for params Adjust sleep time by ticks instead of seconds, proposed by Ivan Delamer Drop unneded null byte at end of httpd-fsdata files. Revert rules to rebuild httpd-fs.c and httpd-fsdata.c Merge branch 'master' of git://contiki.git.sourceforge.net/gitroot/contiki/contiki Add ENERGEST, RIMESTATS, COMPOWER to status page Better formatting of webserver-nano status page Add missing includes, remove unimplemented function declaration. Fix sd6 typo Use fixed font for neighbors and routes Avoid infinite loop when printing garbled packets Add streaming ajax page with csv text buffer Condense js file and hopefully convert to unix line endings. Move r.abort to stop button so IE9 can stop ajax streaming. atmega128rfa1 ajax power and sensor reporting, longint calculation bugfixes. atmega128rfa1 cca fixes, energest and rimestat macros. Reverse node_id bytes, patch from Geog von Zengen Add rtimer_arch_sleep function, enabled with RDC_CONF_MCU_SLEEP Merge branch 'master' of ssh://contiki.git.sourceforge.net/gitroot/contiki/contiki Add general unsupported interrupt vector suggested by Daniel Willmann Add Raven battery display to status page Improve rf23x cca procesing Get better random seed on startup Add params.c to Raven and sync with 128rfa1 contiki-conf.h Add RDC_CONF_HARDWARE_CSMA, RDC_CONF_HARDWARE_ACK, RDC_CONF_MCU_SLEEP, CONTIKIMAC_CONF_SHORTEST_PACKET_SIZE for use with hardware having those modes. Better fix for hardware FCS error on JTAG reset Bugfix: use 16 bit tick count to adjust clock after sleep Add optional correction for phase drift of receiver. Add 921600 baud to slip options, fix compiler warnings Add wpcap for cygwin/Windows native border router Add F_CPU=0x800000 option with phase lock to external 32768 Hz crystal Adjust cycle starts when RTIMER_ARCH_SECOND not a power of two. Access uart registers directly instead of through intermediate addresses in a RAM struct. Merge branch 'master' of github.com:contiki/contiki-mirror Merge branch 'master' of git://contiki.git.sourceforge.net/gitroot/contiki/contiki Remove unused SPI initializer flag from AVR. Comment out in the msp-430 template. Merge branch 'master' of ssh://contiki.git.sourceforge.net/gitroot/contiki/contiki rf230bb updates: involves setting the 801.15.4 pending bit, Make static buffer the default, add comments. Webserver-nano: Add page load times, remove workaround code for bug in arm strformat.c, correct the double count of leading zeros there. Fix minimal-net webserver6, broken after native border router changes. Turn off RDC before SLIP prefix interchange. Disable SIN/SUT prints, leave off-route prints. Move address initialization to after proce_init. Something in that now wiping the address array. PROGMEM changes needed for newer avr-gcc compiler Add missing mtarch_stop function Several bugfixes Add PAGETITLE option to webserver-nano, compress status page white space. Eliminate unused variable warnings. Dummy test of PT_YIELD_FLAG does not change program size. Add higher baud rates, option for link-local address assignment Redo html output, more options, httpd state variables to allow neighbors and routes to span tcp segments. Add display options to border router web page, default now uses stack instead of static buffer. Add variable update time for Ajax display. Update status.shtml with <pre> tag now used by cgi. Fix wrong register addresses. Restart ajax on changed update time, remove unused variable. RPL is now default. Change Huginn and Muninn for params.c storage Add clock_delay_us and clock_set_seconds to clock.h. Modify clock_wait to use clock_time_t. Reorder includes to prefer platform routines. Remove redundant RPL define. Ensure MAXDADNS is defined in uip-ds6.h Enable check on received length to prevent buffer overflow. Thank you Cooja! Prefer UART0 for stdout; move DEBUFGLOW macro below definition of uint8_t Patch from Landon Fuller adds const to PROGMEM, required for newer avr-gcc Enric (1): updated .gitignore with _del/ and tools/ Enric M. Calvo (47): Corrected some typos in the PORT1 ISR function. Updated *-sensor.c files from the sky platform. Merge commit 'upstreamsf/master' Added MAC overwriting/burning capability to the Z1 Updated *-sensor.c files from the sky platform. Added MAC overwriting/burning capability to the Z1 Merge branch 'master' of gi...@gi...:enricmcalvo/contiki-2.x Added Potentiometer sensor in Z1 Platform .gitignore file added Definition of Z1 Starter Platform in contiki/platforms + LEDs + Potentiometer Removed unwanted files modified .gitignore Added a quick sht11 sensor driver support for Z1 Fixed radio and contiki conf to get RIME working corrected adxl345, ISR was not disabled, now it is. optional lines in Makefile.common Set QUEUEBUF_CONF_NUM to 4 to avoid .data overflow XXX Interrupts by cc2420 & adxl345 compatible now Corrected contiki-conf.h to include project-conf.h Sky-websense compiles for Z1 (testing) Added dummy light driver. Now skywebsense likes Z1 examples/sky-shell now runs out-of-the-box on Z1 Modified contiki-conf.h and added sensys-scanner. Correceted cc2420 function calls+modified makefile Added ViewRSSI3D example. Merge branch '500-rime-examples' Cleaned up rssi-scanner example directory added example unicast with temperature added makefile added example-unicast2.c Modified Makefile and test-potent.c for ICTPWSN added mV test-battery file added example-unicast2 and 3 for ictp Merge branch 'master' of gi...@gi...:enricmcalvo/contiki-2.x M Makefile.common to add tmp102 sensor by default ICTP: lowered radio power + print unicast data added temperature-sensor to Makefile.common Added IPv6 z1-websense demo w/MSP batt&temp sensor Meaningful units for msp temp&batt sensors ictp:z1-websense with battery in mV minor tweaks to z1-websense and .gitignore modified gitignore Cleaned up z1-websense.c file Cleaned up some files, moved z1-websense example Merge branch 'master' of git://contiki.git.sourceforge.net/gitroot/contiki/contiki into master_cleanup removed modif. to sky files cleaned up main François Revol (1): Fix some typos. Fredrik Osterlind (184): LEDS_ALL configurable fixed line endings Merge branch 'refs/heads/master' of https://fro...@gi.../adamdunkels/contiki-2.x.git into HEAD example of adding cooja-platform mote interface manually support for tinyos style node ids, to simplify testbed experiments using memory breakpoints instead of polling memory region during prerequisites download info fixed line endings removed debugging output disabled tos mode for serial output (appears to be broken) + log fixed line endings only show error dialog when visualized Merge branch 'refs/heads/master' of https://fro...@gi.../adamdunkels/contiki-2.x.git into HEAD removed CVS-specific ignore files noise radio, to be observed by radio mediums doc tracked components shown in tooltip capture effect (3dB) + noise source radio support removed debugging output moved radio interface visualizer code to shared abstract radio replacing unterminated binary data with warning log message moved radio interface visualizer code to shared abstract radio implementing noise source radio include source radio when noise level changes moved radio interface visualizer code to this abstract radio handle pending simulation thread events before simulation starts, just bug fix: signal strenghts may not be registered organized imports towards importing testbed profiles into dgrm removed execute flag of source files (avoids diff problems with egit) removed obsolete leds_[color]() functions, replaced by leds_{on,off}() added simple example demonstrating user-defined timeout function get[Started]Plugin method returns plugins that end with argument + added sim and gui variables accessible from test scripts bugfix in writing tinyos addresses added clean button to compile dialog, added compilation tip tab for msp motes unregistering visualizer skin removed incorrect visualizer skin registration simplified mote selection in visualizer skins enables sharing mote-specific properties minor fix on locating config file improved api read .gz files example code for manually configuring sky motes MAC addresses added writeFile method to be used from scripts quick hack for reloading script from disk when script is activated help class that simplifies implementing serial forwarders * bugfixed and rewrote MRM to improve configurability example directional antenna try to restore edges loaded from old simulation configuration improved capture effect support in mrm: capture effect is effective if the latter transmission is stronger and no later than half the preamble updated doc append to file static method for compressing ipv6 addresses new cooja plugin for monitoring memory areas, similar to the log listener. Merge branch 'master' of ssh://contiki.git.sourceforge.net/gitroot/contiki/contiki no newline added by echo command using dma by default hex conversion and crc shell commands added cooja mote type using mspsim's msp430x platforms (ti's exp5438) Merge branch 'master' of ssh://contiki.git.sourceforge.net/gitroot/contiki/contiki activated exp5438 platform in cooja help method for converting from hex string to binary make clean method public public clean method, and broke out add log messages method updated to mspsims new watchpoint api new watchpoint api, and method that allows for manipulating simulation time without affecting the method that returns the next wakeup time save command history with configs method for emptying simulation event queue minor bug fix to avoid need for updating filesystem twice initially bleeding edge mspsim.jar new mspsim.jar with msp430x fix: test failed since shell echo no longer appends a newline bug fix: rpl was not included correctly more informative error messages at simulation error improved source info, added optional stack trace tooltip possibility to disable individual columns from auto-resize added stack trace method stub improved mspsim-connected regarding command handlers and context, implemented stack track method using new mspsim cli api new mspsim.jar, supporting the recent changes in bufferlistener bugfixed stacktrace tooltip avoid awt thread floods from mspsim cli output minor bugfix: side panel height was wrong when plugin started removed unnecessary overrided methods bugfix: mspsim may not have pc information, causing exception in buffer listener Merge branch 'master' of ssh://contiki.git.sourceforge.net/gitroot/contiki/contiki capturing exceptions from radio logger - some packet analyzers seems to be buggy improved code: uses log mote interfaces observers directly, instead of going via the sim event central added mote interface method to be called when add mote interfaces have been added. useful if the mote interfaces want to observe each Merge branch 'master' of ssh://contiki.git.sourceforge.net/gitroot/contiki/contiki all mote memories now support symbol addresses added support for mapping Cooja motes' and Contiki's address using memory monitor instead of previously used time events added objcopy external tools configuration implemented memory monitor support (moved previous functionality from MspMote to MspMoteMemory) added memory monitor stubs to avr memory added target to force running cooja in 64-bit mode simulating 1 ms turnaround time (before transmissions) by default, and no transmissions on channel busy updated contiki mote compiler tests to again reflect contiki-cooja-main.c and the updated ContikiMoteType added support for readonly memory sections rewrote code completely: radio medium bugfix: a combination of changing channels while radio is off and with a nearby ongoing transmission, and added missing objcopy external paths config send empty packet if node reboots during transmission removed debugging output, code style added jsyntaxpane library, to be used by MspCodeWatcher and the Contiki Test Editor plugins simplified usage of Watchpoint and WatchpointMote interfaces mspsim motes now implements new WatchpointMote interface, simplified code reworked MspCodeWatcher plugin: using jsyntaxpane to display Contiki code, using tabs instead of splitpanes, easier to using jsyntaxpane as javascript editor, added ui controls to link test scripts to a file on disk ensure mouse-triggered event popups are not outside screen, updated to use new watchpoint interface quickfix to allow running in headless mode some bugfixes regarding timeouts in test scripts, with simplified code removed debugging output code style documenting potential bug supporting multiple path substituion rules in mspcodewatcher bugfixed parsing of files read from mspsim added temporary workaround that removes file duplicates, removed warning message disable editor when no source code is showing added powertracker plugin as default cooja plugin. the powertracker plugin was previously available via contiki projects. example script demonstrating how to interface powertracker plugin added possibility to save default visualizer skins avoid exception when cooja runs in testmode bugfixed race condition removed debugging output bugfix: breakpoints should only trigger once Added new annonation with which Cooja components (e.g. mote plugins) can be activated minor bugfix: did not compile with PROCESS_CONF_NO_PROCESS_NAMES=1 Demo simulation and nightly test of rpl border router and coap rest server, based on the simulation example in resizable dialog improved debugging output default compiler set to mingw32-gcc (verified to work on version 4.5.2/4.6.2), removed obsolete -mno-cygwin flags when compiling under cygwin new experimental feature: possibility to change mote types when loading a simulation disallowed starting plugins/visualizer skins for non-compatible motes/simulations disable plugin menu items if not supported cleaned up some unnecessary methods: empty mote constructors (created from mote type), setInterfaces/setMoteType methods reverted previous patch that broke compiling on Instant Contiki bugfix in fragmentation test mode: avoid reading from outside buffer placed on stack added radio logger with 6lowpan filter cleaned up the mote type visualizer code cleaned up more mote type visualizer code using loopback as default network interface bugfix: transfer did not terminate correctly when last packet was full updated test: shell command echo no longer includes a newline -> updated expected final file size, improved debugging output increased inter-rucb-transfer delay to avoid problems in lossy networks compiling with SMALL=0 to avoid problems with Contiki's elf loader removed io.h include, now handled by Contiki to support more compilers bugfix: ptr must be preserved until psock has finished bugfix: slip must be initialized after ctimer, as it uses ctimers set loopback to default network interface, improved simulation layout updated to use the renamed examples under /examples/er-rest-example, bugfix: gui-dependency caused nullpointer exception in test mode using example-specific connect-router-cooja target, to automatically build dependencies (e.g. tunslip6) avoid gcc optimization bug by extracting struct values bugfix: control messages were lost due to lack of buffers; wait for buffer before sending added getting started quickhelp menu item, made quick help sticky simplified the external tools configuration with a single common file that is always loaded extracted quick help interface to a separate file, moved plugin-specific quick help from quickhelp.txt to the plugins themselves verify that visualizer skin is compatible with the current simulation before starting it, fixed Tools menu mnemonic (P->T) minor window title fix simplified and bugfixed Cooja's IP address interface, added two save simulation before exit renamed radio method isReceiverOn() to isRadioOn() replaced Simulation's setDelayTime(ms) method with more intuitive setSpeedLimit(ratio) bugfix: use new setSpeedLimit(ratio) method in simulation instead of old setDelayTime() Merge branch 'master' of ssh://contiki.git.sourceforge.net/gitroot/contiki/contiki added hello world simulation tests for exp5438, z1, and wismote. removed unused code including simulation observers, making the code cleaner and more efficient simplified skin menu implementation, removed unused skin button code removed unnecessary warning fixed menu bug that caused menu items to be enabled although script was active improved repaint efficiency and fixed concurrent modification bug improved workaround to disable the code editor pane's built in run functionality: remove keyboard shortcut instead of implemented zoom menu and added keyboard shortcuts added support for mote interface requirements in SupportedArguments annotation minor bugfix: start/stop simulation keyboard shortcut was not enabled correctly removed obsolete exit cooja keyboard shortcut from quick help rewrote tools menu code to allow access to mote tools directly from the main menu simplified SerialUI implementation: code was both complex, buggy and contained unused broken functionality (slip, tos mode) reverted previous plugin name changes, instead build displayed names when menu is created removed unused ipdistributor code: was previously used to assign IP addresses to simulated motes, George Oikonomou (56): Fix compile errors with SDCC sicslowpan doesn't need to remember the mac driver Reincarnate the sensinode/cc2430 port New platform: TI cc2530 Development Kit Fixed the stub-rdc driver used by various cc2x30 examples Turn off printf for sensinode examples which will otherwise not fit our flash Fixed mis-formatted printfs Some uN_t had crept back in cc2530dk and sensinode. Adjusted check to determine if we are being built with SDCC Changes to the ping part of the cc2530 and Sensinode udp-ipv6 examples Wrapped cc2x30 SOFT_RESET() macro inside do {...} while(0) We've not been using the cc2430 converter for a while now Deleted the old Sensinode 'read mac from flash' routine. Solved a text encoding issue For cc2x30, moved CLOCK_CONF_SENCOND to the cpu dir. Renamed sensinode-debug to debug Removed obsolete #if config from cc2530dk's main Renamed a config define to better match contiki's naming philosophy cc2x3x clock driver cleanup Deleted obsolete macros. Minor formatting Stack-friendly cc243x clock ISR enabled by default Comment rewording and formatting Ported the stack-friendly clock ISR code over from cc243x to cc253x The cc2530 UART driver was sending a 0 down the line on init Added an ASM(foo) macro for cc243x cc2x3x clock_delay(len) now delays for approx. len usecs Improved cc2x30 timer test examples Fixed a documentation typo Simplified the cc2530dk STARTUP_CONF_VERBOSE spaghetti and made it project-configurable The cc253x Makefile specifies SoC flavor Added support for reading MAC from the cc253x flash We can now use SDCC's __nonbanked feature The cc2530dk Makefile was adding a source twice cc2531 LED support cc2531 B1 support. B2 to come Redefined LEDS_ALL for cc2531s The cc2530dk blink-hello example now makes sense for cc2531 Platform cc2530dk now uses models.h to configure differences between the SmartRF and the 2531 USB stick cc2531 Button 2 driver cc2530dk example comment fix Offload some bytes off the cc2x3x stack for the sensinode & cc2530dk udp server example Fixed a typo which was preventing the cc253x watchdog from starting cc2530 watchdog improvements and cleanup The cc2530 button driver would fail to compile if the user disabled button support Easily configure B2 on the cc2531 USB stick as a General-Purpose or Reset button cc2530dk and Sensinode example udp server code cleanup Adjust cc2x3x ports to the new clock API Minor Sensinode build cleanup cc2x3x RPL/non-RPL handling: Fixed an SDCC compile error when UIP_CONF_ROUTER is 0. UIP_CONF_ROUTER can be configured in project-conf.h Bugfixed the cc253x UART0 init (Thanks, Deng Jian) Fixed the cc2530 RSSI adjustment Renamed a cc253x SFRX to stop namespace conflicts Bugfixed the cc2530 LOW_POWER_RX configuration Added channel_get() to the cc2x3x RF drivers Improved handling of cc2x3x rf_flags HATATANI Shinta (11): create iris directory IRIS port is working with uIPv6 Now iris port works with tunslip6 (Thanks to Suhas K) create iris directory IRIS port is working with uIPv6 Now iris port works with tunslip6 (Thanks to Suhas K) some trivial change Merge branch 'master' of https://github.com/shinta-h/contiki-iris merge iris and micaz change some examples for iris some fix Ilya Dmitrichenko (9): Simplified host OS platform detection in Makefiles Missed `ifeq ...` Added TODO note regarding flavours of Windows. Fixed TARGET=native compilation issues on Darwin. Fixed baudrate issue on Darwin. Fixed ifconfig for Darwin Use `__APPLE__` instead of `__MACH__`. Avoid deprecated error on Darwin. Fixed TARGET=minimal-net compilation issues on Darwin. Ivan Delamer (12): Fixes small bug in uip-nd6.c: when a packet is sent before DAD is Bug fix: do not overwrite NS or RA messages otherwise generated in the Compress UDP header when UIP_CONF_UDP is disabled but we are routing Improved rf230bb.c synchronization/locking. Removed unnecessary locks Do not remove infinite default routers when PROBE fails. Ignore 6LowPAN fragments which won't fit in UIP_BUFSIZE (in case Separated processed_ip_len into processed_ip_in_len and 6LowPAN: check tx result, if fail then do not send subsequent remove unnecessary stimer call in tcpip_ipv6_output() Simplified reachability detections by sending probes only in PROBE Remove compiler warning for remove_ext_header(). ATmega128RFA1 bug fix: no interrupt pin used (embedded radio). Jim Paris (38): Allow parent makefile to override these variables Use "rm -f" in clean rules to ignore errors Add script to invoke kermit with a particular port and speed Add missing type for TMR0_COMP2 Makefile cleanup. Add structure-based timer register definitions Add structure-based GPIO register definitions Fix typo -- no ROMVARS for normal targets. Remove old config.mk Pretty-print the output by default. Fix typo, used wrong name for TARGETS_WITH_ROM_VARS. Handle empty board.a (no COBJS defined) Put main dir on include path Fix #ifdefs in board files Add pin definitions for each timer, they're fixed Move startup code into its own section so the linker can place it first Remove unused code Add macro to help compute TMR.ENBL values (useful when using #defined Force linker to treat "_start" as undefined, so it pulls it in from src.a. Add structure-based CRM definitions Add cal_isr() support REF_OSC is a 32-bit number, not 64-bit number Add structure-based ITC access Register definitions: get rid of some macro magic that doesn't help much Add some useful timer macros Add rule to disassemble .o files Add TMR_ADDR helper Another rule to disassemble board objects Support hardcoded dependencies, for generated files Use a variable for all target objects Fix a makefile dependency with libraries Clear BSS at startup Move stack near BSS so it doesn't take up space in the .bin Add the disable_int({}) macro Provide a function to change timer interrrupt handlers Name the GPIO structure so we can set multiple bits at once Add gpio_set and gpio_reset Always make directories before building files in OBJDIR Joakim Eriksson (78): made rank calculation depend on selected parent when joining DAG fixed bug in coojas iphc packet analyzer added more verbose data on RPL-DIO messages fixed so that minhoprankinc is configurable fixed of0 to respect min hop rank increase added annotate when setting root and joining dag made DIO parameters configurable Merge branch 'master' of ssh://contiki.git.sourceforge.net/gitroot/contiki/contiki fixed format of transit subopt 16-bit addr compression fix minor cleanup of 16-bit compressable macro and comment reverted to byte-based iid check Merge branch '6lowpan-16bit-fix' fixed the prefix query fixed RPL statistics bug and added parent switch stats Merge branch 'master' of ssh://contiki.git.sourceforge.net/gitroot/contiki/contiki Merge branch 'master' of ssh://contiki.git.sourceforge.net/gitroot/contiki/contiki fixed so that the specified interface mac address is used when adding neighbors fixed parsing of address to handle [<addr>] Merge branch 'master' of ssh://contiki.git.sourceforge.net/gitroot/contiki/contiki fixed so that ] is accepted as end of IPv6 address added psock function for reading specified number of bytes fixed bug in 6lowpan compression when compressing fixed support for IAR compiler Merge branch 'master' of ssh://contiki.git.sourceforge.net/gitroot/contiki/contiki set expected reception sequence no to zero - to get initial connection to avoid having ack-number other than zero changed ext to link_metric fixed cpu/msp430 for compilation with IAR compiler fixed for compilation with IAR compiler Merge branch 'master' of ssh://contiki.git.sourceforge.net/gitroot/contiki/contiki fixed RPL to handle inifinite rank better Merge branch 'master' of ssh://contiki.git.sourceforge.net/gitroot/contiki/contiki fixed IAR compilation paths fixed the z1 platform and generic code used by z1 to work with IAR compiler added debug to sht11 driver and made it more configurable Merge branch 'master' of ssh://contiki.git.sourceforge.net/gitroot/contiki/contiki added delays in CC2420 to avoid risk of configuring before CC2420 is powered on improved support for IAR compiler for z1 added line to parse when receiving UDP packets fixed bug in UDP packet handling Merge branch 'master' of ssh://contiki.git.sourceforge.net/gitroot/contiki/contiki added analyzer for raw IPv6 Send DAOs if dtsn differs instead of only when larger than last dtsn in DIO Merge branch 'master' of ssh://contiki.git.sourceforge.net/gitroot/contiki/contiki fixed bug in analyzers that caused looping analyzers and exceptions fixed Sky platform for IAR compiler some fixes to cut some extension headers before TCP processing moved io and signal and IAR-GCC checks from driver files into contiki include file added static on the list send functions to get less compiler errors with IAR compiler added powertrace to IPv6 including an example fixed so that rpl avoids sending no-path DAOs when changing parent when in NO_DOWNWARD mode of operation Merge branch 'master' of ssh://contiki.git.sourceforge.net/gitroot/contiki/contiki fixed powertrace attribution for 6lowpan traffic added debug callbacks made linkable with IAR linker - avoiding multiple defs of rime_sniffer, etc Changed FRAMER to return negative values for error to allow 0 size headers. Added api for reading out tmp100 x100 temps Fixed uiplib to stop parsing IPv6 address when at length part Made native main loop sleep a bit more fixed so that it works for non IPv6 applications added parsing of frame to get receiver address, etc changed so that ext hdr len code checks against buffer size instead of link mtu added timestamp to neighbor info fixed loop detection bug in RPL fixed extension header handling increase uip buffer size for native border router fixed lollipop counter Merge branch 'master' of ssh://contiki.git.sourceforge.net/gitroot/contiki/contiki tuned RPL parameters and improved calculation of path etx Merge branch 'master' of ssh://contiki.git.sourceforge.net/gitroot/contiki/contiki always send DAO to refresh routes fixed compilation error replaced inet6 with inet for linux to get tunbridge working. Merge branch 'master' of ssh://contiki.git.sourceforge.net/gitroot/contiki/contiki added sub resource macro added config for serializing attributes quick fix for enabling native-border router to run under windows - need to cleanup the arguments * Simple JSON parser and generator. Laurent Deru (3): Sky motelist support for MacOS X Fix for baudrate and ifconfig on MacOS X Reactivate flash protection after maca init Lionel Debroux (1): Several compiler warning fixes: Mariano Alvira (561): initial commit. new makefile should let me have multiple targets changed name over to test-blink.c checkpoint... working on multiple test objects. multiple tests work now. this works, but there are unexplained things like why it can't print comment noting what I set mod and inc to. looks like the bootload needs a character delay to work reliably --- working test loopback. Baudrate value is still unexplained. baudrate mystery was my bad code. starting a rftest rx test. This will put it in the continuous receive checkpoint lots of code. Still doesn't work though. maybe the modem syn. needs to be set right. updated other tests with startup section make system is not really right... added maca files that got missed. found some magic data. best guess so far. fill with the magic data... going to try this in place of their radio next debugging steps addes a disassembly of something that works. doesn't work. best guess so far. moved ws.dis to a safer place (away from distclean) initial qemu support. initial qemu support. update with gdb instructions. update with gdb instructions. added a image of the mc13224v test to make a rom image correct memory locations -mtdblock loads an image into the ROM section. added a way to load the rom image remove debug print I need to allocate some mem for the cpu regs. note about how I'm loading in the images load memory with images directly. emulation runs correctly now. progress.. need to make distclean not delete stuff in doc ready to give this a shot. I think that does what they do except for ram_fill_init and more compact. checkpoint working on a replacment radioinit using their calls. correction my interpretaion of the get_ctov/radio_buffer_init loop was Lots of progress! working on initfromflash 9a000 is the RF_BASE, evidently. found what I need to dump, just need the addr. notes. I think that is set_power that's how you set the channel removed old table added missing semicolon found problems and fixed them. didn't actually do the last step. fixed. set channel is good. Ha! I make you work! rftest-rx is done for now. it prints out each received packet with a fixed term cmdline option this is working well Merge branch 'untested' rename ws.dis to ws-dis so distclean stops killing it. Merge branch 'untested' note about performance and suspicion that InitFromFlash is a factory notes about initfromflash. verified that there is important init in template for new nvm-read test removed dump_regs --- can add it back later if we need it. turn on thumb. untested. thumb code starts up properly now. This makefile seems to do better. ok. I think this is right. I think this dis. output is better. startup code startup with rom reserved vars and patch tables performs rom_data_init nvm read works now. full dis of init exec entry. ready to implement this now. Merge branch 'untested' initial try at init entry execution flash init --- makes them work much better. added my info to the copyright. blink blue but with the timer. initial interrupt stuff nvm source file modified at91 interrupt code from contiki to use the mc1322x registers added function sections and long-calls preliminary interrupts. looks like it is entering the isr but isn't initial isr. has problems. tmr imts works. I'm not thrilled with how the interrupts and modes are only go into usermode in the interrupt test... still sorting out the enabling thumb only enter user mode in tmr-ints. Merge branch 'untested' changed tmr test to blink purple Merge branch 'untested' better way to do irqs using weak links for individual isrs Merge branch 'untested' slight timer cleanup fixed typo --- everything still works. address for nvm write. send big packets. nvm write test this version of nvm-write works because it erases the sector first cleanup change write address to be the same as what I'm using as my RIME flash and burn first try at dual stage loading. fixed syntax errors. first try at dual stage loading. finish merge of fast with repeat with second stage loading this version of flasher works. Merge branch 'untested' of git://git.devl.org/git/malvira/mc1322x-tests into untested this version of mc1322x can flash code with flasher. Merge branch 'untested' of ssh://git.devl.org/home/malvira/git-pub/mc1322x-tests into untested flashing needs a little more time. catch the aux. send. Merge branch 'untested' of git://git.devl.org/git/malvira/mc1322x-tests into untested send aux data on the command line after writing the files. Merge branch 'untested' of ssh://git.devl.org/home/malvira/git-pub/mc1322x-tests into untested changed the test condition to match the end of the captured string. terminate extra data string with a comma for flasher.c add support for extra write data string. print appended , to the extra data clean up debug. Merge branch 'untested' of git://git.devl.org/git/malvira/mc1322x-tests into untested Merge branch 'untested' of ssh://git.devl.org/home/malvira/git-pub/mc1322x-tests into untested clean up and flash type workaround. Merge branch 'untested' of git://git.devl.org/git/malvira/mc1322x-tests into untested don't hose the cpu by using read instead of input Merge branch 'untested' of ssh://git.devl.org/home/malvira/git-pub/mc1322x-tests into untested reverting this file back to dumping the calibration section. Merge branch 'untested' of git://git.devl.org/git/malvira/mc1322x-tests into untested Merge branch 'untested' only send the aux string if there is one to send Merge branch 'untested' of ssh://git.devl.org/home/malvira/git-pub/mc1322x-tests into untested send aux string only when there is one to send Merge branch 'untested' add radio_on and radio_off. sleep tests. this test demonstrates sleeping in both hibernate and doze. added a few comments corrected comments about ram retention added crm.h from contiki Sleep works now. Make sure to turn the radio off first. longer delay when flashing seems necessary. Merge branch 'master' of git://git.devl.org/git/malvira/mc1322x-tests added a tool to enter mesh data from a RIME collect sink into rrd's update after creating a new rrd added a script that creates a webpage of all the collected data. check if $count is defined. cause TX_ON to flash when transmitting Merge branch 'master' of git://git.devl.org/git/malvira/mc1322x-tests this code starts up the 32kHZ clock more current data with hobby board. 32kHZ mode doesn't seem to use moved crm addresses to crm.h generate ctov properly. almost working. Merge branch 'master' of git://git.devl.org/git/malvira/mc1322x-tests there was an extra byte, proably because of a newline or something. offset by one for now. Works much better now. Needs more testing. updated to use the leds on the RedBee hardware and made it a little more general. Merge branch 'master' of git://git.devl.org/git/malvira/mc1322x-tests added output of rrdtool lastupdate final rftest2pcap script localtime instead of gmtime put rftests back to channel 11 Merge branch 'master' of git://git.devl.org/git/malvira/mc1322x-tests removing the old hardcoded type stuff from flasher. added error messages for file not found. Merge branch 'master' of git://git.devl.org/git/malvira/mc1322x-tests adding a test that blinks all the GPIO --- good for testing soldering Not all pins default to GPIO. Setting func_sel to 3 enables GPIO for added TODO item for XTAL_CNTL newer kernels need $ob->rts_active(1); invesitgated how OpenOCD flashing should work. a few little cleanups to the makefile clean up starting libmc1322x.a checkpoint -- reorganizing and fixing errors checkpoint Hi Mar. getting there... this is working kind of correctly. add new base makefile fix linker flags put object files in OBJDIR clean up more for now you must define BOARD. don't need entry _start set the default goal to be 'all' build libmc1322x.a clean up gpio and leds fix blink-red board.h works now led and gpio cleanup better variable defs. update blinks cleanup main makefile now running just 'make' builds all the targets for all the boards. finish blink tests force links removed extra line cleaned up uart1-loopback uart1.h need a way to run board specific lowlevel inits makefile hints clean up default_vreg_init working on nvm-read. turn on more warnings fix warnings update nvm-write update build system for board specific code that's 'local' to the place all the config into config.h config is in config.h now add romimg add flasher tmr tmr-ints sleep. cleaned up rftest-rx a little forgot to add these fix broken build system (since I moved put) cleaned up rftest-tx. overall cleanup clean the current directory also (incase mc1322x is a submodule) Add a readme to explain how to use this new build system and how to small clarifications to the README. add ref. crystal trimming. add econotag and usb boards econotag and usb boards need to fix deps and board.h link generation Merge branch 'master' of git://git.devl.org/git/malvira/libmc1322x removed bad touch auto-gen dependencies initial printf build lib with thumb add jim's map2dot tool add -Werror back it and fix all the errors. It would be nice to not unecessarily use rom data vars. better name renamed libmc1322x to lib Now you can build targets with or without the reserved ROM var space. Added ROM_VAR targets fix these for the putchr and putstr name changes updated todo list link objects in as archives so only what we need gets linked. add uart1_init to loopback test better start file correctly order the libs use printf instead of put removed old include directory. changed maca.c over to printf pulled put out of lib add command line option to set flow control mode remove put from lib convert to printf status is 16-bit fix board message add bitfield macros fill out MACA_CONTROL fields change rf_tests over to using new MACA_CONTROL fields. initial packet error rate test skeleton general header updates isr updates disable thumb for now (gdb isn't working with thumb) progress on maca overhaul more TODO items forgot to add packet.h added locking and interrupt disables. this does 127 B packets as fast as possible (with these settings). lots of fixes. this receive works add timestamps someday commented the data indication printf this receive seems to work well. this is pretty close to working together. update rftest-rx to use new maca. LEDs now indicate bit position (instead of (1 << pos)) which is more rftest-tx and refine post_tx for fast transmission condense print_packet output add an offset to packet_t to compensate for the added length byte on add the 4 byte preamble get the newlines straight in packet_print fix print_packet so that it doesn't break everything transmit at max power sort out the length details. enabled softclk timeouts post_receive still needs to timeout if it can't find any free add starting maca_isr call. first byte can't be anything you want it to be. add maca_init() use thumb again. Merge branch 'master' of git://git.devl.org/git/malvira/libmc1322x don't send ack's in rftest-tx add dir set and reset turn on tx_on handle case when buffers are full and we need to transmit. change the receive timeout to be 32 large packets implement rx callback rx callback surpress warning. faster transmit delay set the third bit to avoid acks. did something sensible to the leds removed some stale comments added interrupt based uarts. trim values for the production econotags make an empty board.a remove unused variable turn on -Werror fix radio_off for interrupts debug PRINTF fixes clear the offset when freeing a packet fix how board.a is created and linked add a way to disable FCS checking. handle empty COBJS make it work when COBJS is defined. add the submodule init. We don't need it, but people are suppose to new Makefile with errorchecks for make version number and checks that Workaround DEFAULT_GOAL so that you can use older versions of make. add PHONYs TODO: set radio modes Merge branch 'master' of git://git.devl.org/git/malvira/libmc1322x many warning cleanups. fix board.a creation: only the first COBJ would get built and added to add ftditools and Bit-Bang-MC. Right now bbmc can toggle reset on the update usage for flow control switch update usage for flow control switch finish up print and prompt device selection. fix up long types in printfs add a way to switch layouts init_phy was doing phy initialization and maca reset. maca_reset was... [truncated message content] |
From: Adam D. <ada...@us...> - 2012-07-12 09:35:24
|
This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "contiki". The branch, master has been updated via a3e56371a59e27f49464b41cdebc30c5e0ef00c1 (commit) via 08d854f782701f0fb5db673d49fef7bbde918b3a (commit) via dd148e1d129198afff9c1c029f228261b4d673e7 (commit) from 26a87ee9cbe4da3ddbec781270fbce09a37ccfa0 (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- commit a3e56371a59e27f49464b41cdebc30c5e0ef00c1 Author: Adam Dunkels <ad...@du...> Date: Thu Jul 12 11:33:12 2012 +0200 Bumped version number diff --git a/apps/webbrowser/http-strings b/apps/webbrowser/http-strings index f922e11..ea5ebc1 100644 --- a/apps/webbrowser/http-strings +++ b/apps/webbrowser/http-strings @@ -13,8 +13,8 @@ http_crnl "\r\n" http_index_html "/index.html" http_404_html "/404.html" http_referer "Referer:" -http_header_200 "HTTP/1.0 200 OK\r\nServer: Contiki/2.4 http://www.sics.se/contiki/\r\nConnection: close\r\n" -http_header_404 "HTTP/1.0 404 Not found\r\nServer: Contiki/2.4 http://www.sics.se/contiki/\r\nConnection: close\r\n" +http_header_200 "HTTP/1.0 200 OK\r\nServer: Contiki/2.6 http://www.contiki-os.org/\r\nConnection: close\r\n" +http_header_404 "HTTP/1.0 404 Not found\r\nServer: Contiki/2.6 http://www.contiki-os.org/\r\nConnection: close\r\n" http_content_type_plain "Content-type: text/plain\r\n\r\n" http_content_type_html "Content-type: text/html\r\n\r\n" http_content_type_css "Content-type: text/css\r\n\r\n" diff --git a/apps/webbrowser/http-strings.c b/apps/webbrowser/http-strings.c index 7c60801..968a718 100644 --- a/apps/webbrowser/http-strings.c +++ b/apps/webbrowser/http-strings.c @@ -43,12 +43,12 @@ const char http_404_html[10] = const char http_referer[9] = /* "Referer:" */ {0x52, 0x65, 0x66, 0x65, 0x72, 0x65, 0x72, 0x3a, }; -const char http_header_200[86] = -/* "HTTP/1.0 200 OK\r\nServer: Contiki/2.4 http://www.sics.se/contiki/\r\nConnection: close\r\n" */ -{0x48, 0x54, 0x54, 0x50, 0x2f, 0x31, 0x2e, 0x30, 0x20, 0x32, 0x30, 0x30, 0x20, 0x4f, 0x4b, 0xd, 0xa, 0x53, 0x65, 0x72, 0x76, 0x65, 0x72, 0x3a, 0x20, 0x43, 0x6f, 0x6e, 0x74, 0x69, 0x6b, 0x69, 0x2f, 0x32, 0x2e, 0x34, 0x20, 0x68, 0x74, 0x74, 0x70, 0x3a, 0x2f, 0x2f, 0x77, 0x77, 0x77, 0x2e, 0x73, 0x69, 0x63, 0x73, 0x2e, 0x73, 0x65, 0x2f, 0x63, 0x6f, 0x6e, 0x74, 0x69, 0x6b, 0x69, 0x2f, 0xd, 0xa, 0x43, 0x6f, 0x6e, 0x6e, 0x65, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x3a, 0x20, 0x63, 0x6c, 0x6f, 0x73, 0x65, 0xd, 0xa, }; -const char http_header_404[93] = -/* "HTTP/1.0 404 Not found\r\nServer: Contiki/2.4 http://www.sics.se/contiki/\r\nConnection: close\r\n" */ -{0x48, 0x54, 0x54, 0x50, 0x2f, 0x31, 0x2e, 0x30, 0x20, 0x34, 0x30, 0x34, 0x20, 0x4e, 0x6f, 0x74, 0x20, 0x66, 0x6f, 0x75, 0x6e, 0x64, 0xd, 0xa, 0x53, 0x65, 0x72, 0x76, 0x65, 0x72, 0x3a, 0x20, 0x43, 0x6f, 0x6e, 0x74, 0x69, 0x6b, 0x69, 0x2f, 0x32, 0x2e, 0x34, 0x20, 0x68, 0x74, 0x74, 0x70, 0x3a, 0x2f, 0x2f, 0x77, 0x77, 0x77, 0x2e, 0x73, 0x69, 0x63, 0x73, 0x2e, 0x73, 0x65, 0x2f, 0x63, 0x6f, 0x6e, 0x74, 0x69, 0x6b, 0x69, 0x2f, 0xd, 0xa, 0x43, 0x6f, 0x6e, 0x6e, 0x65, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x3a, 0x20, 0x63, 0x6c, 0x6f, 0x73, 0x65, 0xd, 0xa, }; +const char http_header_200[85] = +/* "HTTP/1.0 200 OK\r\nServer: Contiki/2.6 http://www.contiki-os.org/\r\nConnection: close\r\n" */ +{0x48, 0x54, 0x54, 0x50, 0x2f, 0x31, 0x2e, 0x30, 0x20, 0x32, 0x30, 0x30, 0x20, 0x4f, 0x4b, 0xd, 0xa, 0x53, 0x65, 0x72, 0x76, 0x65, 0x72, 0x3a, 0x20, 0x43, 0x6f, 0x6e, 0x74, 0x69, 0x6b, 0x69, 0x2f, 0x32, 0x2e, 0x36, 0x20, 0x68, 0x74, 0x74, 0x70, 0x3a, 0x2f, 0x2f, 0x77, 0x77, 0x77, 0x2e, 0x63, 0x6f, 0x6e, 0x74, 0x69, 0x6b, 0x69, 0x2d, 0x6f, 0x73, 0x2e, 0x6f, 0x72, 0x67, 0x2f, 0xd, 0xa, 0x43, 0x6f, 0x6e, 0x6e, 0x65, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x3a, 0x20, 0x63, 0x6c, 0x6f, 0x73, 0x65, 0xd, 0xa, }; +const char http_header_404[92] = +/* "HTTP/1.0 404 Not found\r\nServer: Contiki/2.6 http://www.contiki-os.org/\r\nConnection: close\r\n" */ +{0x48, 0x54, 0x54, 0x50, 0x2f, 0x31, 0x2e, 0x30, 0x20, 0x34, 0x30, 0x34, 0x20, 0x4e, 0x6f, 0x74, 0x20, 0x66, 0x6f, 0x75, 0x6e, 0x64, 0xd, 0xa, 0x53, 0x65, 0x72, 0x76, 0x65, 0x72, 0x3a, 0x20, 0x43, 0x6f, 0x6e, 0x74, 0x69, 0x6b, 0x69, 0x2f, 0x32, 0x2e, 0x36, 0x20, 0x68, 0x74, 0x74, 0x70, 0x3a, 0x2f, 0x2f, 0x77, 0x77, 0x77, 0x2e, 0x63, 0x6f, 0x6e, 0x74, 0x69, 0x6b, 0x69, 0x2d, 0x6f, 0x73, 0x2e, 0x6f, 0x72, 0x67, 0x2f, 0xd, 0xa, 0x43, 0x6f, 0x6e, 0x6e, 0x65, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x3a, 0x20, 0x63, 0x6c, 0x6f, 0x73, 0x65, 0xd, 0xa, }; const char http_content_type_plain[29] = /* "Content-type: text/plain\r\n\r\n" */ {0x43, 0x6f, 0x6e, 0x74, 0x65, 0x6e, 0x74, 0x2d, 0x74, 0x79, 0x70, 0x65, 0x3a, 0x20, 0x74, 0x65, 0x78, 0x74, 0x2f, 0x70, 0x6c, 0x61, 0x69, 0x6e, 0xd, 0xa, 0xd, 0xa, }; diff --git a/apps/webbrowser/http-strings.h b/apps/webbrowser/http-strings.h index db4b711..f197bba 100644 --- a/apps/webbrowser/http-strings.h +++ b/apps/webbrowser/http-strings.h @@ -13,8 +13,8 @@ extern const char http_crnl[3]; extern const char http_index_html[12]; extern const char http_404_html[10]; extern const char http_referer[9]; -extern const char http_header_200[86]; -extern const char http_header_404[93]; +extern const char http_header_200[85]; +extern const char http_header_404[92]; extern const char http_content_type_plain[29]; extern const char http_content_type_html[28]; extern const char http_content_type_css [27]; diff --git a/apps/webbrowser/http-user-agent-string b/apps/webbrowser/http-user-agent-string index 5fae417..ad3f0f2 100644 --- a/apps/webbrowser/http-user-agent-string +++ b/apps/webbrowser/http-user-agent-string @@ -1 +1 @@ -http_user_agent_fields "Connection: close\r\nUser-Agent: Contiki/2.2.2 (; http://www.sics.se/contiki/)\r\n\r\n" +http_user_agent_fields "Connection: close\r\nUser-Agent: Contiki/2.6 (; http://www.contiki-os.org/)\r\n\r\n" diff --git a/apps/webbrowser/http-user-agent-string.c b/apps/webbrowser/http-user-agent-string.c index 8830d56..4b0b060 100644 --- a/apps/webbrowser/http-user-agent-string.c +++ b/apps/webbrowser/http-user-agent-string.c @@ -1,3 +1,3 @@ -const char http_user_agent_fields[81] = -/* "Connection: close\r\nUser-Agent: Contiki/2.2.2 (; http://www.sics.se/contiki/)\r\n\r\n" */ -{0x43, 0x6f, 0x6e, 0x6e, 0x65, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x3a, 0x20, 0x63, 0x6c, 0x6f, 0x73, 0x65, 0xd, 0xa, 0x55, 0x73, 0x65, 0x72, 0x2d, 0x41, 0x67, 0x65, 0x6e, 0x74, 0x3a, 0x20, 0x43, 0x6f, 0x6e, 0x74, 0x69, 0x6b, 0x69, 0x2f, 0x32, 0x2e, 0x32, 0x2e, 0x32, 0x20, 0x28, 0x3b, 0x20, 0x68, 0x74, 0x74, 0x70, 0x3a, 0x2f, 0x2f, 0x77, 0x77, 0x77, 0x2e, 0x73, 0x69, 0x63, 0x73, 0x2e, 0x73, 0x65, 0x2f, 0x63, 0x6f, 0x6e, 0x74, 0x69, 0x6b, 0x69, 0x2f, 0x29, 0xd, 0xa, 0xd, 0xa, }; +const char http_user_agent_fields[78] = +/* "Connection: close\r\nUser-Agent: Contiki/2.6 (; http://www.contiki-os.org/)\r\n\r\n" */ +{0x43, 0x6f, 0x6e, 0x6e, 0x65, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x3a, 0x20, 0x63, 0x6c, 0x6f, 0x73, 0x65, 0xd, 0xa, 0x55, 0x73, 0x65, 0x72, 0x2d, 0x41, 0x67, 0x65, 0x6e, 0x74, 0x3a, 0x20, 0x43, 0x6f, 0x6e, 0x74, 0x69, 0x6b, 0x69, 0x2f, 0x32, 0x2e, 0x36, 0x20, 0x28, 0x3b, 0x20, 0x68, 0x74, 0x74, 0x70, 0x3a, 0x2f, 0x2f, 0x77, 0x77, 0x77, 0x2e, 0x63, 0x6f, 0x6e, 0x74, 0x69, 0x6b, 0x69, 0x2d, 0x6f, 0x73, 0x2e, 0x6f, 0x72, 0x67, 0x2f, 0x29, 0xd, 0xa, 0xd, 0xa, }; diff --git a/apps/webbrowser/http-user-agent-string.h b/apps/webbrowser/http-user-agent-string.h index 9f697d7..4e8cfbb 100644 --- a/apps/webbrowser/http-user-agent-string.h +++ b/apps/webbrowser/http-user-agent-string.h @@ -1 +1 @@ -extern const char http_user_agent_fields[81]; +extern const char http_user_agent_fields[78]; diff --git a/doc/Doxyfile b/doc/Doxyfile index 9d06c75..b99640f 100644 --- a/doc/Doxyfile +++ b/doc/Doxyfile @@ -3,7 +3,7 @@ #--------------------------------------------------------------------------- # Project related configuration options #--------------------------------------------------------------------------- -PROJECT_NAME = "Contiki 2.5" +PROJECT_NAME = "Contiki 2.6" PROJECT_NUMBER = OUTPUT_DIRECTORY = . CREATE_SUBDIRS = NO commit 08d854f782701f0fb5db673d49fef7bbde918b3a Author: Adam Dunkels <ad...@du...> Date: Thu Jul 12 11:30:21 2012 +0200 Updated README with new website and shorter text diff --git a/README b/README index 75e0d83..67d30c7 100644 --- a/README +++ b/README @@ -1,36 +1,16 @@ The Contiki Operating System -Contiki is an open source, highly portable, multi-tasking operating -system for memory-constrained networked embedded systems written by -Adam Dunkels at the Networked Embedded Systems group at the Swedish -Institute of Computer Science. +Contiki is an open source operating system that runs on tiny low-power +microcontrollers and makes it possible to develop applications that +make efficient use of the hardware while providing standardized +low-power wireless communication for a range of hardware platforms. -Contiki is designed for embedded systems with small amounts of -memory. A typical Contiki configuration is 2 kilobytes of RAM and 40 -kilobytes of ROM. Contiki consists of an event-driven kernel on top of -which application programs are dynamically loaded and unloaded at -runtime. Contiki processes use light-weight protothreads that provide -a linear, thread-like programming style on top of the event-driven -kernel. Contiki also supports per-process optional preemptive -multi-threading, interprocess communication using message passing -through events, as well as an optional GUI subsystem with either -direct graphic support for locally connected terminals or networked -virtual display with VNC or over Telnet. +Contiki is used in numerous commercial and non-commercial systems, +such as city sound monitoring, street lights, networked electrical +power meters, industrial monitoring, radiation monitoring, +construction site monitoring, alarm systems, remote house monitoring, +and so on. -Contiki contains two communication stacks: uIP and Rime. uIP is a -small RFC-compliant TCP/IP stack that makes it possible for Contiki to -communicate over the Internet. Rime is a lightweight communication -stack designed for low-power radios. Rime provides a wide range of -communication primitives, from best-effort local area broadcast, to -reliable multi-hop bulk data flooding. +For more information, see the Contiki website: -Contiki runs on a variety of platform ranging from embedded -microcontrollers such as the MSP430 and the AVR to old -homecomputers. Code footprint is on the order of kilobytes and memory -usage can be configured to be as low as tens of bytes. - -Contiki is written in the C programming language and is freely -available as open source under a BSD-style license. More information -about Contiki can be found at the Contiki home page: - -http://www.sics.se/contiki/ +http://www.contiki-os.org/ commit dd148e1d129198afff9c1c029f228261b4d673e7 Author: Adam Dunkels <ad...@du...> Date: Thu Jul 12 11:30:05 2012 +0200 Bumped version number diff --git a/apps/webserver/http-strings b/apps/webserver/http-strings index ff4626d..579faee 100644 --- a/apps/webserver/http-strings +++ b/apps/webserver/http-strings @@ -14,8 +14,8 @@ http_index_htm "/index.htm" http_index_html "/index.html" http_404_html "/404.html" http_referer "Referer:" -http_header_200 "HTTP/1.0 200 OK\r\nServer: Contiki/2.4 http://www.sics.se/contiki/\r\nConnection: close\r\n" -http_header_404 "HTTP/1.0 404 Not found\r\nServer: Contiki/2.4 http://www.sics.se/contiki/\r\nConnection: close\r\n" +http_header_200 "HTTP/1.0 200 OK\r\nServer: Contiki/2.6 http://www.contiki-os.org/\r\nConnection: close\r\n" +http_header_404 "HTTP/1.0 404 Not found\r\nServer: Contiki/2.6 http://www.contiki-os.org/\r\nConnection: close\r\n" http_content_type_plain "Content-type: text/plain\r\n\r\n" http_content_type_html "Content-type: text/html\r\n\r\n" http_content_type_css "Content-type: text/css\r\n\r\n" diff --git a/apps/webserver/http-strings.c b/apps/webserver/http-strings.c index 41342bd..4e22787 100644 --- a/apps/webserver/http-strings.c +++ b/apps/webserver/http-strings.c @@ -46,12 +46,12 @@ const char http_404_html[10] = const char http_referer[9] = /* "Referer:" */ {0x52, 0x65, 0x66, 0x65, 0x72, 0x65, 0x72, 0x3a, }; -const char http_header_200[86] = -/* "HTTP/1.0 200 OK\r\nServer: Contiki/2.4 http://www.sics.se/contiki/\r\nConnection: close\r\n" */ -{0x48, 0x54, 0x54, 0x50, 0x2f, 0x31, 0x2e, 0x30, 0x20, 0x32, 0x30, 0x30, 0x20, 0x4f, 0x4b, 0xd, 0xa, 0x53, 0x65, 0x72, 0x76, 0x65, 0x72, 0x3a, 0x20, 0x43, 0x6f, 0x6e, 0x74, 0x69, 0x6b, 0x69, 0x2f, 0x32, 0x2e, 0x34, 0x20, 0x68, 0x74, 0x74, 0x70, 0x3a, 0x2f, 0x2f, 0x77, 0x77, 0x77, 0x2e, 0x73, 0x69, 0x63, 0x73, 0x2e, 0x73, 0x65, 0x2f, 0x63, 0x6f, 0x6e, 0x74, 0x69, 0x6b, 0x69, 0x2f, 0xd, 0xa, 0x43, 0x6f, 0x6e, 0x6e, 0x65, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x3a, 0x20, 0x63, 0x6c, 0x6f, 0x73, 0x65, 0xd, 0xa, }; -const char http_header_404[93] = -/* "HTTP/1.0 404 Not found\r\nServer: Contiki/2.4 http://www.sics.se/contiki/\r\nConnection: close\r\n" */ -{0x48, 0x54, 0x54, 0x50, 0x2f, 0x31, 0x2e, 0x30, 0x20, 0x34, 0x30, 0x34, 0x20, 0x4e, 0x6f, 0x74, 0x20, 0x66, 0x6f, 0x75, 0x6e, 0x64, 0xd, 0xa, 0x53, 0x65, 0x72, 0x76, 0x65, 0x72, 0x3a, 0x20, 0x43, 0x6f, 0x6e, 0x74, 0x69, 0x6b, 0x69, 0x2f, 0x32, 0x2e, 0x34, 0x20, 0x68, 0x74, 0x74, 0x70, 0x3a, 0x2f, 0x2f, 0x77, 0x77, 0x77, 0x2e, 0x73, 0x69, 0x63, 0x73, 0x2e, 0x73, 0x65, 0x2f, 0x63, 0x6f, 0x6e, 0x74, 0x69, 0x6b, 0x69, 0x2f, 0xd, 0xa, 0x43, 0x6f, 0x6e, 0x6e, 0x65, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x3a, 0x20, 0x63, 0x6c, 0x6f, 0x73, 0x65, 0xd, 0xa, }; +const char http_header_200[85] = +/* "HTTP/1.0 200 OK\r\nServer: Contiki/2.6 http://www.contiki-os.org/\r\nConnection: close\r\n" */ +{0x48, 0x54, 0x54, 0x50, 0x2f, 0x31, 0x2e, 0x30, 0x20, 0x32, 0x30, 0x30, 0x20, 0x4f, 0x4b, 0xd, 0xa, 0x53, 0x65, 0x72, 0x76, 0x65, 0x72, 0x3a, 0x20, 0x43, 0x6f, 0x6e, 0x74, 0x69, 0x6b, 0x69, 0x2f, 0x32, 0x2e, 0x36, 0x20, 0x68, 0x74, 0x74, 0x70, 0x3a, 0x2f, 0x2f, 0x77, 0x77, 0x77, 0x2e, 0x63, 0x6f, 0x6e, 0x74, 0x69, 0x6b, 0x69, 0x2d, 0x6f, 0x73, 0x2e, 0x6f, 0x72, 0x67, 0x2f, 0xd, 0xa, 0x43, 0x6f, 0x6e, 0x6e, 0x65, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x3a, 0x20, 0x63, 0x6c, 0x6f, 0x73, 0x65, 0xd, 0xa, }; +const char http_header_404[92] = +/* "HTTP/1.0 404 Not found\r\nServer: Contiki/2.6 http://www.contiki-os.org/\r\nConnection: close\r\n" */ +{0x48, 0x54, 0x54, 0x50, 0x2f, 0x31, 0x2e, 0x30, 0x20, 0x34, 0x30, 0x34, 0x20, 0x4e, 0x6f, 0x74, 0x20, 0x66, 0x6f, 0x75, 0x6e, 0x64, 0xd, 0xa, 0x53, 0x65, 0x72, 0x76, 0x65, 0x72, 0x3a, 0x20, 0x43, 0x6f, 0x6e, 0x74, 0x69, 0x6b, 0x69, 0x2f, 0x32, 0x2e, 0x36, 0x20, 0x68, 0x74, 0x74, 0x70, 0x3a, 0x2f, 0x2f, 0x77, 0x77, 0x77, 0x2e, 0x63, 0x6f, 0x6e, 0x74, 0x69, 0x6b, 0x69, 0x2d, 0x6f, 0x73, 0x2e, 0x6f, 0x72, 0x67, 0x2f, 0xd, 0xa, 0x43, 0x6f, 0x6e, 0x6e, 0x65, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x3a, 0x20, 0x63, 0x6c, 0x6f, 0x73, 0x65, 0xd, 0xa, }; const char http_content_type_plain[29] = /* "Content-type: text/plain\r\n\r\n" */ {0x43, 0x6f, 0x6e, 0x74, 0x65, 0x6e, 0x74, 0x2d, 0x74, 0x79, 0x70, 0x65, 0x3a, 0x20, 0x74, 0x65, 0x78, 0x74, 0x2f, 0x70, 0x6c, 0x61, 0x69, 0x6e, 0xd, 0xa, 0xd, 0xa, }; diff --git a/apps/webserver/http-strings.h b/apps/webserver/http-strings.h index 079cbb1..35af562 100644 --- a/apps/webserver/http-strings.h +++ b/apps/webserver/http-strings.h @@ -14,8 +14,8 @@ extern const char http_index_htm[11]; extern const char http_index_html[12]; extern const char http_404_html[10]; extern const char http_referer[9]; -extern const char http_header_200[86]; -extern const char http_header_404[93]; +extern const char http_header_200[85]; +extern const char http_header_404[92]; extern const char http_content_type_plain[29]; extern const char http_content_type_html[28]; extern const char http_content_type_css [27]; diff --git a/core/contiki-version.h b/core/contiki-version.h index 146a5ae..6f0e5e2 100644 --- a/core/contiki-version.h +++ b/core/contiki-version.h @@ -36,7 +36,7 @@ #define __CONTIKI_VERSION__ #ifndef CONTIKI_VERSION_STRING -#define CONTIKI_VERSION_STRING "Contiki 2.5" +#define CONTIKI_VERSION_STRING "Contiki 2.6" #endif /* CONTIKI_VERSION_STRING */ #endif /* __CONTIKI_VERSION__ */ ----------------------------------------------------------------------- Summary of changes: README | 42 ++++++++---------------------- apps/webbrowser/http-strings | 4 +- apps/webbrowser/http-strings.c | 12 ++++---- apps/webbrowser/http-strings.h | 4 +- apps/webbrowser/http-user-agent-string | 2 +- apps/webbrowser/http-user-agent-string.c | 6 ++-- apps/webbrowser/http-user-agent-string.h | 2 +- apps/webserver/http-strings | 4 +- apps/webserver/http-strings.c | 12 ++++---- apps/webserver/http-strings.h | 4 +- core/contiki-version.h | 2 +- doc/Doxyfile | 2 +- 12 files changed, 38 insertions(+), 58 deletions(-) hooks/post-receive -- contiki |
From: George O. <oik...@us...> - 2012-07-11 10:13:26
|
This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "contiki". The branch, master has been updated via 26a87ee9cbe4da3ddbec781270fbce09a37ccfa0 (commit) via 43f279035760aa74085da5b1392166a3eb872b8b (commit) via d66241fd97122690f1ea4361b052f0f277327b11 (commit) via 62fbd389d871721f8965f43d792d103a6d7ef50b (commit) via 4b73b48f60ea9274f4a862551a242022f00908dc (commit) from 17a62a649cc80aaf606d1dbfdddf3e9fc00896f0 (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- commit 26a87ee9cbe4da3ddbec781270fbce09a37ccfa0 Author: George Oikonomou <g.o...@br...> Date: Mon Apr 30 17:21:23 2012 +0100 Improved handling of cc2x3x rf_flags diff --git a/cpu/cc2430/dev/cc2430_rf.c b/cpu/cc2430/dev/cc2430_rf.c index fa66006..5339c84 100644 --- a/cpu/cc2430/dev/cc2430_rf.c +++ b/cpu/cc2430/dev/cc2430_rf.c @@ -76,10 +76,13 @@ #define PRINTF(...) do {} while (0) #endif -#define RX_ACTIVE 0x80 -#define TX_ACK 0x40 -#define TX_ON_AIR 0x20 -#define WAS_OFF 0x10 +/* rf_flags bits */ +#define RX_ACTIVE 0x80 +#define TX_ACK 0x40 +#define TX_ON_AIR 0x20 +#define WAS_OFF 0x10 +#define INITIALISED 0x01 + #define RX_NO_DMA /* Bits of the last byte in the RX FIFO */ #define CRC_BIT_MASK 0x80 @@ -102,7 +105,6 @@ uint8_t rf_error = 0; PROCESS(cc2430_rf_process, "CC2430 RF driver"); #endif /*---------------------------------------------------------------------------*/ -static uint8_t rf_initialized = 0; static uint8_t __data rf_flags; static uint8_t rf_channel; @@ -308,7 +310,7 @@ cc2430_rf_send_ack(uint8_t pending) static int init(void) { - if(rf_initialized) { + if(rf_flags & INITIALISED) { return 0; } @@ -358,7 +360,8 @@ init(void) RF_TX_LED_OFF(); RF_RX_LED_OFF(); - rf_initialized = 1; + + rf_flags |= INITIALISED; #if !NETSTACK_CONF_SHORTCUTS process_start(&cc2430_rf_process, NULL); diff --git a/cpu/cc253x/dev/cc2530-rf.c b/cpu/cc253x/dev/cc2530-rf.c index a8c12b8..b590b7f 100644 --- a/cpu/cc253x/dev/cc2530-rf.c +++ b/cpu/cc253x/dev/cc2530-rf.c @@ -475,7 +475,7 @@ off(void) CC2530_CSP_ISRFOFF(); CC2530_CSP_ISFLUSHRX(); - rf_flags = 0; + rf_flags &= ~RX_ACTIVE; ENERGEST_OFF(ENERGEST_TYPE_LISTEN); return 1; commit 43f279035760aa74085da5b1392166a3eb872b8b Author: George Oikonomou <g.o...@br...> Date: Mon Apr 30 17:04:55 2012 +0100 Added channel_get() to the cc2x3x RF drivers diff --git a/cpu/cc2430/dev/cc2430_rf.c b/cpu/cc2430/dev/cc2430_rf.c index cbf997a..fa66006 100644 --- a/cpu/cc2430/dev/cc2430_rf.c +++ b/cpu/cc2430/dev/cc2430_rf.c @@ -104,6 +104,7 @@ PROCESS(cc2430_rf_process, "CC2430 RF driver"); /*---------------------------------------------------------------------------*/ static uint8_t rf_initialized = 0; static uint8_t __data rf_flags; +static uint8_t rf_channel; static int on(void); /* prepare() needs our prototype */ static int off(void); /* transmit() needs our prototype */ @@ -194,9 +195,17 @@ cc2430_rf_channel_set(uint8_t channel) cc2430_rf_command(ISRXON); + rf_channel = channel; + return (int8_t) channel; } /*---------------------------------------------------------------------------*/ +uint8_t +cc2430_rf_channel_get() +{ + return rf_channel; +} +/*---------------------------------------------------------------------------*/ /** * Select RF transmit power. * diff --git a/cpu/cc2430/dev/cc2430_rf.h b/cpu/cc2430/dev/cc2430_rf.h index eecb26e..9ef9497 100644 --- a/cpu/cc2430/dev/cc2430_rf.h +++ b/cpu/cc2430/dev/cc2430_rf.h @@ -74,6 +74,7 @@ extern const struct radio_driver cc2430_rf_driver; void cc2430_rf_command(uint8_t command); int8_t cc2430_rf_channel_set(uint8_t channel); +uint8_t cc2430_rf_channel_get(); uint8_t cc2430_rf_power_set(uint8_t new_power); void cc2430_rf_set_addr(unsigned pan, unsigned addr, const uint8_t *ieee_addr); diff --git a/cpu/cc253x/dev/cc2530-rf.h b/cpu/cc253x/dev/cc2530-rf.h index 397b952..9d84603 100644 --- a/cpu/cc253x/dev/cc2530-rf.h +++ b/cpu/cc253x/dev/cc2530-rf.h @@ -121,6 +121,7 @@ extern const struct radio_driver cc2530_rf_driver; /*---------------------------------------------------------------------------*/ int8_t cc2530_rf_channel_set(uint8_t channel); +#define cc2530_rf_channel_get() ((uint8_t)((FREQCTRL + 44) / 5)) uint8_t cc2530_rf_power_set(uint8_t new_power); void cc2530_rf_set_addr(uint16_t pan); /*---------------------------------------------------------------------------*/ diff --git a/examples/cc2530dk/border-router/border-router.c b/examples/cc2530dk/border-router/border-router.c index 50de646..3b6b54e 100644 --- a/examples/cc2530dk/border-router/border-router.c +++ b/examples/cc2530dk/border-router/border-router.c @@ -39,7 +39,7 @@ #include "dev/watchdog.h" #include "dev/slip.h" #include "dev/leds.h" -#include "cc253x.h" +#include "dev/cc2530-rf.h" static uint8_t prefix_set; /*---------------------------------------------------------------------------*/ @@ -116,9 +116,9 @@ PROCESS_THREAD(border_router_process, ev, data) leds_off(LEDS_GREEN); PROCESS_WAIT_EVENT_UNTIL(etimer_expired(&et)); } - + cc2530_rf_channel_get(); /* We have created a new DODAG when we reach here */ - PRINTF("On Channel %u\n", (uint8_t)((FREQCTRL + 44) / 5)); + printf("On Channel %u\n", cc2530_rf_channel_get()); print_local_addresses(); diff --git a/examples/sensinode/border-router/border-router.c b/examples/sensinode/border-router/border-router.c index 8c1e495..fb2175c 100644 --- a/examples/sensinode/border-router/border-router.c +++ b/examples/sensinode/border-router/border-router.c @@ -40,10 +40,6 @@ #include "dev/slip.h" #include "dev/leds.h" -#ifndef CC2430_RF_CONF_CHANNEL -#define CC2430_RF_CONF_CHANNEL 0xFF -#endif - static uint8_t prefix_set; /*---------------------------------------------------------------------------*/ PROCESS(border_router_process, "Border Router process"); @@ -123,7 +119,7 @@ PROCESS_THREAD(border_router_process, ev, data) } /* We have created a new DODAG when we reach here */ - PRINTF("On Channel %u\n", CC2430_RF_CONF_CHANNEL); + PRINTF("On Channel %u\n", cc2430_rf_channel_get()); print_local_addresses(); commit d66241fd97122690f1ea4361b052f0f277327b11 Author: George Oikonomou <g.o...@br...> Date: Tue Jul 10 10:54:49 2012 +0100 Bugfixed the cc2530 LOW_POWER_RX configuration Report and fix by Tom Xiao diff --git a/cpu/cc253x/dev/cc2530-rf.c b/cpu/cc253x/dev/cc2530-rf.c index dff05e2..a8c12b8 100644 --- a/cpu/cc253x/dev/cc2530-rf.c +++ b/cpu/cc253x/dev/cc2530-rf.c @@ -170,7 +170,7 @@ init(void) return 0; } -#ifdef CC2530_RF_LOW_POWER_RX +#if CC2530_RF_LOW_POWER_RX /* Reduce RX power consumption current to 20mA at the cost of sensitivity */ RXCTRL = 0x00; FSCTRL = 0x50; commit 62fbd389d871721f8965f43d792d103a6d7ef50b Author: George Oikonomou <g.o...@br...> Date: Thu Jun 21 10:50:41 2012 +0100 Renamed a cc253x SFRX to stop namespace conflicts The TR0 SFRX can not use the name TR0 because it conflicts with TCON.TR0 on the default 8051. See SDCC bug 3513300 diff --git a/cpu/cc253x/cc253x.h b/cpu/cc253x/cc253x.h index 27c022e..68bc3a2 100644 --- a/cpu/cc253x/cc253x.h +++ b/cpu/cc253x/cc253x.h @@ -349,7 +349,11 @@ SFRX(OBSSEL4, 0x6247); /* Observation output control - register 4 */ SFRX(OBSSEL5, 0x6248); /* Observation output control - register 5 */ SFRX(CHVER, 0x6249); /* Chip version */ SFRX(CHIPID, 0x624A); /* Chip identification */ -SFRX(TR0, 0x624B); /* Test register 0 */ + +/* TR0 below is renamed to TESTREG0 to avoid namespace conflicts with the + * bit-addressable TCON.TR0 on the default 8051. See SDCC bug 3513300 */ +SFRX(TESTREG0, 0x624B); /* Test register 0 */ + SFRX(DBGDATA, 0x6260); /* Debug interface write data */ SFRX(SRCRC, 0x6262); /* Sleep reset CRC */ SFRX(BATTMON, 0x6264); /* Battery monitor */ diff --git a/platform/cc2530dk/dev/adc-sensor.c b/platform/cc2530dk/dev/adc-sensor.c index 005852d..3f22c6a 100644 --- a/platform/cc2530dk/dev/adc-sensor.c +++ b/platform/cc2530dk/dev/adc-sensor.c @@ -111,7 +111,7 @@ configure(int type, int value) #if TEMP_SENSOR_ON /* Connect temperature sensor to the SoC */ ATEST = 1; - TR0 = 1; + TESTREG0 = 1; #endif APCFG = 0; /* Disables Input Channels */ break; commit 4b73b48f60ea9274f4a862551a242022f00908dc Author: George Oikonomou <g.o...@br...> Date: Wed Jun 20 11:23:52 2012 +0100 Fixed the cc2530 RSSI adjustment diff --git a/cpu/cc253x/dev/cc2530-rf.c b/cpu/cc253x/dev/cc2530-rf.c index f33d3ce..dff05e2 100644 --- a/cpu/cc253x/dev/cc2530-rf.c +++ b/cpu/cc253x/dev/cc2530-rf.c @@ -90,6 +90,8 @@ /* Bit Masks for the last byte in the RX FIFO */ #define CRC_BIT_MASK 0x80 #define LQI_BIT_MASK 0x7F +/* RSSI Offset */ +#define RSSI_OFFSET 73 /* 192 ms, radio off -> on interval */ #define ONOFF_TIME RTIMER_ARCH_SECOND / 3125 @@ -385,7 +387,7 @@ read(void *buf, unsigned short bufsize) PUTSTRING("\n"); /* Read the RSSI and CRC/Corr bytes */ - rssi = ((int8_t) RFD) - 45; + rssi = ((int8_t) RFD) - RSSI_OFFSET; crc_corr = RFD; #if CC2530_RF_CONF_HEXDUMP ----------------------------------------------------------------------- Summary of changes: cpu/cc2430/dev/cc2430_rf.c | 26 ++++++++++++++++------ cpu/cc2430/dev/cc2430_rf.h | 1 + cpu/cc253x/cc253x.h | 6 ++++- cpu/cc253x/dev/cc2530-rf.c | 8 ++++-- cpu/cc253x/dev/cc2530-rf.h | 1 + examples/cc2530dk/border-router/border-router.c | 6 ++-- examples/sensinode/border-router/border-router.c | 6 +---- platform/cc2530dk/dev/adc-sensor.c | 2 +- 8 files changed, 36 insertions(+), 20 deletions(-) hooks/post-receive -- contiki |
From: Ivan D. <ide...@us...> - 2012-07-10 20:37:24
|
This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "contiki". The branch, master has been updated via 17a62a649cc80aaf606d1dbfdddf3e9fc00896f0 (commit) from 86115a392eed9cc4c1111332b639917afc83f129 (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- commit 17a62a649cc80aaf606d1dbfdddf3e9fc00896f0 Author: Ivan Delamer <de...@in...> Date: Tue Jul 10 14:36:47 2012 -0600 ATmega128RFA1 bug fix: no interrupt pin used (embedded radio). Enabling interrupt caused MCU reset if using pin as GPIO. diff --git a/cpu/avr/radio/rf230bb/halbb.c b/cpu/avr/radio/rf230bb/halbb.c index f33660c..4b31fd9 100644 --- a/cpu/avr/radio/rf230bb/halbb.c +++ b/cpu/avr/radio/rf230bb/halbb.c @@ -217,7 +217,7 @@ hal_init(void) // TCCR1B = HAL_TCCR1B_CONFIG; /* Set clock prescaler */ // TIFR1 |= (1 << ICF1); /* Clear Input Capture Flag. */ // HAL_ENABLE_OVERFLOW_INTERRUPT(); /* Enable Timer1 overflow interrupt. */ - hal_enable_trx_interrupt(); /* Enable interrupts from the radio transceiver. */ + //hal_enable_trx_interrupt(); /* NOT USED: Enable interrupt pin from the radio transceiver. */ } #elif defined(__AVR__) ----------------------------------------------------------------------- Summary of changes: cpu/avr/radio/rf230bb/halbb.c | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-) hooks/post-receive -- contiki |
From: Nicolas T. <nv...@us...> - 2012-06-27 13:47:44
|
This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "contiki". The branch, master has been updated via 86115a392eed9cc4c1111332b639917afc83f129 (commit) via 0ba83a10df909681587ea1948dad645f0276e279 (commit) via 21f2b420906442764eb7ea5f7a472ae3a2ab2598 (commit) via 4f6fb987c31ae9dc3c3d0877a049c499d34bf66e (commit) via 66f0a1bc9580fa842fdb4d512634bdb44ff974e2 (commit) via e84d6fc6651aa7d1e5fc23fb4850aa0dcd613172 (commit) via 23cfc77218eb89aff54527dd488ee9c36b40a3fb (commit) from 51b73127e916f7112b957d101f6b54aee5dcd087 (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- commit 86115a392eed9cc4c1111332b639917afc83f129 Author: Nicolas Tsiftes <nv...@si...> Date: Wed Jun 27 15:44:53 2012 +0200 Include string.h diff --git a/examples/antelope/netdb/netdb-client.c b/examples/antelope/netdb/netdb-client.c index 59fdf92..370a40b 100644 --- a/examples/antelope/netdb/netdb-client.c +++ b/examples/antelope/netdb/netdb-client.c @@ -35,6 +35,7 @@ */ #include <stdio.h> +#include <string.h> #include "contiki.h" #include "dev/serial-line.h" commit 0ba83a10df909681587ea1948dad645f0276e279 Merge: 21f2b42 51b7312 Author: Nicolas Tsiftes <nv...@si...> Date: Wed Jun 27 15:42:51 2012 +0200 Merge branch 'master' of ssh://contiki.git.sourceforge.net/gitroot/contiki/contiki commit 21f2b420906442764eb7ea5f7a472ae3a2ab2598 Merge: 4f6fb98 37c407b Author: Nicolas Tsiftes <nv...@si...> Date: Mon Jun 11 08:01:03 2012 +0200 Merge branch 'master' of ssh://contiki.git.sourceforge.net/gitroot/contiki/contiki commit 4f6fb987c31ae9dc3c3d0877a049c499d34bf66e Author: Nicolas Tsiftes <nv...@si...> Date: Thu Jun 7 10:20:27 2012 +0200 The keyword structure can be constant. diff --git a/apps/antelope/aql-lexer.c b/apps/antelope/aql-lexer.c index 0e98584..cad604e 100644 --- a/apps/antelope/aql-lexer.c +++ b/apps/antelope/aql-lexer.c @@ -50,7 +50,7 @@ struct keyword { /* The keywords are arranged primarily by length and secondarily by expected lookup frequency. */ -static struct keyword keywords[] = { +static const struct keyword keywords[] = { {";", END}, {"(", LEFT_PAREN}, {")", RIGHT_PAREN}, commit 66f0a1bc9580fa842fdb4d512634bdb44ff974e2 Merge: e84d6fc 47db065 Author: Nicolas Tsiftes <nv...@si...> Date: Thu Jun 7 09:26:57 2012 +0200 Merge branch 'master' of ssh://contiki.git.sourceforge.net/gitroot/contiki/contiki commit e84d6fc6651aa7d1e5fc23fb4850aa0dcd613172 Author: Nicolas Tsiftes <nv...@si...> Date: Mon Jun 4 20:02:23 2012 +0200 Added default targets and removed certain C flags. diff --git a/examples/antelope/netdb/Makefile b/examples/antelope/netdb/Makefile index ca75d78..8d49a4c 100644 --- a/examples/antelope/netdb/Makefile +++ b/examples/antelope/netdb/Makefile @@ -3,4 +3,6 @@ APPS += antelope CFLAGS += -DPROJECT_CONF_H=\"project-conf.h\" SMALL = 1 +all: netdb-client netdb-server + include $(CONTIKI)/Makefile.include diff --git a/examples/antelope/shell/Makefile b/examples/antelope/shell/Makefile index 265de76..95a2d9c 100644 --- a/examples/antelope/shell/Makefile +++ b/examples/antelope/shell/Makefile @@ -2,7 +2,9 @@ CONTIKI = ../../../ APPS += antelope unit-test -CFLAGS += -Wall -g -DPROJECT_CONF_H=\"project-conf.h\" +CFLAGS += -DPROJECT_CONF_H=\"project-conf.h\" SMALL = 1 +all: shell-db + include $(CONTIKI)/Makefile.include commit 23cfc77218eb89aff54527dd488ee9c36b40a3fb Author: Nicolas Tsiftes <nv...@si...> Date: Mon Jun 4 19:44:08 2012 +0200 Removed previous language grammar. Added a parameter for the bytecode size. diff --git a/apps/antelope/aql-parser.c b/apps/antelope/aql-parser.c index eecf31f..076ae22 100644 --- a/apps/antelope/aql-parser.c +++ b/apps/antelope/aql-parser.c @@ -99,36 +99,15 @@ static const char *error_function; } \ } while(0) - -/* - * The grammar of this language is defined in Extended Backus-Naur Form, - * where capitalized strings correspond to lexical tokens defined in - * aql.h and interpreted in lexer.c. - * - * operand = LEFT_PAREN, expr, RIGHT_PAREN | INTEGER | FLOAT | - * IDENTIFIER | STRING ; - * operator = ADD | SUB | MUL | DIV ; - * expr = operand, operator, operand ; - * - * comparison-operator = GE | GEQ | LE | LEQ | EQ | NEQ ; - * comparison = expr, comparison-operator, expr ; - * condition = comparison, [(AND | OR), comparison] ; - * relation-list = IDENTIFIER, {COMMA, relation-list} ; - * attribute-list = IDENTIFIER, {COMMA, attribute-list} ; - * select = SELECT, attribute-list, FROM, relation-list, WHERE, condition, END ; - * - * value = INTEGER | FLOAT | STRING ; - * value-list = value, {COMMA, value} ; - * insert = INSERT, LEFT_PAREN, value-list, RIGHT_PAREN, INTO, IDENTIFIER, END ; - * - * sqrl = select | insert ; - */ - +/* The parsing of AQL results in this aql_adt_t object. */ static aql_adt_t *adt; +/* Conditional statements are compiled into VM bytecode, which is stored in + an instance of the LogicVM. */ static lvm_instance_t p; -static unsigned char vmcode[128]; +static unsigned char vmcode[DB_VM_BYTECODE_SIZE]; +/* Parsing functions for AQL. */ PARSER_TOKEN(cmp) { NEXT; diff --git a/apps/antelope/db-options.h b/apps/antelope/db-options.h index 7f4dce4..42d6bc3 100644 --- a/apps/antelope/db-options.h +++ b/apps/antelope/db-options.h @@ -87,6 +87,10 @@ #endif /* DB_MAX_ELEMENT_SIZE */ +#ifndef DB_VM_BYTECODE_SIZE +#define DB_VM_BYTECODE_SIZE 128 +#endif /* DB_VM_BYTECODE_SIZE */ + /* Language options. */ #ifndef AQL_MAX_QUERY_LENGTH #define AQL_MAX_QUERY_LENGTH 128 ----------------------------------------------------------------------- Summary of changes: apps/antelope/aql-lexer.c | 2 +- apps/antelope/aql-parser.c | 31 +++++-------------------------- apps/antelope/db-options.h | 4 ++++ examples/antelope/netdb/Makefile | 2 ++ examples/antelope/netdb/netdb-client.c | 1 + examples/antelope/shell/Makefile | 4 +++- 6 files changed, 16 insertions(+), 28 deletions(-) hooks/post-receive -- contiki |
From: Niclas F. <ni...@us...> - 2012-06-12 15:04:45
|
This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "contiki". The branch, master has been updated via 51b73127e916f7112b957d101f6b54aee5dcd087 (commit) via f177284a733c9a932c8a2a2fce3e1041c4ba85fe (commit) from 947f3322ba0d477fa42c4592081f74e892e40891 (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- commit 51b73127e916f7112b957d101f6b54aee5dcd087 Author: Joakim Eriksson <jo...@si...> Date: Sat Jun 2 18:24:29 2012 +0200 * Simple JSON parser and generator. * Simple HTTP webservice with support for both receiving and sending HTTP requests. * json-ws example that optionally push sensor data to COSM over IPv6. diff --git a/apps/httpd-ws/Makefile.httpd-ws b/apps/httpd-ws/Makefile.httpd-ws new file mode 100644 index 0000000..6c1bd42 --- /dev/null +++ b/apps/httpd-ws/Makefile.httpd-ws @@ -0,0 +1 @@ +httpd-ws_src = httpd-ws.c diff --git a/apps/httpd-ws/httpd-ws.c b/apps/httpd-ws/httpd-ws.c new file mode 100644 index 0000000..c282308 --- /dev/null +++ b/apps/httpd-ws/httpd-ws.c @@ -0,0 +1,478 @@ +/* + * Copyright (c) 2010-2012, Swedish Institute of Computer Science. + * 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 Institute 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 INSTITUTE 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 INSTITUTE 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. + * + * This file is part of the Contiki operating system. + */ + +/** + * \file + * A simple webserver for web services + * \author + * Adam Dunkels <ad...@si...> + * Niclas Finne <nf...@si...> + * Joakim Eriksson <jo...@si...> + */ + +#include <stdio.h> +#include <string.h> +#include <stdlib.h> + +#include "contiki-net.h" +#include "httpd-ws.h" + +#define DEBUG 0 +#if DEBUG +#define PRINTF(...) printf(__VA_ARGS__) +#else +#define PRINTF(...) +#endif + +#ifndef WEBSERVER_CONF_CFS_CONNS +#define CONNS UIP_CONNS +#else /* WEBSERVER_CONF_CFS_CONNS */ +#define CONNS WEBSERVER_CONF_CFS_CONNS +#endif /* WEBSERVER_CONF_CFS_CONNS */ + +#ifndef WEBSERVER_CONF_CFS_URLCONV +#define URLCONV 0 +#else /* WEBSERVER_CONF_CFS_URLCONV */ +#define URLCONV WEBSERVER_CONF_CFS_URLCONV +#endif /* WEBSERVER_CONF_CFS_URLCONV */ + +#if URLCONV +#include "urlconv.h" +#endif /* URLCONV */ + +static struct httpd_ws_state conns[CONNS]; + +PROCESS(httpd_ws_process, "Web server (WS)"); + +#define ISO_nl 0x0a +#define ISO_space 0x20 +#define ISO_period 0x2e +#define ISO_slash 0x2f + +uint16_t http_connections = 0; + +static const char http_10[] = " HTTP/1.0\r\n"; +static const char http_content_type[] = "Content-Type:"; +static const char http_content_type_html[] = "text/html"; +static const char http_content_len[] = "Content-Length:"; +static const char http_header_404[] = + "HTTP/1.0 404 Not found\r\nServer: Contiki\r\nConnection: close\r\n"; +static const char http_header_200[] = + "HTTP/1.0 200 OK\r\nServer: Contiki\r\nConnection: close\r\n"; +static const char html_not_found[] = + "<html><body><h1>Page not found</h1></body></html>"; +/*---------------------------------------------------------------------------*/ +/* just set all states to unused */ +static void +httpd_state_init(void) +{ + int i; + + for(i = 0; i < CONNS; i++) { + conns[i].state = HTTPD_WS_STATE_UNUSED; + } +} +/*---------------------------------------------------------------------------*/ +static struct httpd_ws_state * +httpd_state_alloc(void) +{ + int i; + + for(i = 0; i < CONNS; i++) { + if(conns[i].state == HTTPD_WS_STATE_UNUSED) { + conns[i].state = HTTPD_WS_STATE_INPUT; + return &conns[i]; + } + } + return NULL; +} +/*---------------------------------------------------------------------------*/ +#define httpd_state_free(s) (s->state = HTTPD_WS_STATE_UNUSED) +/*---------------------------------------------------------------------------*/ +static +PT_THREAD(send_string(struct httpd_ws_state *s, const char *str, uint16_t len)) +{ + PSOCK_BEGIN(&s->sout); + + SEND_STRING(&s->sout, str, len); + + PSOCK_END(&s->sout); +} +/*---------------------------------------------------------------------------*/ +static +PT_THREAD(send_headers(struct httpd_ws_state *s, const char *statushdr)) +{ + PSOCK_BEGIN(&s->sout); + + SEND_STRING(&s->sout, statushdr, strlen(statushdr)); + s->outbuf_pos = snprintf(s->outbuf, sizeof(s->outbuf), + "%s %s\r\n\r\n", http_content_type, + s->content_type == NULL + ? http_content_type_html : s->content_type); + SEND_STRING(&s->sout, s->outbuf, s->outbuf_pos); + s->outbuf_pos = 0; + + PSOCK_END(&s->sout); +} +/*---------------------------------------------------------------------------*/ +static +PT_THREAD(handle_output(struct httpd_ws_state *s)) +{ + PT_BEGIN(&s->outputpt); + + s->content_type = http_content_type_html; + s->script = httpd_ws_get_script(s); + if(s->script == NULL) { + PT_WAIT_THREAD(&s->outputpt, send_headers(s, http_header_404)); + PT_WAIT_THREAD(&s->outputpt, + send_string(s, html_not_found, strlen(html_not_found))); + uip_close(); +/* webserver_log_file(&uip_conn->ripaddr, "404 - not found"); */ + PT_EXIT(&s->outputpt); + } else { + if(s->request_type == HTTPD_WS_POST) { + /* A post has a body that needs to be read */ + s->state = HTTPD_WS_STATE_INPUT; + PT_WAIT_UNTIL(&s->outputpt, s->state == HTTPD_WS_STATE_OUTPUT); + } + PT_WAIT_THREAD(&s->outputpt, send_headers(s, http_header_200)); + PT_WAIT_THREAD(&s->outputpt, s->script(s)); + } + s->script = NULL; + PSOCK_CLOSE(&s->sout); + PT_END(&s->outputpt); +} +/*---------------------------------------------------------------------------*/ +static +PT_THREAD(handle_request(struct httpd_ws_state *s)) +{ + PT_BEGIN(&s->outputpt); + + /* send the request line */ + PT_WAIT_THREAD(&s->outputpt, + send_string(s, s->filename, strlen(s->filename))); + /* send host */ + if(s->outbuf_pos > 0) { + PT_WAIT_THREAD(&s->outputpt, send_string(s, s->outbuf, s->outbuf_pos)); + } + + if(s->content_type != NULL) { + s->outbuf_pos = snprintf(s->outbuf, sizeof(s->outbuf), "%s %s\r\n", + http_content_type, s->content_type); + PT_WAIT_THREAD(&s->outputpt, send_string(s, s->outbuf, s->outbuf_pos)); + } + /* send the extra header(s) */ + if(s->output_extra_headers != NULL) { + s->response_index = 0; + while((s->outbuf_pos = + s->output_extra_headers(s, + s->outbuf, sizeof(s->outbuf), + s->response_index)) > 0) { + PT_WAIT_THREAD(&s->outputpt, send_string(s, s->outbuf, s->outbuf_pos)); + s->response_index++; + } + } + + /* send content length */ + if(s->content_len > 0) { + s->outbuf_pos = snprintf(s->outbuf, sizeof(s->outbuf), "%s %u\r\n", + http_content_len, s->content_len); + } + /* send header separator */ + if(s->outbuf_pos + 2 < sizeof(s->outbuf)) { + s->outbuf[s->outbuf_pos++] = '\r'; + s->outbuf[s->outbuf_pos++] = '\n'; + } + PT_WAIT_THREAD(&s->outputpt, send_string(s, s->outbuf, s->outbuf_pos)); + s->outbuf_pos = 0; + + if(s->script != NULL) { + PT_WAIT_THREAD(&s->outputpt, s->script(s)); + } + s->state = HTTPD_WS_STATE_REQUEST_INPUT; + + PSOCK_CLOSE(&s->sout); + PT_END(&s->outputpt); +} +/*---------------------------------------------------------------------------*/ +static +PT_THREAD(handle_input(struct httpd_ws_state *s)) +{ + PSOCK_BEGIN(&s->sin); + PSOCK_READTO(&s->sin, ISO_space); + + if(strncmp(s->inputbuf, "GET ", 4) == 0) { + s->request_type = HTTPD_WS_GET; + } else if(strncmp(s->inputbuf, "POST ", 5) == 0) { + s->request_type = HTTPD_WS_POST; + s->content_len = 0; + } else if(strncmp(s->inputbuf, "HTTP ", 5) == 0) { + s->request_type = HTTPD_WS_RESPONSE; + } else { + PSOCK_CLOSE_EXIT(&s->sin); + } + PSOCK_READTO(&s->sin, ISO_space); + + /* TODO handle HTTP response */ + + if(s->inputbuf[0] != ISO_slash) { + PSOCK_CLOSE_EXIT(&s->sin); + } + +#if URLCONV + s->inputbuf[PSOCK_DATALEN(&s->sin) - 1] = 0; + urlconv_tofilename(s->filename, s->inputbuf, sizeof(s->filename)); +#else /* URLCONV */ + s->inputbuf[PSOCK_DATALEN(&s->sin) - 1] = 0; + snprintf(s->filename, sizeof(s->filename), "%s", s->inputbuf); +#endif /* URLCONV */ + +/* webserver_log_file(&uip_conn->ripaddr, s->filename); */ + s->state = HTTPD_WS_STATE_OUTPUT; + + while(1) { + PSOCK_READTO(&s->sin, ISO_nl); + + if(s->request_type == HTTPD_WS_POST && + strncmp(s->inputbuf, http_content_len, 15) == 0) { + s->inputbuf[PSOCK_DATALEN(&s->sin) - 2] = 0; + s->content_len = atoi(&s->inputbuf[16]); + } + + /* should have a header callback here check_header(s) */ + + if(PSOCK_DATALEN(&s->sin) > 2) { + s->inputbuf[PSOCK_DATALEN(&s->sin) - 2] = 0; + } else if(s->request_type == HTTPD_WS_POST) { + PSOCK_READBUF_LEN(&s->sin, s->content_len); + s->inputbuf[PSOCK_DATALEN(&s->sin)] = 0; + /* printf("Content: '%s'\nSize:%d\n", s->inputbuf, PSOCK_DATALEN(&s->sin)); */ + s->state = HTTPD_WS_STATE_OUTPUT; + } + } + PSOCK_END(&s->sin); +} +/*---------------------------------------------------------------------------*/ +static void +handle_connection(struct httpd_ws_state *s) +{ + if(s->state == HTTPD_WS_STATE_REQUEST_OUTPUT) { + handle_request(s); + } + handle_input(s); + if(s->state == HTTPD_WS_STATE_OUTPUT) { + handle_output(s); + } +} +/*---------------------------------------------------------------------------*/ +void +httpd_ws_appcall(void *state) +{ + struct httpd_ws_state *s = (struct httpd_ws_state *)state; + + if(uip_closed() || uip_aborted() || uip_timedout()) { + if(s != NULL) { + PRINTF("HTTPD-WS: closed/aborted (%d)\n", http_connections); + http_connections--; + httpd_state_free(s); + } else { + PRINTF("HTTPD-WS: closed/aborted ** NO HTTPD_WS_STATE!!! ** (%d)\n", + http_connections); + } + } else if(uip_connected()) { + if(s == NULL) { + s = httpd_state_alloc(); + if(s == NULL) { + uip_abort(); + PRINTF("HTTPD-WS: aborting - no resource (%d)\n", http_connections); + /* webserver_log_file(&uip_conn->ripaddr, "reset (no memory block)"); */ + return; + } + http_connections++; + + tcp_markconn(uip_conn, s); + s->state = HTTPD_WS_STATE_INPUT; + } else { + /* this is a request that is to be sent! */ + s->state = HTTPD_WS_STATE_REQUEST_OUTPUT; + } + PSOCK_INIT(&s->sin, (uint8_t *)s->inputbuf, sizeof(s->inputbuf) - 1); + PSOCK_INIT(&s->sout, (uint8_t *)s->inputbuf, sizeof(s->inputbuf) - 1); + PT_INIT(&s->outputpt); + timer_set(&s->timer, CLOCK_SECOND * 30); + handle_connection(s); + } else if(s != NULL) { + if(uip_poll()) { + if(timer_expired(&s->timer)) { + uip_abort(); + PRINTF("HTTPD-WS: aborting - http timeout (%d)\n", http_connections); + http_connections--; + httpd_state_free(s); +/* webserver_log_file(&uip_conn->ripaddr, "reset (timeout)"); */ + } else { + PRINTF("HTTPD-WS: uip-poll (%d)\n", http_connections); + } + } else { +/* PRINTF("HTTPD-WS: restart timer %s (%d)\n", s->filename, */ +/* http_connections); */ + timer_restart(&s->timer); + } + handle_connection(s); + } else { + PRINTF("HTTPD-WS: aborting - no state (%d)\n", http_connections); + uip_abort(); + } +} +/*---------------------------------------------------------------------------*/ +void +httpd_ws_init(void) +{ + tcp_listen(UIP_HTONS(80)); + httpd_state_init(); +#if URLCONV + urlconv_init(); +#endif /* URLCONV */ +} +/*---------------------------------------------------------------------------*/ +struct httpd_ws_state * +httpd_ws_request(char request_type, const char *host_ip, const char *host_hdr, + uint16_t port, const char *file, + const char *content_type, uint16_t content_len, + httpd_ws_script_t generator) +{ + struct httpd_ws_state *s; + struct uip_conn *conn; + uip_ipaddr_t *ipaddr; + uip_ipaddr_t addr; + char *request_str; + + /* First check if the host is an IP address. */ + ipaddr = &addr; + if(uiplib_ipaddrconv(host_ip, &addr) == 0) { +#if 0 && UIP_UDP + ipaddr = resolv_lookup(host_ip); + + if(ipaddr == NULL) { + return NULL; + } +#else /* UIP_UDP */ + return NULL; +#endif /* UIP_UDP */ + } + + s = httpd_state_alloc(); + if(s == NULL) { + /* no memory left... do no request... */ + return NULL; + } + http_connections++; + + switch(request_type) { + case HTTPD_WS_POST: + request_str = "POST "; + break; + case HTTPD_WS_PUT: + request_str = "PUT "; + break; + default: + request_str = "GET "; + break; + } + + s->request_type = request_type; + s->content_len = content_len; + s->content_type = content_type; + s->script = generator; + s->state = HTTPD_WS_STATE_REQUEST_OUTPUT; + + /* create a request line for a POST - should check size of it!!! */ + /* Assume post for now */ + snprintf(s->filename, sizeof(s->filename), "%s%s%s", + request_str, file, http_10); + s->outbuf_pos = snprintf(s->outbuf, sizeof(s->outbuf), "Host:%s\r\n", + host_hdr != NULL ? host_hdr : host_ip); + + PROCESS_CONTEXT_BEGIN(&httpd_ws_process); + conn = tcp_connect(ipaddr, uip_htons(port), s); + PROCESS_CONTEXT_END(&httpd_ws_process); + if(conn == NULL) { + PRINTF("HTTPD-WS: aborting... could not allocate tcp connection (%d)\n", + http_connections); + httpd_state_free(s); + http_connections--; + return NULL; + } + PRINTF("HTTPD-WS: created http connection (%d)\n", http_connections); + + return s; +} +/*---------------------------------------------------------------------------*/ +PROCESS_THREAD(httpd_ws_process, ev, data) +{ + static struct etimer et; + int i; + + PROCESS_BEGIN(); + + httpd_ws_init(); + + PRINTF("Buffer size, input %d, output\n", + HTTPD_INBUF_SIZE, HTTPD_OUTBUF_SIZE); + + /* Delay 2-4 seconds */ + etimer_set(&et, CLOCK_SECOND * 10); + + /* GC any http session that is too long lived - either because other + end never closed or if any other state cause too long lived http + sessions */ + while(1) { + PROCESS_WAIT_EVENT_UNTIL(ev == tcpip_event || etimer_expired(&et)); + if(ev == tcpip_event) { + httpd_ws_appcall(data); + } else if(etimer_expired(&et)) { + PRINTF("HTTPD States: "); + for(i = 0; i < CONNS; i++) { + PRINTF("%d ", conns[i].state); + if(conns[i].state != HTTPD_WS_STATE_UNUSED && + timer_expired(&conns[i].timer)) { + conns[i].state = HTTPD_WS_STATE_UNUSED; + PRINTF("\n*** RELEASED HTTPD Session\n"); + http_connections--; + } + } + PRINTF("\n"); + etimer_reset(&et); + } + } + + PROCESS_END(); +} +/*---------------------------------------------------------------------------*/ diff --git a/apps/httpd-ws/httpd-ws.h b/apps/httpd-ws/httpd-ws.h new file mode 100644 index 0000000..bf60df7 --- /dev/null +++ b/apps/httpd-ws/httpd-ws.h @@ -0,0 +1,125 @@ +/* + * Copyright (c) 2010-2012, Swedish Institute of Computer Science. + * 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 Institute 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 INSTITUTE 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 INSTITUTE 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. + * + * This file is part of the Contiki operating system. + */ + +/** + * \file + * A simple webserver for web services + * \author + * Adam Dunkels <ad...@si...> + * Niclas Finne <nf...@si...> + * Joakim Eriksson <jo...@si...> + */ + +#ifndef __HTTPD_WS_H__ +#define __HTTPD_WS_H__ + +#include "contiki-net.h" + +#ifndef WEBSERVER_CONF_CFS_PATHLEN +#define HTTPD_PATHLEN 80 +#else /* WEBSERVER_CONF_CFS_CONNS */ +#define HTTPD_PATHLEN WEBSERVER_CONF_CFS_PATHLEN +#endif /* WEBSERVER_CONF_CFS_CONNS */ + +#ifndef WEBSERVER_CONF_INBUF_SIZE +#define HTTPD_INBUF_SIZE (HTTPD_PATHLEN + 90) +#else /* WEBSERVER_CONF_INBUF_SIZE */ +#define HTTPD_INBUF_SIZE WEBSERVER_CONF_INBUF_SIZE +#endif /* WEBSERVER_CONF_INBUF_SIZE */ + +#if HTTPD_INBUF_SIZE < UIP_TCP_MSS || HTTPD_INBUF_SIZE < UIP_RECEIVE_WINDOW +#error HTTPD_INBUF_SIZE is too small. Must be at least a TCP window in size. +#endif + +#ifndef WEBSERVER_CONF_OUTBUF_SIZE +#define HTTPD_OUTBUF_SIZE (UIP_TCP_MSS + 20) +#else /* WEBSERVER_CONF_OUTBUF_SIZE */ +#define HTTPD_OUTBUF_SIZE WEBSERVER_CONF_OUTBUF_SIZE +#endif /* WEBSERVER_CONF_OUTBUF_SIZE */ + +struct httpd_ws_state; +typedef char (* httpd_ws_script_t)(struct httpd_ws_state *s); +typedef int (* httpd_ws_output_headers_t)(struct httpd_ws_state *s, + char *buffer, int buf_size, + int index); + +#define HTTPD_WS_GET 1 +#define HTTPD_WS_POST 2 +#define HTTPD_WS_PUT 3 +#define HTTPD_WS_RESPONSE 4 + +#define HTTPD_WS_STATE_UNUSED 0 +#define HTTPD_WS_STATE_INPUT 1 +#define HTTPD_WS_STATE_OUTPUT 2 +#define HTTPD_WS_STATE_REQUEST_OUTPUT 3 +#define HTTPD_WS_STATE_REQUEST_INPUT 4 + +struct httpd_ws_state { + struct timer timer; + struct psock sin, sout; + struct pt outputpt; + char inputbuf[HTTPD_INBUF_SIZE]; + char filename[HTTPD_PATHLEN]; + const char *content_type; + uint16_t content_len; + char outbuf[HTTPD_OUTBUF_SIZE]; + uint16_t outbuf_pos; + char state; + char request_type; + int response_index; + + httpd_ws_output_headers_t output_extra_headers; + httpd_ws_script_t script; + +#ifdef HTTPD_WS_CONF_USER_STATE + HTTPD_WS_CONF_USER_STATE; +#endif +}; + +void httpd_ws_init(void); +void httpd_ws_appcall(void *state); + +struct httpd_ws_state *httpd_ws_request(char request_type, + const char *host_ip, + const char *host_hdr, + uint16_t port, + const char *file, + const char *content_type, + uint16_t content_len, + httpd_ws_script_t generator); + +#define SEND_STRING(s, str, len) PSOCK_SEND((s), (uint8_t *)(str), (len)) + +httpd_ws_script_t httpd_ws_get_script(struct httpd_ws_state *s); + +PROCESS_NAME(httpd_ws_process); + +#endif /* __HTTPD_WS_H__ */ diff --git a/apps/json/Makefile.json b/apps/json/Makefile.json new file mode 100644 index 0000000..d6fca64 --- /dev/null +++ b/apps/json/Makefile.json @@ -0,0 +1 @@ +json_src = jsonparse.c jsontree.c diff --git a/apps/json/json.h b/apps/json/json.h new file mode 100644 index 0000000..703f6d5 --- /dev/null +++ b/apps/json/json.h @@ -0,0 +1,70 @@ +/* + * Copyright (c) 2011-2012, Swedish Institute of Computer Science. + * 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 Institute 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 INSTITUTE 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 INSTITUTE 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. + * + * This file is part of the Contiki operating system. + */ + +/** + * \file + * A few JSON defines used for parsing and generating JSON. + * \author + * Niclas Finne <nf...@si...> + * Joakim Eriksson <jo...@si...> + */ + +#ifndef __JSON_H__ +#define __JSON_H__ + +#define JSON_TYPE_ARRAY '[' +#define JSON_TYPE_OBJECT '{' +#define JSON_TYPE_PAIR ':' +#define JSON_TYPE_PAIR_NAME 'N' /* for N:V pairs */ +#define JSON_TYPE_STRING '"' +#define JSON_TYPE_INT 'I' +#define JSON_TYPE_NUMBER '0' +#define JSON_TYPE_ERROR 0 + +/* how should we handle null vs false - both can be 0? */ +#define JSON_TYPE_NULL 'n' +#define JSON_TYPE_TRUE 't' +#define JSON_TYPE_FALSE 'f' + +#define JSON_TYPE_CALLBACK 'C' + +enum { + JSON_ERROR_OK, + JSON_ERROR_SYNTAX, + JSON_ERROR_UNEXPECTED_ARRAY, + JSON_ERROR_UNEXPECTED_END_OF_ARRAY, + JSON_ERROR_UNEXPECTED_OBJECT, + JSON_ERROR_UNEXPECTED_STRING +}; + +#define JSON_CONTENT_TYPE "application/json" + +#endif /* __JSON_H__ */ diff --git a/apps/json/jsonparse.c b/apps/json/jsonparse.c new file mode 100644 index 0000000..8089ae9 --- /dev/null +++ b/apps/json/jsonparse.c @@ -0,0 +1,257 @@ +/* + * Copyright (c) 2011-2012, Swedish Institute of Computer Science. + * 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 Institute 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 INSTITUTE 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 INSTITUTE 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. + * + * This file is part of the Contiki operating system. + */ + +#include "jsonparse.h" +#include <stdlib.h> +#include <string.h> + +/*--------------------------------------------------------------------*/ +static int +push(struct jsonparse_state *state, char c) +{ + state->stack[state->depth] = c; + state->depth++; + state->vtype = 0; + return state->depth < JSONPARSE_MAX_DEPTH; +} +/*--------------------------------------------------------------------*/ +static char +pop(struct jsonparse_state *state) +{ + if(state->depth == 0) { + return JSON_TYPE_ERROR; + } + state->depth--; + return state->stack[state->depth]; +} +/*--------------------------------------------------------------------*/ +/* will pass by the value and store the start and length of the value for + atomic types */ +/*--------------------------------------------------------------------*/ +static void +atomic(struct jsonparse_state *state, char type) +{ + char c; + + state->vstart = state->pos; + state->vtype = type; + if(type == JSON_TYPE_STRING || type == JSON_TYPE_PAIR_NAME) { + while((c = state->json[state->pos++]) && c != '"') { + if(c == '\\') { + state->pos++; /* skip current char */ + } + } + state->vlen = state->pos - state->vstart - 1; + } else if(type == JSON_TYPE_NUMBER) { + do { + c = state->json[state->pos]; + if((c < '0' || c > '9') && c != '.') { + c = 0; + } else { + state->pos++; + } + } while(c); + /* need to back one step since first char is already gone */ + state->vstart--; + state->vlen = state->pos - state->vstart; + } + /* no other types for now... */ +} +/*--------------------------------------------------------------------*/ +static void +skip_ws(struct jsonparse_state *state) +{ + char c; + + while(state->pos < state->len && + ((c = state->json[state->pos]) == ' ' || c == '\n')) { + state->pos++; + } +} +/*--------------------------------------------------------------------*/ +void +jsonparse_setup(struct jsonparse_state *state, const char *json, int len) +{ + state->json = json; + state->len = len; + state->pos = 0; + state->depth = 0; + state->error = 0; + state->stack[0] = 0; +} +/*--------------------------------------------------------------------*/ +int +jsonparse_next(struct jsonparse_state *state) +{ + char c; + char s; + + skip_ws(state); + c = state->json[state->pos]; + s = jsonparse_get_type(state); + state->pos++; + + switch(c) { + case '{': + push(state, c); + return c; + case '}': + if(s == ':' && state->vtype != 0) { +/* printf("Popping vtype: '%c'\n", state->vtype); */ + pop(state); + s = jsonparse_get_type(state); + } + if(s == '{') { + pop(state); + } else { + state->error = JSON_ERROR_SYNTAX; + return JSON_TYPE_ERROR; + } + return c; + case ']': + if(s == '[') { + pop(state); + } else { + state->error = JSON_ERROR_UNEXPECTED_END_OF_ARRAY; + return JSON_TYPE_ERROR; + } + return c; + case ':': + push(state, c); + return c; + case ',': + /* if x:y ... , */ + if(s == ':' && state->vtype != 0) { + pop(state); + } else if(s == '[') { + /* ok! */ + } else { + state->error = JSON_ERROR_SYNTAX; + return JSON_TYPE_ERROR; + } + return c; + case '"': + if(s == '{' || s == '[' || s == ':') { + atomic(state, c = (s == '{' ? JSON_TYPE_PAIR_NAME : c)); + } else { + state->error = JSON_ERROR_UNEXPECTED_STRING; + return JSON_TYPE_ERROR; + } + return c; + case '[': + if(s == '{' || s == '[' || s == ':') { + push(state, c); + } else { + state->error = JSON_ERROR_UNEXPECTED_ARRAY; + return JSON_TYPE_ERROR; + } + return c; + default: + if(s == ':' || s == '[') { + if(c <= '9' && c >= '0') { + atomic(state, JSON_TYPE_NUMBER); + return JSON_TYPE_NUMBER; + } + } + } + return 0; +} +/*--------------------------------------------------------------------*/ +/* get the json value of the current position + * works only on "atomic" values such as string, number, null, false, true + */ +/*--------------------------------------------------------------------*/ +int +jsonparse_copy_value(struct jsonparse_state *state, char *str, int size) +{ + int i; + + if(state->vtype == 0) { + return 0; + } + size = size <= state->vlen ? (size - 1) : state->vlen; + for(i = 0; i < size; i++) { + str[i] = state->json[state->vstart + i]; + } + str[i] = 0; + return state->vtype; +} +/*--------------------------------------------------------------------*/ +int +jsonparse_get_value_as_int(struct jsonparse_state *state) +{ + if(state->vtype != JSON_TYPE_NUMBER) { + return 0; + } + return atoi(&state->json[state->vstart]); +} +/*--------------------------------------------------------------------*/ +long +jsonparse_get_value_as_long(struct jsonparse_state *state) +{ + if(state->vtype != JSON_TYPE_NUMBER) { + return 0; + } + return atol(&state->json[state->vstart]); +} +/*--------------------------------------------------------------------*/ +/* strcmp - assume no strange chars that needs to be stuffed in string... */ +/*--------------------------------------------------------------------*/ +int +jsonparse_strcmp_value(struct jsonparse_state *state, const char *str) +{ + if(state->vtype == 0) { + return -1; + } + return strncmp(str, &state->json[state->vstart], state->vlen); +} +/*--------------------------------------------------------------------*/ +int +jsonparse_get_len(struct jsonparse_state *state) +{ + return state->vlen; +} +/*--------------------------------------------------------------------*/ +int +jsonparse_get_type(struct jsonparse_state *state) +{ + if(state->depth == 0) { + return 0; + } + return state->stack[state->depth - 1]; +} +/*--------------------------------------------------------------------*/ +int +jsonparse_has_next(struct jsonparse_state *state) +{ + return state->pos < state->len; +} +/*--------------------------------------------------------------------*/ diff --git a/apps/json/jsonparse.h b/apps/json/jsonparse.h new file mode 100644 index 0000000..3821b67 --- /dev/null +++ b/apps/json/jsonparse.h @@ -0,0 +1,91 @@ +/* + * Copyright (c) 2011-2012, Swedish Institute of Computer Science. + * 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 Institute 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 INSTITUTE 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 INSTITUTE 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. + * + * This file is part of the Contiki operating system. + */ + +#ifndef __JSONPARSE_H__ +#define __JSONPARSE_H__ + +#include "contiki-conf.h" +#include "json.h" + +#ifdef JSONPARSE_CONF_MAX_DEPTH +#define JSONPARSE_MAX_DEPTH JSONPARSE_CONF_MAX_DEPTH +#else +#define JSONPARSE_MAX_DEPTH 10 +#endif + +struct jsonparse_state { + const char *json; + int pos; + int len; + int depth; + /* for handling atomic values */ + int vstart; + int vlen; + char vtype; + char error; + char stack[JSONPARSE_MAX_DEPTH]; +}; + +/** + * \brief Initialize a JSON parser state. + * \param state A pointer to a JSON parser state + * \param json The string to parse as JSON + * \param len The length of the string to parse + * + * This function initializes a JSON parser state for + * parsing a string as JSON. + */ +void jsonparse_setup(struct jsonparse_state *state, const char *json, + int len); + +/* move to next JSON element */ +int jsonparse_next(struct jsonparse_state *state); + +/* copy the current JSON value into the specified buffer */ +int jsonparse_copy_value(struct jsonparse_state *state, char *buf, + int buf_size); + +/* get the current JSON value parsed as an int */ +int jsonparse_get_value_as_int(struct jsonparse_state *state); + +/* get the current JSON value parsed as a long */ +long jsonparse_get_value_as_long(struct jsonparse_state *state); + +/* get the length of the current JSON value */ +int jsonparse_get_len(struct jsonparse_state *state); + +/* get the type of the current JSON value */ +int jsonparse_get_type(struct jsonparse_state *state); + +/* compare the JSON value with the specified string */ +int jsonparse_strcmp_value(struct jsonparse_state *state, const char *str); + +#endif /* __JSONPARSE_H__ */ diff --git a/apps/json/jsontree.c b/apps/json/jsontree.c new file mode 100644 index 0000000..45f3058 --- /dev/null +++ b/apps/json/jsontree.c @@ -0,0 +1,275 @@ +/* + * Copyright (c) 2011-2012, Swedish Institute of Computer Science. + * 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 Institute 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 INSTITUTE 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 INSTITUTE 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. + * + * This file is part of the Contiki operating system. + */ + +/** + * \file + * JSON output generation + * \author + * Niclas Finne <nf...@si...> + * Joakim Eriksson <jo...@si...> + */ + +#include "contiki.h" +#include "jsontree.h" +#include "jsonparse.h" +#include <string.h> + +#define DEBUG 0 +#if DEBUG +#include <stdio.h> +#define PRINTF(...) printf(__VA_ARGS__) +#else +#define PRINTF(...) +#endif + +/*---------------------------------------------------------------------------*/ +void +jsontree_write_atom(const struct jsontree_context *js_ctx, const char *text) +{ + if(text == NULL) { + js_ctx->putchar('0'); + } else { + while(*text != '\0') { + js_ctx->putchar(*text++); + } + } +} +/*---------------------------------------------------------------------------*/ +void +jsontree_write_string(const struct jsontree_context *js_ctx, const char *text) +{ + js_ctx->putchar('"'); + if(text != NULL) { + while(*text != '\0') { + if(*text == '"') { + js_ctx->putchar('\\'); + } + js_ctx->putchar(*text++); + } + } + js_ctx->putchar('"'); +} +/*---------------------------------------------------------------------------*/ +void +jsontree_write_int(const struct jsontree_context *js_ctx, int value) +{ + char buf[10]; + int l; + + if(value < 0) { + js_ctx->putchar('-'); + value = -value; + } + + l = sizeof(buf) - 1; + do { + buf[l--] = '0' + (value % 10); + value /= 10; + } while(value > 0 && l >= 0); + + while(++l < sizeof(buf)) { + js_ctx->putchar(buf[l]); + } +} +/*---------------------------------------------------------------------------*/ +void +jsontree_setup(struct jsontree_context *js_ctx, struct jsontree_value *root, + int (* putchar)(int)) +{ + js_ctx->values[0] = root; + js_ctx->putchar = putchar; + js_ctx->path = 0; + jsontree_reset(js_ctx); +} +/*---------------------------------------------------------------------------*/ +void +jsontree_reset(struct jsontree_context *js_ctx) +{ + js_ctx->depth = 0; + js_ctx->index[0] = 0; +} +/*---------------------------------------------------------------------------*/ +const char * +jsontree_path_name(const struct jsontree_context *js_ctx, int depth) +{ + if(depth < js_ctx->depth && js_ctx->values[depth]->type == JSON_TYPE_OBJECT) { + return ((struct jsontree_object *)js_ctx->values[depth])-> + pairs[js_ctx->index[depth]].name; + } + return ""; +} +/*---------------------------------------------------------------------------*/ +int +jsontree_print_next(struct jsontree_context *js_ctx) +{ + struct jsontree_value *v; + int index; + + v = js_ctx->values[js_ctx->depth]; + + /* Default operation after switch is to back up one level */ + switch(v->type) { + case JSON_TYPE_OBJECT: + case JSON_TYPE_ARRAY: { + struct jsontree_array *o = (struct jsontree_array *)v; + struct jsontree_value *ov; + + index = js_ctx->index[js_ctx->depth]; + if(index == 0) { + js_ctx->putchar(v->type); + js_ctx->putchar('\n'); + } + if(index >= o->count) { + js_ctx->putchar('\n'); + js_ctx->putchar(v->type + 2); + /* Default operation: back up one level! */ + break; + } + + if(index > 0) { + js_ctx->putchar(','); + js_ctx->putchar('\n'); + } + if(v->type == JSON_TYPE_OBJECT) { + jsontree_write_string(js_ctx, + ((struct jsontree_object *)o)->pairs[index].name); + js_ctx->putchar(':'); + ov = ((struct jsontree_object *)o)->pairs[index].value; + } else { + ov = o->values[index]; + } + /* TODO check max depth */ + js_ctx->depth++; /* step down to value... */ + js_ctx->index[js_ctx->depth] = 0; /* and init index */ + js_ctx->values[js_ctx->depth] = ov; + /* Continue on this new level */ + return 1; + } + case JSON_TYPE_STRING: + jsontree_write_string(js_ctx, ((struct jsontree_string *)v)->value); + /* Default operation: back up one level! */ + break; + case JSON_TYPE_INT: + jsontree_write_int(js_ctx, ((struct jsontree_int *)v)->value); + /* Default operation: back up one level! */ + break; + case JSON_TYPE_CALLBACK: { /* pre-formatted json string currently */ + struct jsontree_callback *callback; + + callback = (struct jsontree_callback *)v; + if(js_ctx->index[js_ctx->depth] == 0) { + /* First call: reset the callback status */ + js_ctx->callback_state = 0; + } + if(callback->output == NULL) { + jsontree_write_string(js_ctx, ""); + } else if(callback->output(js_ctx)) { + /* The callback wants to output more */ + js_ctx->index[js_ctx->depth]++; + return 1; + } + /* Default operation: back up one level! */ + break; + } + default: + PRINTF("\nError: Illegal json type:'%c'\n", v->type); + return 0; + } + /* Done => back up one level! */ + if(js_ctx->depth > 0) { + js_ctx->depth--; + js_ctx->index[js_ctx->depth]++; + return 1; + } + return 0; +} +/*---------------------------------------------------------------------------*/ +static struct jsontree_value * +find_next(struct jsontree_context *js_ctx) +{ + struct jsontree_value *v; + int index; + + do { + v = js_ctx->values[js_ctx->depth]; + + /* Default operation after switch is to back up one level */ + switch(v->type) { + case JSON_TYPE_OBJECT: + case JSON_TYPE_ARRAY: { + struct jsontree_array *o = (struct jsontree_array *)v; + struct jsontree_value *ov; + + index = js_ctx->index[js_ctx->depth]; + if(index >= o->count) { + /* Default operation: back up one level! */ + break; + } + + if(v->type == JSON_TYPE_OBJECT) { + ov = ((struct jsontree_object *)o)->pairs[index].value; + } else { + ov = o->values[index]; + } + /* TODO check max depth */ + js_ctx->depth++; /* step down to value... */ + js_ctx->index[js_ctx->depth] = 0; /* and init index */ + js_ctx->values[js_ctx->depth] = ov; + /* Continue on this new level */ + return ov; + } + default: + /* Default operation: back up one level! */ + break; + } + /* Done => back up one level! */ + if(js_ctx->depth > 0) { + js_ctx->depth--; + js_ctx->index[js_ctx->depth]++; + } else { + return NULL; + } + } while(1); +} +/*---------------------------------------------------------------------------*/ +struct jsontree_value * +jsontree_find_next(struct jsontree_context *js_ctx, int type) +{ + struct jsontree_value *v; + + while((v = find_next(js_ctx)) != NULL && v->type != type && + js_ctx->path < js_ctx->depth) { + /* search */ + } + js_ctx->callback_state = 0; + return js_ctx->path < js_ctx->depth ? v : NULL; +} +/*---------------------------------------------------------------------------*/ diff --git a/apps/json/jsontree.h b/apps/json/jsontree.h new file mode 100644 index 0000000..8e2a112 --- /dev/null +++ b/apps/json/jsontree.h @@ -0,0 +1,135 @@ +/* + * Copyright (c) 2011-2012, Swedish Institute of Computer Science. + * 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 Institute 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 INSTITUTE 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 INSTITUTE 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. + * + * This file is part of the Contiki operating system. + */ + +/** + * \file + * JSON output generation + * \author + * Niclas Finne <nf...@si...> + * Joakim Eriksson <jo...@si...> + */ + +#ifndef __JSONTREE_H__ +#define __JSONTREE_H__ + +#include "contiki-conf.h" +#include "json.h" + +#ifdef JSONTREE_CONF_MAX_DEPTH +#define JSONTREE_MAX_DEPTH JSONTREE_CONF_MAX_DEPTH +#else +#define JSONTREE_MAX_DEPTH 10 +#endif /* JSONTREE_CONF_MAX_DEPTH */ + +struct jsontree_context { + struct jsontree_value *values[JSONTREE_MAX_DEPTH]; + uint16_t index[JSONTREE_MAX_DEPTH]; + int (* putchar)(int); + uint8_t depth; + uint8_t path; + int callback_state; +}; + +struct jsontree_value { + uint8_t type; + /* followed by a value */ +}; + +struct jsontree_string { + uint8_t type; + const char *value; +}; + +struct jsontree_int { + uint8_t type; + int value; +}; + +/* NOTE: the jsontree_callback set will receive a jsonparse state */ +struct jsonparse_state; +struct jsontree_callback { + uint8_t type; + int (* output)(struct jsontree_context *js_ctx); + int (* set)(struct jsontree_context *js_ctx, struct jsonparse_state *parser); +}; + +struct jsontree_pair { + const char *name; + struct jsontree_value *value; +}; + +struct jsontree_object { + uint8_t type; + uint8_t count; + struct jsontree_pair *pairs; +}; + +struct jsontree_array { + uint8_t type; + uint8_t count; + struct jsontree_value **values; +}; + +#define JSONTREE_STRING(text) {JSON_TYPE_STRING, (text)} +#define JSONTREE_PAIR(name, value) {(name), (struct jsontree_value *)(value)} +#define JSONTREE_CALLBACK(output, set) {JSON_TYPE_CALLBACK, (output), (set)} + +#define JSONTREE_OBJECT(name, ...) \ + static struct jsontree_pair jsontree_pair_##name[] = {__VA_ARGS__}; \ + static struct jsontree_object name = { \ + JSON_TYPE_OBJECT, \ + sizeof(jsontree_pair_##name)/sizeof(struct jsontree_pair), \ + jsontree_pair_##name } + +#define JSONTREE_OBJECT_EXT(name, ...) \ + static struct jsontree_pair jsontree_pair_##name[] = {__VA_ARGS__}; \ + struct jsontree_object name = { \ + JSON_TYPE_OBJECT, \ + sizeof(jsontree_pair_##name)/sizeof(struct jsontree_pair), \ + jsontree_pair_##name } + +void jsontree_setup(struct jsontree_context *js_ctx, + struct jsontree_value *root, int (* putchar)(int)); +void jsontree_reset(struct jsontree_context *js_ctx); + +const char *jsontree_path_name(const struct jsontree_context *js_ctx, + int depth); + +void jsontree_write_int(const struct jsontree_context *js_ctx, int value); +void jsontree_write_atom(const struct jsontree_context *js_ctx, + const char *text); +void jsontree_write_string(const struct jsontree_context *js_ctx, + const char *text); +int jsontree_print_next(struct jsontree_context *js_ctx); +struct jsontree_value *jsontree_find_next(struct jsontree_context *js_ctx, + int type); + +#endif /* __JSONTREE_H__ */ diff --git a/examples/ipv6/json-ws/Makefile b/examples/ipv6/json-ws/Makefile new file mode 100644 index 0000000..12aa155 --- /dev/null +++ b/examples/ipv6/json-ws/Makefile @@ -0,0 +1,30 @@ +CONTIKI=../../.. + +WITH_UIP6=1 +UIP_CONF_IPV6=1 +SMALL=1 + +PROJECT_SOURCEFILES += json-ws.c + +ifdef WITH_COSM + CFLAGS += -DWITH_COSM=1 +endif + +ifdef WITH_UDP + CFLAGS += -DWITH_UDP=1 + PROJECT_SOURCEFILES += json-ws-udp.c +endif + +APPS += httpd-ws json + +CFLAGS += -DPROJECT_CONF_H=\"project-conf.h\" + +ifeq ($(TARGET),) + -include Makefile.target +endif + +ifneq ($(TARGET),) +all: websense-$(TARGET) +endif + +include $(CONTIKI)/Makefile.include diff --git a/examples/ipv6/json-ws/README-COSM.txt b/examples/ipv6/json-ws/README-COSM.txt new file mode 100644 index 0000000..6e61143 --- /dev/null +++ b/examples/ipv6/json-ws/README-COSM.txt @@ -0,0 +1,106 @@ +Short description on how to set-up a sensor network for global IPv6 addresses. +NOTE: this assumes that you do not have a native IPv6 connection. + +You will need: +* PC with Ubuntu (Linux) - 11 or 12 versions +* A node for the RPL-Border-Router (examples/ipv6/rpl-border-router) +* A node for the json webservice (examples/ipv6/json-ws) + +Set-up IPv6 tunnel and Border Router +------------------------------------ +1. Ensure that you have gogo6c installed. + +> sudo apt-get install gogoc + +2. Register an account at gogo6 and Freenet6 (http://www.gogo6.com). + The account at Freenet6 is needed by the gogo6c client. + +3. Edit the gogoc.conf and set your own Freenet6 user and password by + changing the lines with "userid" and "passwd". + +4. Start gogoc at command line + +> cd contiki/examples/ipv6/json-ws +> sudo gogoc -f gogoc.conf -n + +This will print your prefix - TSP_PREFIX. +In my case TSP_PREFIX=2001:05c0:1517:e400 (prefixlen is 56). + +5. Connect one of the nodes to the PC (via USB or serial) and program + it with the RPL-border-router (assumes Z1 node). + +> cd contiki/examples/ipv6/rpl-border-router +> make DEFINES=DEFINES=NETSTACK_RDC=nullrdc_driver,NULLRDC_CONF_802154_AUTOACK=1 TARGET=z1 border-router.upload + +6. Run tunslip6 which will forward IP from the RPL network to + the IPv6 tunnel (and to the Internet). + +> cd contiki/examples/ipv6/rpl-border-router +> make connect-router PREFIX=<TSP_PREFIX>::1/64 + + When you start this you should get a printout from the border-router + which give you the IPv6 address of it. + +Server IPv6 addresses: + 2001:05c0:1517:e400:c30c::10a + fe80::c30c:0:0:10a + +7. Browse using Mozilla Firefox (or any other browser) to the IPv6 address + given by the border router. This will show you the list of other nodes + connected to the RPL network. + + http://[2001:05c0:1517:e400:c30c::10a]/ + + NOTE: this is a global IPv6 address so it should also be reachable from + any machine on the Internet. + +Configuration of COSM submission +-------------------------------- +1. Register a COSM account at https://cosm.com/ + Set-up a feed and create an API key for the feed. + +2. Program the sensor node with (assumes Z1) + +> cd contiki/examples/ipv6/json-ws +> make websense-z1.upload WITH_COSM=1 TARGET=z1 + +3. Check the IPv6 address of the node via the RPL-border router or + by looking at printouts when booting (make login TARGET=z1) + +4. You need to configure the node to push data to the COSM feed and + this can be done in several ways. For convenience a Python script + is included that pushes the configuration to the nodes. + + Edit the file 'setcosm.py' and replace "<your-key>" and + "<your-feed>" with your COSM API key and COSM feed id. You can then + use this Python script to configure your nodes. + + This is an example that configures the node with IP address + 2001:05c0:1517:e400:c30c::10b to push data to the COSM feed with + stream 1: + +> cd contiki/examples/ipv6/json-ws +> ./setcosm.py [2001:05c0:1517:e400:c30c::10b] 1 + + Another way to configure the nodes is to use a REST add-on for the + web browser to post a COSM configuration to the node. "REST Client" + for Mozilla Firefox is an example of such add-on. + + POST a JSON expression to your node with the following data: + This assumes that you have the feed with id 55180 and want to post + to stream 1 in that feed. The field 'appdata' should be set to the + API key you created at the COSM web site for the feed. + +{ + "host":"[2001:470:1f10:333::2]", + "port":80, + "path":"/v2/feeds/55180/datastreams/1", + "appdata":"<insert your COSM API key>", + "interval":120, + "proto":"cosm" +} + + This will configure the node to periodically push temperature data + every other minute. You can use GET to retrieve the data to se that + the node has been successfully configured (the COSM API key will be + visualized as a number of stars). diff --git a/examples/ipv6/json-ws/gogoc.conf b/examples/ipv6/json-ws/gogoc.conf new file mode 100644 index 0000000..8d1fa00 --- /dev/null +++ b/examples/ipv6/json-ws/gogoc.conf @@ -0,0 +1,351 @@ +#----------------------------------------------------------------------------- +# $Id: gogoc.conf.in,v 1.1 2009/11/20 16:53:12 jasminko Exp $ +#----------------------------------------------------------------------------- + +########################## READ ME! ################################ +# +# Welcome to the gogoCLIENT configuration file. +# In order to use the client, you need to modify the 'userid', 'passwd' and +# 'server' parameters below depending on which of these situations applies: +# +# 1. If you created a Freenet6 account, enter your userid and password below. +# Change the server name to "broker.freenet6.net" and auth_method to 'any'. +# 2. If you would like to use Freenet6 without creating an account, +# do not make any modifications and close this file. +# 3. If this software was provided by your ISP, enter the userid, password and +# server name provided by your ISP below. +# + + +########################## BASIC CONFIGURATION ################################ + +# +# User Identification and Password: +# Specify your user name and password as provided by your ISP or Freenet6. +# If you plan to connect anonymously, leave these values empty. +# NOTE: Change auth_method option if you are using a username/password. +# +# userid=<your_userid> +# passwd=<your_password> +# +userid=<change to your userid> +passwd=<change to your password> + +# +# gogoSERVER: +# Specify a gogoSERVER name or IP address (provided by your ISP or +# Freenet6). An optional port number can be added; the default port number +# is 3653. +# +# Examples: +# server=hostname # FQDN +# server=A.B.C.D # IPv4 address +# server=[X:X::X:X] # IPv6 address +# server=hostname:port_number +# server=A.B.C.D:port_number +# server=[X:X::X:X]:port_number +# +# Freenet6 account holders should enter authenticated.freenet6.net, +# otherwise use anonymous.freenet6.net. +# Your ISP may provide you with a different server name. +# +#server=anonymous.freenet6.net +#server=authenticated.freenet6.net +server=amsterdam.freenet6.net + +# +# Authentication Method: +# +# auth_method=<{anonymous}|{any|passdss-3des-1|digest-md5|plain}> +# +# anonymous: Sends no username or password +# +# any: The most secure method will be used. +# passdss-3des-1: The password is sent encrypted. +# digest-md5: The password is sent encrypted. +# plain: Both username and password are sent as plain text. +# +# Recommended values: +# - any: If you are authenticating a username / password. +# - anonymous: If you are connecting anonymously. +# +#auth_method=anonymous +auth_method=any + + +########################## ROUTING CONFIGURATION ############################## +# Use these parameters when you wish the client to act as a router and provide +# IPv6 connectivity to IPv6-capable devices on your network. + +# +# Local Host Type: +# Change this value to 'router' to enable IPv6 advertisements. +# +# host_type=<host|router> +# +host_type=router +#host + +# +# Prefix Length: +# Length of the requested prefix. Valid values range between 0 and 64 when +# using V6*V4 tunnel modes, and between 0 and 32 when using V4V6 tunnel mode. +# +# prefixlen=<integer> +# +prefixlen=64 + +# +# Advertisement Interface Prefix: +# Name of the interface that will be configured to send router advertisements. +# This is an interface index on Windows (ex: 4) and a name on Linux +# and BSD (ex: eth1 or fxp1). +# +# if_prefix=<interface name> +# +if_prefix=tun0 + +# +# DNS Server: +# A DNS server list to which the reverse prefix will be delegated. Servers +# are separated by the colon(:) delimiter. +# +# Example: dns_server=ns1.domain:ns2.domain:ns3.domain +# +dns_server= + + +######################### ADVANCED CONFIGURATION ############################## + +# +# gogoCLIENT Installation Directory: +# Directory where the gogoCLIENT will be installed. This value has been +# set during installation. +# +gogoc_dir= + +# +# Auto-Retry Connect, Retry Delay and Max Retry Delay: +# When auto_retry_connect=yes, the gogoCLIENT will attempt to reconnect +# after a disconnection occurred. The time to wait is 'retry_delay' and that +# delay is doubled at every 3 failed consecutive reconnection attempt. +# However, the wait delay will never exceed retry_delay_max. +# +# +# auto_retry_connect=<yes|no> +# retry_delay=<integer: 0..3600> +# retry_delay_max=<integer: 0..3600> +# +# Recommended values: "yes", 30, 300 +# +auto_retry_connect=yes +retry_delay=30 +retry_delay_max=300 + +# +# Keepalive Feature and Message Interval: +# Indicates if and how often the client will send data to keep the tunnel +# active. +# +# keepalive=<yes|no> +# keepalive_interval=<integer> +# +# Recommended values: "yes" and 30 +# +keepalive=yes +keepalive_interval=30 + +# +# Tunnel Encapsulation Mode: +# v6v4: IPv6-in-IPv4 tunnel. +# v6udpv4: IPv6-in-UDP-in-IPv4 tunnel (for clients behind a NAT). +# v6anyv4: Lets the broker choose the best mode for IPv6 tunnel. +# v4v6: IPv4-in-IPv6 tunnel. +# +# Recommended value: v6anyv4 +# +tunnel_mode=v6anyv4 + +# +# Tunnel Interface Name: +# The interface name assigned to the tunnel. This value is O/S dependent. +# +# if_tunnel_v6v4 is the tunnel interface name for v6v4 encapsulation mode +# if_tunnel_v6udpv4 is the tunnel interface name for v6udpv4 encapsulate mode +# if_tunnel_v4v6 is the tunnel interface name for v4v6 encapsulation mode +# +# Default values are set during installation. +# +if_tunnel_v6v4=sit1 +if_tunnel_v6udpv4=sit +if_tunnel_v4v6=sit0 + +# +# Local IP Address of the Client: +# Allows you to set a specific address as the local tunnel endpoint. +# +# client_v4=<auto|A.B.C.D (valid ipv4 address)> +# client_v6=<auto|X:X::X:X (valid ipv6 address)> +# auto: The gogoCLIENT will find the local IP address endpoint. +# +# Recommended value: auto +# +client_v4=auto +client_v6=auto + +# +# Script Name: +# File name of the script to run to install th... [truncated message content] |