Merge pull request #52 from adamdunkels/thingsquare-mist-regression-tests

New regression test framework
This commit is contained in:
Nicolas Tsiftes 2012-12-10 13:14:40 -08:00
commit ab4d2ecddd
107 changed files with 16755 additions and 676 deletions

View file

@ -1,206 +0,0 @@
## Makefile.CI
#
# This is for use on [Travis CI](http://travis-ci.org), which is
# a free distributed continuous integration service with unique
# set of features:
# * uses clean ephemeral virtual machines for every build
# * integrates with GitHub - triggers builds on push and pull-request
# * it is open source and free for public repositories
# * features great web UI and bunch of other stuff
JOBS ?= 2
TAIL ?= tail -n 15
EXAMPLES_ALL = hello-world
EXAMPLES_native = ipv6/native-border-router
EXAMPLES_most_non_native = \
er-rest-example \
ipv6/rpl-border-router \
ipv6/rpl-collect \
ipv6/rpl-udp \
ipv6/simple-udp-rpl \
ipv6/slip-radio \
webserver-ipv6
EXAMPLES_econotag = $(EXAMPLES_most_non_native)
EXAMPLES_most_avr = $(EXAMPLES_most_non_native)
EXAMPLES_micaz = $(EXAMPLES_most_avr)
EXAMPLES_avr_raven = $(EXAMPLES_most_avr)
## MARK_EXAMPLES_$(TARGET) provides the mechanism to
## build the examples which are known to fail but
## shouldn't be counted as failing for some reason
MARK_EXAMPLES_micaz = \
er-rest-example \
ipv6/rpl-border-router \
ipv6/rpl-collect \
ipv6/rpl-udp \
ipv6/simple-udp-rpl \
ipv6/slip-radio \
webserver-ipv6
## EXCLUDE_$(TARGETS) provides the mechanism to
## not build the examples which are known to fail
EXCLUDE_avr_raven = ipv6/rpl-collect
EXAMPLES_sky = $(EXAMPLES_most_non_native) sky-shell
COOJA_TESTS_DIR = tools/cooja/contiki_tests
COOJA_TESTS_HELLO_WORLD = $(COOJA_TESTS_DIR)/*_helloworld.csc
COOJA_TESTS_BASE = $(COOJA_TESTS_DIR)/multithreading.csc \
$(COOJA_TESTS_DIR)/sky_coffee.csc
# $(COOJA_TESTS_DIR)/crosslevel.csc
# The crosslevel test is unstable and therefore not included yet
COOJA_TESTS_RIME = $(COOJA_TESTS_DIR)/rime_abc.csc \
$(COOJA_TESTS_DIR)/rime_rucb.csc \
$(COOJA_TESTS_DIR)/rime_runicast.csc \
$(COOJA_TESTS_DIR)/sky_deluge.csc \
$(COOJA_TESTS_DIR)/sky_collect.csc
# $(COOJA_TESTS_DIR)/rime_trickle.csc
# The rime_trickle test sometimes fails so it isn't included here
COOJA_TESTS_NETPERF = $(COOJA_TESTS_DIR)/netperf-*.csc
COOJA_TESTS_SKY_SHELL = $(COOJA_TESTS_DIR)/sky_shell_basic_commands.csc \
$(COOJA_TESTS_DIR)/sky_shell_compliation_test.csc \
$(COOJA_TESTS_DIR)/sky_shell_download.csc \
$(COOJA_TESTS_DIR)/sky_checkpointing.csc \
$(COOJA_TESTS_DIR)/sky_shell_sendcmd.csc
COOJA_TESTS_ELFLOADER = $(COOJA_TESTS_DIR)/sky_shell_exec_serial.csc
COOJA_TESTS_COLLECT = $(COOJA_TESTS_DIR)/rime_collect.csc \
$(COOJA_TESTS_DIR)/rime_collect_sky.csc
COOJA_TESTS_COLLECT_SKY = $(COOJA_TESTS_DIR)/sky_shell_collect.csc
COOJA_TESTS_COLLECT_LOSSY = $(COOJA_TESTS_DIR)/sky_shell_collect_lossy.csc
COOJA_TESTS_IPV6 = $(COOJA_TESTS_DIR)/sky-ipv6-rpl-collect.csc \
$(COOJA_TESTS_DIR)/sky_ipv6_udp.csc \
$(COOJA_TESTS_DIR)/sky_ipv6_udp_fragmentation.csc \
$(COOJA_TESTS_DIR)/cooja_ipv6_udp.csc
COOJA_TESTS_IPV6_APPS = $(COOJA_TESTS_DIR)/servreg-hack.csc \
$(COOJA_TESTS_DIR)/rest_rpl_coap.csc
# The IPv4 test are not stable yet:
#COOJA_TESTS_IPV4 = $(COOJA_TESTS_DIR)/ip_cooja_telnet_ping.csc \
# $(COOJA_TESTS_DIR)/ip_sky_telnet_ping.csc \
# $(COOJA_TESTS_DIR)/ip_sky_webserver_wget.csc
## Some Cooja tests can also be excluded:
#EXCLUDE_COOJA_TESTS = servreg-hack.csc sky_coffee.csc rime_collect.csc rime_trickle.csc
## And some can also be marked:
#MARK_COOJA_TESTS = crosslevel.csc ip_sky_telnet_ping.csc
CT := \033[0;0m
ifdef BOXED_SIGNS
SKIP_SIGN :=
FAIL_SIGN :=
PASS_SIGN :=
else
SKIP_SIGN :=
FAIL_SIGN :=
PASS_SIGN :=
endif
## FIXME: this will misbehave when we intend to skip `examples1` but there is also `examples123` that fails also
SKIP = (echo $(SKIP_LIST) | grep -q $$e && (echo "\033[1;36m $(SKIP_SIGN) $$e ⊈ $@ $(CT)"; $(TAIL) $(LOG); echo skip >> results) || false)
FAIL = (echo "\033[1;35m $(FAIL_SIGN) $$e ∉ $@ $(CT)"; $(TAIL) $(LOG); echo fail >> results)
PASS = (echo "\033[1;32m $(PASS_SIGN) $$e ∈ $@ $(CT)"; echo pass >> results)
# This is the definition of the basic compilation test
ifeq ($(BUILD_TYPE),compile)
THIS = $(MAKE) -C examples/$$e TARGET=$@ > $(LOG) 2>&1
MINE = $(filter-out $(EXCLUDE_$(subst -,_,$@)), $(EXAMPLES_ALL) $(EXAMPLES_$(subst -,_,$@)))
SKIP_LIST = $(MARK_EXAMPLES_$(subst -,_,$@))
endif
# Below are the Contiki functional tests, which all use Cooja so we
# need to define JAVA and the COOJA_COMMAND
JAVA = java -mx512m
COOJA_COMMAND = $(SHELL) -x -c "cd `dirname $$e` && $(JAVA) -jar ../dist/cooja.jar -nogui=`basename $$e`" > $(LOG) #2>&1
ifeq ($(BUILD_TYPE),helloworld)
THIS = $(COOJA_COMMAND)
MINE = $(filter-out $(addprefix $(COOJA_TESTS_DIR)/, $(EXCLUDE_COOJA_TESTS)), \
$(wildcard $(COOJA_TESTS_HELLO_WORLD)))
SKIP_LIST = $(addprefix $(COOJA_TESTS_DIR)/, $(MARK_COOJA_TESTS))
endif
ifeq ($(BUILD_TYPE),base)
THIS = $(COOJA_COMMAND)
MINE = $(filter-out $(addprefix $(COOJA_TESTS_DIR)/, $(EXCLUDE_COOJA_TESTS)), \
$(wildcard $(COOJA_TESTS_BASE)))
SKIP_LIST = $(addprefix $(COOJA_TESTS_DIR)/, $(MARK_COOJA_TESTS))
endif
ifeq ($(BUILD_TYPE),rime)
THIS = $(COOJA_COMMAND)
MINE = $(filter-out $(addprefix $(COOJA_TESTS_DIR)/, $(EXCLUDE_COOJA_TESTS)), \
$(wildcard $(COOJA_TESTS_RIME)))
SKIP_LIST = $(addprefix $(COOJA_TESTS_DIR)/, $(MARK_COOJA_TESTS))
endif
ifeq ($(BUILD_TYPE),netperf)
THIS = $(COOJA_COMMAND)
MINE = $(filter-out $(addprefix $(COOJA_TESTS_DIR)/, $(EXCLUDE_COOJA_TESTS)), \
$(wildcard $(COOJA_TESTS_NETPERF)))
SKIP_LIST = $(addprefix $(COOJA_TESTS_DIR)/, $(MARK_COOJA_TESTS))
endif
ifeq ($(BUILD_TYPE),sky-shell)
THIS = $(COOJA_COMMAND)
MINE = $(filter-out $(addprefix $(COOJA_TESTS_DIR)/, $(EXCLUDE_COOJA_TESTS)), \
$(wildcard $(COOJA_TESTS_SKY_SHELL)))
SKIP_LIST = $(addprefix $(COOJA_TESTS_DIR)/, $(MARK_COOJA_TESTS))
endif
ifeq ($(BUILD_TYPE),elfloader)
THIS = $(COOJA_COMMAND)
MINE = $(filter-out $(addprefix $(COOJA_TESTS_DIR)/, $(EXCLUDE_COOJA_TESTS)), \
$(wildcard $(COOJA_TESTS_ELFLOADER)))
SKIP_LIST = $(addprefix $(COOJA_TESTS_DIR)/, $(MARK_COOJA_TESTS))
endif
ifeq ($(BUILD_TYPE),collect)
THIS = $(COOJA_COMMAND)
MINE = $(filter-out $(addprefix $(COOJA_TESTS_DIR)/, $(EXCLUDE_COOJA_TESTS)), \
$(wildcard $(COOJA_TESTS_COLLECT)))
SKIP_LIST = $(addprefix $(COOJA_TESTS_DIR)/, $(MARK_COOJA_TESTS))
endif
ifeq ($(BUILD_TYPE),collect-sky)
THIS = $(COOJA_COMMAND)
MINE = $(filter-out $(addprefix $(COOJA_TESTS_DIR)/, $(EXCLUDE_COOJA_TESTS)), \
$(wildcard $(COOJA_TESTS_COLLECT_SKY)))
SKIP_LIST = $(addprefix $(COOJA_TESTS_DIR)/, $(MARK_COOJA_TESTS))
endif
ifeq ($(BUILD_TYPE),collect-lossy)
THIS = $(COOJA_COMMAND)
MINE = $(filter-out $(addprefix $(COOJA_TESTS_DIR)/, $(EXCLUDE_COOJA_TESTS)), \
$(wildcard $(COOJA_TESTS_COLLECT_LOSSY)))
SKIP_LIST = $(addprefix $(COOJA_TESTS_DIR)/, $(MARK_COOJA_TESTS))
endif
ifeq ($(BUILD_TYPE),ipv6)
THIS = $(COOJA_COMMAND)
MINE = $(filter-out $(addprefix $(COOJA_TESTS_DIR)/, $(EXCLUDE_COOJA_TESTS)), \
$(wildcard $(COOJA_TESTS_IPV6)))
SKIP_LIST = $(addprefix $(COOJA_TESTS_DIR)/, $(MARK_COOJA_TESTS))
endif
ifeq ($(BUILD_TYPE),ipv6-apps)
THIS = $(COOJA_COMMAND)
MINE = $(filter-out $(addprefix $(COOJA_TESTS_DIR)/, $(EXCLUDE_COOJA_TESTS)), \
$(wildcard $(COOJA_TESTS_IPV6_APPS)))
SKIP_LIST = $(addprefix $(COOJA_TESTS_DIR)/, $(MARK_COOJA_TESTS))
endif
LOG = /tmp/$@_`echo $$e | sed 's:/:_:g'`.log
%:
@echo "\033[1;37m ➠ $@ $(CT)"
@for e in $(MINE); do $(THIS) && $(PASS) || $(SKIP) || $(FAIL); done;

View file

@ -16,27 +16,27 @@ before_script:
script:
## The makefile called `.travis.mk` handles most of generic logic
- "make -f .travis.mk $MAKE_TARGETS"
- "make -C regression-tests/??-$BUILD_TYPE RUNALL=true summary"
after_script:
## Print a basic summary in unix style
- "echo 'Summary:'; cat results | sort | uniq -c"
- "echo 'Summary:'; cat regression-tests/??-$BUILD_TYPE/summary"
## This will detect whether the build should pass or fail
- "test `grep -c 'fail' results` -eq 0"
- "test `grep -c -i 'fail' regression-tests/??-$BUILD_TYPE/summary` -eq 0"
env:
## This magically kick-off parallel jobs for each of the for the sets
## of environment variable defined below
- BUILD_TYPE='compile' MAKE_TARGETS='native minimal-net econotag sky micaz avr-raven'
- BUILD_TYPE='ipv6' MAKE_TARGETS='cooja' TAIL=cat
- BUILD_TYPE='collect-lossy' MAKE_TARGETS='cooja' TAIL=cat
- BUILD_TYPE='collect-sky' MAKE_TARGETS='cooja' TAIL=cat
- BUILD_TYPE='collect' MAKE_TARGETS='cooja' TAIL=cat
- BUILD_TYPE='helloworld' MAKE_TARGETS='cooja' TAIL=cat
- BUILD_TYPE='base' MAKE_TARGETS='cooja' TAIL=cat
- BUILD_TYPE='rime' MAKE_TARGETS='cooja' TAIL=cat
- BUILD_TYPE='netperf' MAKE_TARGETS='cooja' TAIL=cat
- BUILD_TYPE='sky-shell' MAKE_TARGETS='cooja' TAIL=cat
- BUILD_TYPE='elfloader' MAKE_TARGETS='cooja' TAIL=cat
- BUILD_TYPE='ipv6-apps' MAKE_TARGETS='cooja' TAIL=cat
- BUILD_TYPE='compile'
- BUILD_TYPE='collect' MAKE_TARGETS='cooja'
- BUILD_TYPE='rpl' MAKE_TARGETS='cooja'
- BUILD_TYPE='rime' MAKE_TARGETS='cooja'
- BUILD_TYPE='ipv6' MAKE_TARGETS='cooja'
- BUILD_TYPE='hello-world' MAKE_TARGETS='cooja'
- BUILD_TYPE='base' MAKE_TARGETS='cooja'
- BUILD_TYPE='netperf' MAKE_TARGETS='cooja'
- BUILD_TYPE='shell' MAKE_TARGETS='cooja'
- BUILD_TYPE='elfloader' MAKE_TARGETS='cooja'
- BUILD_TYPE='ipv4' MAKE_TARGETS='cooja'
- BUILD_TYPE='ipv6-apps' MAKE_TARGETS='cooja'

View file

@ -128,12 +128,16 @@ found_route(struct route_discovery_conn *rdc, const rimeaddr_t *dest)
rt = route_lookup(dest);
if(rt != NULL) {
multihop_resend(&c->multihop, &rt->nexthop);
if(c->cb->sent != NULL) {
c->cb->sent(c);
}
} else {
if(c->cb->timedout != NULL) {
c->cb->timedout(c);
}
}
}
}
/*---------------------------------------------------------------------------*/
static void
route_timed_out(struct route_discovery_conn *rdc)
@ -191,7 +195,9 @@ mesh_send(struct mesh_conn *c, const rimeaddr_t *to)
PRINTF("mesh_send: could not send\n");
return 0;
}
if(c->cb->sent != NULL) {
c->cb->sent(c);
}
return 1;
}
/*---------------------------------------------------------------------------*/

View file

@ -71,7 +71,7 @@ CONTIKI_CPU=$(CONTIKI)/cpu/x86
### Compiler arguments
#CC = gcc
CFLAGSNO = $(EXTRA_CC_ARGS) -Wall -g -I/usr/local/include -DCLASSNAME=$(CLASSNAME)
CFLAGS = $(CFLAGSNO)
CFLAGS += $(CFLAGSNO)
ifdef UIP_CONF_IPV6
CFLAGS += -DWITH_UIP6=1

View file

@ -39,6 +39,8 @@
#define COOJA 1
#define w_memcpy memcpy
#if WITH_UIP
#if WITH_UIP6
#error WITH_UIP && WITH_IP6: Bad configuration
@ -57,13 +59,18 @@
/* Default network config */
#if WITH_UIP6
#define NULLRDC_CONF_802154_AUTOACK 0
#define NULLRDC_CONF_SEND_802154_ACK 0
#define NULLRDC_CONF_ACK_WAIT_TIME RTIMER_SECOND / 500
#define NULLRDC_CONF_AFTER_ACK_DETECTED_WAIT_TIME RTIMER_SECOND / 250
/* Network setup for IPv6 */
#define NETSTACK_CONF_NETWORK uip_driver
#define NETSTACK_CONF_MAC nullmac_driver
#define NETSTACK_CONF_NETWORK sicslowpan_driver
#define NETSTACK_CONF_MAC csma_driver
#define NETSTACK_CONF_RDC nullrdc_driver
#define NETSTACK_CONF_RADIO cooja_radio_driver
#define UIP_CONF_IPV6 1
#define UIP_CONF_IP_FORWARD 0
#define NETSTACK_CONF_FRAMER framer_802154
#else /* WITH_UIP6 */
@ -80,7 +87,7 @@
/* Network setup for Rime */
#define NETSTACK_CONF_NETWORK rime_driver
#define NETSTACK_CONF_MAC nullmac_driver
#define NETSTACK_CONF_MAC csma_driver
#define NETSTACK_CONF_RDC nullrdc_driver
#define NETSTACK_CONF_RADIO cooja_radio_driver
/*#define NETSTACK_CONF_FRAMER framer_nullmac*/
@ -90,6 +97,86 @@
#endif /* NETSTACK_CONF_H */
#define NETSTACK_CONF_RDC_CHANNEL_CHECK_RATE 8
/* Default network config */
#if WITH_UIP6
/* Network setup for IPv6 */
#define NETSTACK_CONF_NETWORK sicslowpan_driver
#define NETSTACK_CONF_MAC csma_driver
#define NETSTACK_CONF_RDC nullrdc_driver
#define NETSTACK_CONF_RADIO cooja_radio_driver
#define NETSTACK_CONF_FRAMER framer_802154
#define UIP_CONF_IPV6 1
#define RIMEADDR_CONF_SIZE 8
#define UIP_CONF_LL_802154 1
#define UIP_CONF_LLH_LEN 0
#define UIP_CONF_ROUTER 1
#ifndef UIP_CONF_IPV6_RPL
#define UIP_CONF_IPV6_RPL 1
#endif /* UIP_CONF_IPV6_RPL */
/* configure number of neighbors and routes */
#ifndef UIP_CONF_DS6_NBR_NBU
#define UIP_CONF_DS6_NBR_NBU 300
#endif /* UIP_CONF_DS6_NBR_NBU */
#ifndef UIP_CONF_DS6_ROUTE_NBU
#define UIP_CONF_DS6_ROUTE_NBU 300
#endif /* UIP_CONF_DS6_ROUTE_NBU */
#define TCPIP_CONF_ANNOTATE_TRANSMISSIONS 1
#define RPL_CONF_DIO_INTERVAL_MIN 16
#define RPL_DIS_INTERVAL_CONF (5 * 60)
#define RPL_CONF_DAO_LATENCY (CLOCK_SECOND * 60)
#define UIP_CONF_ND6_SEND_RA 0
#define UIP_CONF_ND6_REACHABLE_TIME 600000
#define UIP_CONF_ND6_RETRANS_TIMER 10000
#define RIMEADDR_CONF_SIZE 8
#define UIP_CONF_NETIF_MAX_ADDRESSES 3
#define UIP_CONF_ND6_MAX_PREFIXES 3
#define UIP_CONF_ND6_MAX_NEIGHBORS 4
#define UIP_CONF_ND6_MAX_DEFROUTERS 2
#ifndef UIP_CONF_IPV6_QUEUE_PKT
#define UIP_CONF_IPV6_QUEUE_PKT 1
#endif /* UIP_CONF_IPV6_QUEUE_PKT */
#define UIP_CONF_IPV6_CHECKS 1
#define UIP_CONF_IPV6_REASSEMBLY 0
#define UIP_CONF_NETIF_MAX_ADDRESSES 3
#define UIP_CONF_ND6_MAX_PREFIXES 3
#define UIP_CONF_ND6_MAX_NEIGHBORS 4
#define UIP_CONF_ND6_MAX_DEFROUTERS 2
#define UIP_CONF_IP_FORWARD 0
#ifndef UIP_CONF_BUFFER_SIZE
#define UIP_CONF_BUFFER_SIZE 240
#endif
#define SICSLOWPAN_CONF_COMPRESSION_IPV6 0
#define SICSLOWPAN_CONF_COMPRESSION_HC1 1
#define SICSLOWPAN_CONF_COMPRESSION_HC01 2
#define SICSLOWPAN_CONF_COMPRESSION SICSLOWPAN_COMPRESSION_HC06
#ifndef SICSLOWPAN_CONF_FRAG
#define SICSLOWPAN_CONF_FRAG 1
#define SICSLOWPAN_CONF_MAXAGE 8
#endif /* SICSLOWPAN_CONF_FRAG */
#define SICSLOWPAN_CONF_CONVENTIONAL_MAC 1
#define SICSLOWPAN_CONF_MAX_ADDR_CONTEXTS 2
#ifndef SICSLOWPAN_CONF_MAX_MAC_TRANSMISSIONS
#define SICSLOWPAN_CONF_MAX_MAC_TRANSMISSIONS 8
#endif /* SICSLOWPAN_CONF_MAX_MAC_TRANSMISSIONS */
#endif /* WITH_UIP6 */
#define PACKETBUF_CONF_ATTRS_INLINE 1
@ -123,28 +210,38 @@ typedef unsigned long rtimer_clock_t;
#define WITH_ASCII 1
#define UIP_CONF_MAX_LISTENPORTS 40
#define UIP_CONF_MAX_CONNECTIONS 40
#define UIP_CONF_BYTE_ORDER UIP_LITTLE_ENDIAN
#define UIP_CONF_TCP_SPLIT 0
#define UIP_CONF_LOGGING 0
#define UIP_CONF_UDP_CHECKSUMS 0
#define UIP_CONF_BROADCAST 1
#define UIP_CONF_ICMP_DEST_UNREACH 1
#define UIP_CONF_DHCP_LIGHT
#define UIP_CONF_LLH_LEN 0
#ifndef UIP_CONF_RECEIVE_WINDOW
#define UIP_CONF_RECEIVE_WINDOW 48
#endif
#ifndef UIP_CONF_TCP_MSS
#define UIP_CONF_TCP_MSS 48
#endif
#define UIP_CONF_MAX_CONNECTIONS 4
#define UIP_CONF_MAX_LISTENPORTS 8
#define UIP_CONF_UDP_CONNS 12
#define UIP_CONF_FWCACHE_SIZE 30
#define UIP_CONF_BROADCAST 1
#define UIP_ARCH_IPCHKSUM 1
#define UIP_CONF_UDP 1
#define UIP_CONF_TCP 1
#define UIP_CONF_UDP_CHECKSUMS 1
#define UIP_CONF_PINGADDRCONF 0
#define UIP_CONF_LOGGING 0
#define UIP_CONF_TCP_SPLIT 0
#if UIP_CONF_IPV6
#define RIMEADDR_CONF_SIZE 8
#define UIP_CONF_IPV6_QUEUE_PKT 1
#define UIP_CONF_IPV6_CHECKS 1
#define UIP_CONF_IPV6_REASSEMBLY 1
#define UIP_CONF_NETIF_MAX_ADDRESSES 3
#define UIP_CONF_ND6_MAX_PREFIXES 3
#define UIP_CONF_ND6_MAX_NEIGHBORS 4
#define UIP_CONF_ND6_MAX_DEFROUTERS 2
#endif /* UIP_CONF_IPV6 */
#define CFS_CONF_OFFSET_TYPE long
/* include the project config */
/* PROJECT_CONF_H might be defined in the project Makefile */
#ifdef PROJECT_CONF_H
#include PROJECT_CONF_H
#endif /* PROJECT_CONF_H */
#endif /* __CONTIKI_CONF_H__ */

View file

@ -102,8 +102,6 @@ static uint8_t is_gateway;
#define PRINT6ADDR(addr) printf("%02x%02x:%02x%02x:%02x%02x:%02x%02x:%02x%02x:%02x%02x:%02x%02x:%02x%02x", ((uint8_t *)addr)[0], ((uint8_t *)addr)[1], ((uint8_t *)addr)[2], ((uint8_t *)addr)[3], ((uint8_t *)addr)[4], ((uint8_t *)addr)[5], ((uint8_t *)addr)[6], ((uint8_t *)addr)[7], ((uint8_t *)addr)[8], ((uint8_t *)addr)[9], ((uint8_t *)addr)[10], ((uint8_t *)addr)[11], ((uint8_t *)addr)[12], ((uint8_t *)addr)[13], ((uint8_t *)addr)[14], ((uint8_t *)addr)[15])
#endif /* WITH_UIP6 */
PROCINIT(&etimer_process,&sensors_process);
/* Simulation mote interfaces */
SIM_INTERFACE_NAME(moteid_interface);
SIM_INTERFACE_NAME(vib_interface);
@ -179,6 +177,30 @@ rtimer_thread_loop(void *data)
}
}
/*---------------------------------------------------------------------------*/
static void
set_rime_addr(void)
{
rimeaddr_t addr;
int i;
memset(&addr, 0, sizeof(rimeaddr_t));
#if WITH_UIP6
for(i = 0; i < sizeof(uip_lladdr.addr); i += 2) {
addr.u8[i + 1] = node_id & 0xff;
addr.u8[i + 0] = node_id >> 8;
}
#else /* WITH_UIP6 */
addr.u8[0] = node_id & 0xff;
addr.u8[1] = node_id >> 8;
#endif /* WITH_UIP6 */
rimeaddr_set_node_addr(&addr);
printf("Rime started with address ");
for(i = 0; i < sizeof(addr.u8) - 1; i++) {
printf("%d.", addr.u8[i]);
}
printf("%d\n", addr.u8[i]);
}
/*---------------------------------------------------------------------------*/
void
contiki_init()
{
@ -187,8 +209,12 @@ contiki_init()
/* Start process handler */
process_init();
/* Start Contiki processes */
procinit_init();
process_start(&etimer_process, NULL);
process_start(&sensors_process, NULL);
ctimer_init();
/* Print startup information */
printf(CONTIKI_VERSION_STRING " started. ");
@ -198,28 +224,28 @@ contiki_init()
printf("Node id is not set.\n");
}
/* RIME CONFIGURATION */
set_rime_addr();
{
int i;
rimeaddr_t rimeaddr;
uint8_t longaddr[8];
uint16_t shortaddr;
/* Init Rime */
ctimer_init();
rimeaddr.u8[0] = node_id & 0xff;
rimeaddr.u8[1] = node_id >> 8;
rimeaddr_set_node_addr(&rimeaddr);
printf("Rime address: ");
for(i = 0; i < sizeof(rimeaddr_node_addr.u8) - 1; i++) {
printf("%d.", rimeaddr_node_addr.u8[i]);
}
printf("%d\n", rimeaddr_node_addr.u8[i]);
shortaddr = (rimeaddr_node_addr.u8[0] << 8) +
rimeaddr_node_addr.u8[1];
memset(longaddr, 0, sizeof(longaddr));
rimeaddr_copy((rimeaddr_t *)&longaddr, &rimeaddr_node_addr);
printf("MAC %02x:%02x:%02x:%02x:%02x:%02x:%02x:%02x ",
longaddr[0], longaddr[1], longaddr[2], longaddr[3],
longaddr[4], longaddr[5], longaddr[6], longaddr[7]);
}
queuebuf_init();
/* Initialize communication stack */
netstack_init();
printf("MAC %s RDC %s NETWORK %s\n", NETSTACK_MAC.name, NETSTACK_RDC.name, NETSTACK_NETWORK.name);
printf("%s/%s/%s, channel check rate %lu Hz\n",
NETSTACK_NETWORK.name, NETSTACK_MAC.name, NETSTACK_RDC.name,
CLOCK_SECOND / (NETSTACK_RDC.channel_check_interval() == 0 ? 1:
NETSTACK_RDC.channel_check_interval()));
#if WITH_UIP
/* IPv4 CONFIGURATION */
@ -255,27 +281,26 @@ contiki_init()
{
int i;
uint8_t addr[sizeof(uip_lladdr.addr)];
for (i=0; i < sizeof(uip_lladdr.addr); i++) {
addr[i] = node_id & 0xff;
for(i = 0; i < sizeof(uip_lladdr.addr); i += 2) {
addr[i + 1] = node_id & 0xff;
addr[i + 0] = node_id >> 8;
}
rimeaddr_copy(addr, &rimeaddr_node_addr);
memcpy(&uip_lladdr.addr, addr, sizeof(uip_lladdr.addr));
process_start(&tcpip_process, NULL);
printf("Tentative link-local IPv6 address ");
{
int i, a;
for(a = 0; a < UIP_DS6_ADDR_NB; a++) {
if (uip_ds6_if.addr_list[a].isused) {
uip_ds6_addr_t *lladdr;
int i;
lladdr = uip_ds6_get_link_local(-1);
for(i = 0; i < 7; ++i) {
printf("%02x%02x:",
uip_ds6_if.addr_list[a].ipaddr.u8[i * 2],
uip_ds6_if.addr_list[a].ipaddr.u8[i * 2 + 1]);
}
printf("%02x%02x\n",
uip_ds6_if.addr_list[a].ipaddr.u8[14],
uip_ds6_if.addr_list[a].ipaddr.u8[15]);
}
printf("%02x%02x:", lladdr->ipaddr.u8[i * 2],
lladdr->ipaddr.u8[i * 2 + 1]);
}
printf("%02x%02x\n", lladdr->ipaddr.u8[14],
lladdr->ipaddr.u8[15]);
}
if(1) {

View file

@ -101,13 +101,46 @@ doInterfaceActionsAfterTick(void)
{
}
/*-----------------------------------------------------------------------------------*/
static int log_putchar_with_slip;
void
log_set_putchar_with_slip(int with)
{
log_putchar_with_slip = with;
}
/*-----------------------------------------------------------------------------------*/
#if IMPLEMENT_PRINTF
int
putchar(int c)
{
#define SLIP_END 0300
static char debug_frame = 0;
if(log_putchar_with_slip) {
simlog_char(SLIP_END);
if(!debug_frame) { /* Start of debug output */
simlog_char(SLIP_END);
simlog_char('\r'); /* Type debug line == '\r' */
debug_frame = 1;
}
simlog_char((char)c);
/*
* Line buffered output, a newline marks the end of debug output and
* implicitly flushes debug output.
*/
if(c == '\n') {
simlog_char(SLIP_END);
debug_frame = 0;
}
return c;
} else {
simlog_char(c);
return c;
}
}
/*-----------------------------------------------------------------------------------*/
int
puts(const char* s)
@ -123,11 +156,16 @@ printf(const char *fmt, ...)
int res;
static char buf[MAX_LOG_LENGTH];
va_list ap;
int i;
va_start(ap, fmt);
res = vsnprintf(buf, MAX_LOG_LENGTH, fmt, ap);
va_end(ap);
simlog(buf);
// simlog(buf);
for(i = 0; i < res; i++) {
putchar(buf[i]);
}
return res;
}
#endif /* IMPLEMENT_PRINTF */

View file

@ -0,0 +1,38 @@
EXAMPLESDIR=../../examples
TOOLSDIR=../../tools
EXAMPLES = \
hello-world/avr-raven \
hello-world/econotag \
hello-world/esb \
hello-world/exp5438 \
hello-world/mb851 \
hello-world/micaz \
hello-world/minimal-net \
hello-world/native \
hello-world/sky \
hello-world/wismote \
hello-world/z1 \
collect/sky \
er-rest-example/sky \
example-shell/native \
netperf/sky \
powertrace/sky \
rime/sky \
rime/z1 \
rest-example/sky \
servreg-hack/sky \
sky/sky \
sky-ip/sky \
sky-shell/sky \
sky-shell-exec/sky \
sky-shell-webserver/sky \
telnet-server/minimal-net \
webserver/minimal-net \
webserver-ipv6/sky \
wget/minimal-net \
z1/z1
TOOLS=
include ../Makefile.compile-test

View file

@ -0,0 +1 @@
include ../Makefile.simulation-test

View file

@ -1,12 +1,13 @@
<?xml version="1.0" encoding="UTF-8"?>
<simconf>
<project>../apps/mrm</project>
<project>../apps/mspsim</project>
<project>../apps/avrora</project>
<project>../apps/native_gateway</project>
<project EXPORT="discard">[APPS_DIR]/mrm</project>
<project EXPORT="discard">[APPS_DIR]/mspsim</project>
<project EXPORT="discard">[APPS_DIR]/avrora</project>
<project EXPORT="discard">[APPS_DIR]/serial_socket</project>
<project EXPORT="discard">[APPS_DIR]/collect-view</project>
<project EXPORT="discard">[APPS_DIR]/powertracker</project>
<simulation>
<title>My simulation</title>
<delaytime>0</delaytime>
<randomseed>generated</randomseed>
<motedelay_us>1000000</motedelay_us>
<radiomedium>
@ -16,14 +17,17 @@
<success_ratio_tx>1.0</success_ratio_tx>
<success_ratio_rx>1.0</success_ratio_rx>
</radiomedium>
<events>
<logoutput>40000</logoutput>
</events>
<motetype>
se.sics.cooja.mspmote.SkyMoteType
<identifier>sky1</identifier>
<description>Sky Mote Type #1</description>
<source>../../../examples/multi-threading/multi-threading.c</source>
<commands>make clean TARGET=sky
<source EXPORT="discard">[CONTIKI_DIR]/examples/multi-threading/multi-threading.c</source>
<commands EXPORT="discard">make clean TARGET=sky
make multi-threading.sky TARGET=sky</commands>
<firmware>../../../examples/multi-threading/multi-threading.sky</firmware>
<firmware EXPORT="copy">[CONTIKI_DIR]/examples/multi-threading/multi-threading.sky</firmware>
<moteinterface>se.sics.cooja.interfaces.Position</moteinterface>
<moteinterface>se.sics.cooja.interfaces.IPAddress</moteinterface>
<moteinterface>se.sics.cooja.interfaces.Mote2MoteRelations</moteinterface>
@ -31,13 +35,11 @@ make multi-threading.sky TARGET=sky</commands>
<moteinterface>se.sics.cooja.mspmote.interfaces.MspMoteID</moteinterface>
<moteinterface>se.sics.cooja.mspmote.interfaces.SkyButton</moteinterface>
<moteinterface>se.sics.cooja.mspmote.interfaces.SkyFlash</moteinterface>
<moteinterface>se.sics.cooja.mspmote.interfaces.SkyByteRadio</moteinterface>
<moteinterface>se.sics.cooja.mspmote.interfaces.SkySerial</moteinterface>
<moteinterface>se.sics.cooja.mspmote.interfaces.Msp802154Radio</moteinterface>
<moteinterface>se.sics.cooja.mspmote.interfaces.MspSerial</moteinterface>
<moteinterface>se.sics.cooja.mspmote.interfaces.SkyLED</moteinterface>
</motetype>
<mote>
se.sics.cooja.mspmote.SkyMote
<motetype_identifier>sky1</motetype_identifier>
<breakpoints />
<interface_config>
se.sics.cooja.interfaces.Position
@ -49,6 +51,7 @@ make multi-threading.sky TARGET=sky</commands>
se.sics.cooja.mspmote.interfaces.MspMoteID
<id>1</id>
</interface_config>
<motetype_identifier>sky1</motetype_identifier>
</mote>
</simulation>
<plugin>
@ -58,29 +61,29 @@ make multi-threading.sky TARGET=sky</commands>
<height>200</height>
<location_x>0</location_x>
<location_y>0</location_y>
<minimized>false</minimized>
</plugin>
<plugin>
se.sics.cooja.plugins.Visualizer
<plugin_config />
<plugin_config>
<viewport>0.9090909090909091 0.0 0.0 0.9090909090909091 49.35891944177396 108.94498952737668</viewport>
</plugin_config>
<width>263</width>
<z>2</z>
<height>292</height>
<location_x>1</location_x>
<location_y>202</location_y>
<minimized>false</minimized>
</plugin>
<plugin>
se.sics.cooja.plugins.LogListener
<plugin_config>
<filter />
<formatted_time />
</plugin_config>
<width>865</width>
<z>0</z>
<height>209</height>
<location_x>3</location_x>
<location_y>701</location_y>
<minimized>false</minimized>
</plugin>
<plugin>
se.sics.cooja.plugins.ScriptRunner
@ -129,7 +132,6 @@ while (true) {
<height>700</height>
<location_x>267</location_x>
<location_y>1</location_y>
<minimized>false</minimized>
</plugin>
</simconf>

View file

@ -20,10 +20,10 @@
se.sics.cooja.mspmote.SkyMoteType
<identifier>sky1</identifier>
<description>Sky Mote Type #1</description>
<source>../../../examples/sky-shell/sky-checkpoint.c</source>
<source>../../examples/sky-shell/sky-checkpoint.c</source>
<commands>make clean TARGET=sky
make sky-checkpoint.sky TARGET=sky</commands>
<firmware>../../../examples/sky-shell/sky-checkpoint.sky</firmware>
<firmware>../../examples/sky-shell/sky-checkpoint.sky</firmware>
<moteinterface>se.sics.cooja.interfaces.Position</moteinterface>
<moteinterface>se.sics.cooja.interfaces.IPAddress</moteinterface>
<moteinterface>se.sics.cooja.interfaces.Mote2MoteRelations</moteinterface>

View file

@ -0,0 +1 @@
include ../Makefile.simulation-test

View file

@ -12,7 +12,7 @@
<simulation>
<title>Rime collect test</title>
<delaytime>0</delaytime>
<randomseed>generated</randomseed>
<randomseed>1</randomseed>
<motedelay_us>10000000</motedelay_us>
<radiomedium>
se.sics.cooja.radiomediums.UDGM

View file

@ -20,7 +20,7 @@
se.sics.cooja.contikimote.ContikiMoteType
<identifier>mtype296</identifier>
<description>Contiki Mote #1</description>
<contikiapp>../../../examples/rime/example-rucb.c</contikiapp>
<contikiapp>[CONTIKI_DIR]/examples/rime/example-rucb.c</contikiapp>
<commands>make example-rucb.cooja TARGET=cooja</commands>
<moteinterface>se.sics.cooja.interfaces.Position</moteinterface>
<moteinterface>se.sics.cooja.interfaces.Battery</moteinterface>

View file

@ -20,10 +20,10 @@
se.sics.cooja.mspmote.SkyMoteType
<identifier>sky1</identifier>
<description>Sky Mote Type #1</description>
<source>../../../examples/rime/example-abc.c</source>
<source>[CONTIKI_DIR]/examples/rime/example-abc.c</source>
<commands>make clean TARGET=sky
make example-abc.sky TARGET=sky</commands>
<firmware>../../../examples/rime/example-abc.sky</firmware>
<firmware>[CONTIKI_DIR]/examples/rime/example-abc.sky</firmware>
<moteinterface>se.sics.cooja.interfaces.Position</moteinterface>
<moteinterface>se.sics.cooja.interfaces.IPAddress</moteinterface>
<moteinterface>se.sics.cooja.interfaces.Mote2MoteRelations</moteinterface>

View file

@ -20,10 +20,10 @@
se.sics.cooja.mspmote.SkyMoteType
<identifier>sky1</identifier>
<description>Sky Mote Type #1</description>
<source>../../../examples/sky/test-deluge.c</source>
<source>[CONTIKI_DIR]/examples/sky/test-deluge.c</source>
<commands>make clean TARGET=sky
make APPS=deluge test-deluge.sky TARGET=sky</commands>
<firmware>../../../examples/sky/test-deluge.sky</firmware>
<firmware>[CONTIKI_DIR]/examples/sky/test-deluge.sky</firmware>
<moteinterface>se.sics.cooja.interfaces.Position</moteinterface>
<moteinterface>se.sics.cooja.interfaces.IPAddress</moteinterface>
<moteinterface>se.sics.cooja.interfaces.Mote2MoteRelations</moteinterface>

View file

@ -7,7 +7,7 @@
<simulation>
<title>My simulation</title>
<delaytime>0</delaytime>
<randomseed>generated</randomseed>
<randomseed>1</randomseed>
<motedelay_us>10000000</motedelay_us>
<radiomedium>
se.sics.cooja.radiomediums.UDGM
@ -20,10 +20,10 @@
se.sics.cooja.mspmote.SkyMoteType
<identifier>sky1</identifier>
<description>Sky Mote Type #1</description>
<source>../../../examples/rime/example-runicast.c</source>
<source>[CONTIKI_DIR]/examples/rime/example-runicast.c</source>
<commands>make clean TARGET=sky
make example-runicast.sky TARGET=sky</commands>
<firmware>../../../examples/rime/example-runicast.sky</firmware>
<firmware>[CONTIKI_DIR]/examples/rime/example-runicast.sky</firmware>
<moteinterface>se.sics.cooja.interfaces.Position</moteinterface>
<moteinterface>se.sics.cooja.interfaces.IPAddress</moteinterface>
<moteinterface>se.sics.cooja.interfaces.Mote2MoteRelations</moteinterface>

View file

@ -20,10 +20,10 @@
se.sics.cooja.mspmote.SkyMoteType
<identifier>sky1</identifier>
<description>Sky Mote Type #1</description>
<source>../../../examples/rime/example-trickle.c</source>
<source>[CONTIKI_DIR]/examples/rime/example-trickle.c</source>
<commands>make clean TARGET=sky
make example-trickle.sky TARGET=sky</commands>
<firmware>../../../examples/rime/example-trickle.sky</firmware>
<firmware>[CONTIKI_DIR]/examples/rime/example-trickle.sky</firmware>
<moteinterface>se.sics.cooja.interfaces.Position</moteinterface>
<moteinterface>se.sics.cooja.interfaces.IPAddress</moteinterface>
<moteinterface>se.sics.cooja.interfaces.Mote2MoteRelations</moteinterface>

View file

@ -20,10 +20,10 @@
se.sics.cooja.mspmote.SkyMoteType
<identifier>sky1</identifier>
<description>Sky Mote Type #1</description>
<source>../../../examples/sky/sky-collect.c</source>
<source>[CONTIKI_DIR]/examples/sky/sky-collect.c</source>
<commands>make clean TARGET=sky
make sky-collect.sky TARGET=sky</commands>
<firmware>../../../examples/sky/sky-collect.sky</firmware>
<firmware>[CONTIKI_DIR]/examples/sky/sky-collect.sky</firmware>
<moteinterface>se.sics.cooja.interfaces.Position</moteinterface>
<moteinterface>se.sics.cooja.interfaces.IPAddress</moteinterface>
<moteinterface>se.sics.cooja.interfaces.Mote2MoteRelations</moteinterface>

File diff suppressed because it is too large Load diff

File diff suppressed because it is too large Load diff

View file

@ -0,0 +1 @@
include ../Makefile.simulation-test

View file

@ -0,0 +1,5 @@
CONTIKI = ../../..
all: trickle-node
include $(CONTIKI)/Makefile.include

View file

@ -0,0 +1,70 @@
/*
* Copyright (c) 2012, Thingsquare, www.thingsquare.com.
* 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.
*/
#include "contiki.h"
#include "net/rime/mesh.h"
#include "sys/node-id.h"
#include <stdio.h>
/*---------------------------------------------------------------------------*/
PROCESS(mesh_node_process, "Mesh node");
AUTOSTART_PROCESSES(&mesh_node_process);
/*---------------------------------------------------------------------------*/
static void
mesh_recv(struct mesh_conn *c, const rimeaddr_t *from, uint8_t hops)
{
printf("%d.%d: mesh message received '%s'\n",
rimeaddr_node_addr.u8[0], rimeaddr_node_addr.u8[1],
(char *)packetbuf_dataptr());
}
const static struct mesh_callbacks mesh_callback = {mesh_recv, NULL, NULL};
static struct mesh_conn mesh;
/*---------------------------------------------------------------------------*/
PROCESS_THREAD(mesh_node_process, ev, data)
{
static struct etimer et;
PROCESS_BEGIN();
mesh_open(&mesh, 145, &mesh_callback);
while(1) {
etimer_set(&et, CLOCK_SECOND * 20);
PROCESS_WAIT_UNTIL(etimer_expired(&et));
if(node_id == 200) {
rimeaddr_t receiver;
packetbuf_copyfrom("Hello, world", 13);
receiver.u8[0] = 1;
receiver.u8[1] = 0;
mesh_send(&mesh, &receiver);
}
}
PROCESS_END();
}
/*---------------------------------------------------------------------------*/

View file

@ -0,0 +1,67 @@
/*
* Copyright (c) 2012, Thingsquare, www.thingsquare.com.
* 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.
*/
#include "contiki.h"
#include "net/rime/trickle.h"
#include "sys/node-id.h"
#include <stdio.h>
/*---------------------------------------------------------------------------*/
PROCESS(trickle_node_process, "Trickle node");
AUTOSTART_PROCESSES(&trickle_node_process);
/*---------------------------------------------------------------------------*/
static void
trickle_recv(struct trickle_conn *c)
{
printf("%d.%d: trickle message received '%s'\n",
rimeaddr_node_addr.u8[0], rimeaddr_node_addr.u8[1],
(char *)packetbuf_dataptr());
}
const static struct trickle_callbacks trickle_callback = {trickle_recv};
static struct trickle_conn trickle;
/*---------------------------------------------------------------------------*/
PROCESS_THREAD(trickle_node_process, ev, data)
{
static struct etimer et;
PROCESS_BEGIN();
trickle_open(&trickle, CLOCK_SECOND, 145, &trickle_callback);
etimer_set(&et, CLOCK_SECOND * 4);
PROCESS_WAIT_UNTIL(etimer_expired(&et));
if(node_id == 1) {
packetbuf_copyfrom("Hello, world", 13);
trickle_send(&trickle);
}
while(1) {
PROCESS_WAIT_EVENT();
}
PROCESS_END();
}
/*---------------------------------------------------------------------------*/

View file

@ -0,0 +1 @@
include ../Makefile.simulation-test

View file

@ -3,7 +3,7 @@
<simulation>
<title>My simulation</title>
<delaytime>-2147483648</delaytime>
<randomseed>generated</randomseed>
<randomseed>1</randomseed>
<motedelay_us>1000000</motedelay_us>
<radiomedium>
se.sics.cooja.radiomediums.UDGM

View file

@ -0,0 +1 @@
include ../Makefile.simulation-test

View file

@ -94,7 +94,7 @@ make hello-world.ce TARGET=sky SMALL=0</commands>
<plugin_config>
<script>TIMEOUT(50000, log.log("last msg: " + msg + "\n")); /* print last msg at timeout */
helloworld = new java.io.File("../../../examples/sky-shell-exec/hello-world.ce");
helloworld = new java.io.File("../../examples/sky-shell-exec/hello-world.ce");
log.log("Running test on: " + helloworld.getAbsolutePath() + "\n");
if (!helloworld.exists()) {
log.log("hello-world.ce does not exist\n");

View file

@ -0,0 +1 @@
include ../Makefile.simulation-test

View file

@ -0,0 +1 @@
include ../Makefile.simulation-test

View file

@ -0,0 +1 @@
include ../Makefile.simulation-test

View file

@ -49,7 +49,7 @@ make udp-server.cooja TARGET=cooja</commands>
<identifier>mtype512</identifier>
<description>Sender</description>
<contikiapp>[CONTIKI_DIR]/examples/udp-ipv6/udp-client.c</contikiapp>
<commands>make udp-client.cooja TARGET=cooja DEFINES=UDP_CONNECTION_ADDR=fe80::301:1ff:fe01:101</commands>
<commands>make udp-client.cooja TARGET=cooja DEFINES=UDP_CONNECTION_ADDR=fe80::201:1:1:1</commands>
<moteinterface>se.sics.cooja.interfaces.Position</moteinterface>
<moteinterface>se.sics.cooja.interfaces.Battery</moteinterface>
<moteinterface>se.sics.cooja.contikimote.interfaces.ContikiVib</moteinterface>

View file

@ -508,7 +508,7 @@ print()
}
}
TIMEOUT(800000);
TIMEOUT(400000);
/* Conf. */
@ -521,7 +521,7 @@ nrNodes = 25;
nodes_starting = true;
for(i = 1; i &lt;= nrNodes; i++) {
booted[i] = false;
received[i] = "__________";
received[i] = "_____";
hops[i] = received[i];
}

View file

@ -0,0 +1 @@
include ../Makefile.simulation-test

View file

@ -0,0 +1,345 @@
<?xml version="1.0" encoding="UTF-8"?>
<simconf>
<project EXPORT="discard">[APPS_DIR]/mrm</project>
<project EXPORT="discard">[APPS_DIR]/mspsim</project>
<project EXPORT="discard">[APPS_DIR]/avrora</project>
<project EXPORT="discard">[APPS_DIR]/serial_socket</project>
<project EXPORT="discard">[APPS_DIR]/collect-view</project>
<project EXPORT="discard">[APPS_DIR]/powertracker</project>
<simulation>
<title>My simulation</title>
<randomseed>123456</randomseed>
<motedelay_us>1000000</motedelay_us>
<radiomedium>
se.sics.cooja.radiomediums.UDGM
<transmitting_range>50.0</transmitting_range>
<interference_range>50.0</interference_range>
<success_ratio_tx>1.0</success_ratio_tx>
<success_ratio_rx>1.0</success_ratio_rx>
</radiomedium>
<events>
<logoutput>40000</logoutput>
</events>
<motetype>
se.sics.cooja.contikimote.ContikiMoteType
<identifier>mtype456</identifier>
<description>Sender</description>
<source>[CONTIKI_DIR]/regression-tests/11-rpl/code/sender-node.c</source>
<commands>make TARGET=cooja clean
make sender-node.cooja TARGET=cooja</commands>
<moteinterface>se.sics.cooja.interfaces.Position</moteinterface>
<moteinterface>se.sics.cooja.interfaces.Battery</moteinterface>
<moteinterface>se.sics.cooja.contikimote.interfaces.ContikiVib</moteinterface>
<moteinterface>se.sics.cooja.contikimote.interfaces.ContikiMoteID</moteinterface>
<moteinterface>se.sics.cooja.contikimote.interfaces.ContikiRS232</moteinterface>
<moteinterface>se.sics.cooja.contikimote.interfaces.ContikiBeeper</moteinterface>
<moteinterface>se.sics.cooja.interfaces.RimeAddress</moteinterface>
<moteinterface>se.sics.cooja.contikimote.interfaces.ContikiIPAddress</moteinterface>
<moteinterface>se.sics.cooja.contikimote.interfaces.ContikiRadio</moteinterface>
<moteinterface>se.sics.cooja.contikimote.interfaces.ContikiButton</moteinterface>
<moteinterface>se.sics.cooja.contikimote.interfaces.ContikiPIR</moteinterface>
<moteinterface>se.sics.cooja.contikimote.interfaces.ContikiClock</moteinterface>
<moteinterface>se.sics.cooja.contikimote.interfaces.ContikiLED</moteinterface>
<moteinterface>se.sics.cooja.contikimote.interfaces.ContikiCFS</moteinterface>
<moteinterface>se.sics.cooja.interfaces.Mote2MoteRelations</moteinterface>
<moteinterface>se.sics.cooja.interfaces.MoteAttributes</moteinterface>
<symbols>false</symbols>
</motetype>
<motetype>
se.sics.cooja.contikimote.ContikiMoteType
<identifier>mtype452</identifier>
<description>RPL root</description>
<source>[CONTIKI_DIR]/regression-tests/11-rpl/code/root-node.c</source>
<commands>make TARGET=cooja clean
make root-node.cooja TARGET=cooja</commands>
<moteinterface>se.sics.cooja.interfaces.Position</moteinterface>
<moteinterface>se.sics.cooja.interfaces.Battery</moteinterface>
<moteinterface>se.sics.cooja.contikimote.interfaces.ContikiVib</moteinterface>
<moteinterface>se.sics.cooja.contikimote.interfaces.ContikiMoteID</moteinterface>
<moteinterface>se.sics.cooja.contikimote.interfaces.ContikiRS232</moteinterface>
<moteinterface>se.sics.cooja.contikimote.interfaces.ContikiBeeper</moteinterface>
<moteinterface>se.sics.cooja.interfaces.RimeAddress</moteinterface>
<moteinterface>se.sics.cooja.contikimote.interfaces.ContikiIPAddress</moteinterface>
<moteinterface>se.sics.cooja.contikimote.interfaces.ContikiRadio</moteinterface>
<moteinterface>se.sics.cooja.contikimote.interfaces.ContikiButton</moteinterface>
<moteinterface>se.sics.cooja.contikimote.interfaces.ContikiPIR</moteinterface>
<moteinterface>se.sics.cooja.contikimote.interfaces.ContikiClock</moteinterface>
<moteinterface>se.sics.cooja.contikimote.interfaces.ContikiLED</moteinterface>
<moteinterface>se.sics.cooja.contikimote.interfaces.ContikiCFS</moteinterface>
<moteinterface>se.sics.cooja.interfaces.Mote2MoteRelations</moteinterface>
<moteinterface>se.sics.cooja.interfaces.MoteAttributes</moteinterface>
<symbols>false</symbols>
</motetype>
<motetype>
se.sics.cooja.contikimote.ContikiMoteType
<identifier>mtype904</identifier>
<description>Receiver</description>
<source>[CONTIKI_DIR]/regression-tests/11-rpl/code/receiver-node.c</source>
<commands>make TARGET=cooja clean
make receiver-node.cooja TARGET=cooja</commands>
<moteinterface>se.sics.cooja.interfaces.Position</moteinterface>
<moteinterface>se.sics.cooja.interfaces.Battery</moteinterface>
<moteinterface>se.sics.cooja.contikimote.interfaces.ContikiVib</moteinterface>
<moteinterface>se.sics.cooja.contikimote.interfaces.ContikiMoteID</moteinterface>
<moteinterface>se.sics.cooja.contikimote.interfaces.ContikiRS232</moteinterface>
<moteinterface>se.sics.cooja.contikimote.interfaces.ContikiBeeper</moteinterface>
<moteinterface>se.sics.cooja.interfaces.RimeAddress</moteinterface>
<moteinterface>se.sics.cooja.contikimote.interfaces.ContikiIPAddress</moteinterface>
<moteinterface>se.sics.cooja.contikimote.interfaces.ContikiRadio</moteinterface>
<moteinterface>se.sics.cooja.contikimote.interfaces.ContikiButton</moteinterface>
<moteinterface>se.sics.cooja.contikimote.interfaces.ContikiPIR</moteinterface>
<moteinterface>se.sics.cooja.contikimote.interfaces.ContikiClock</moteinterface>
<moteinterface>se.sics.cooja.contikimote.interfaces.ContikiLED</moteinterface>
<moteinterface>se.sics.cooja.contikimote.interfaces.ContikiCFS</moteinterface>
<moteinterface>se.sics.cooja.interfaces.Mote2MoteRelations</moteinterface>
<moteinterface>se.sics.cooja.interfaces.MoteAttributes</moteinterface>
<symbols>false</symbols>
</motetype>
<mote>
<interface_config>
se.sics.cooja.interfaces.Position
<x>6.9596575829049145</x>
<y>-25.866060090958513</y>
<z>0.0</z>
</interface_config>
<interface_config>
se.sics.cooja.contikimote.interfaces.ContikiMoteID
<id>1</id>
</interface_config>
<interface_config>
se.sics.cooja.contikimote.interfaces.ContikiRadio
<bitrate>250.0</bitrate>
</interface_config>
<motetype_identifier>mtype904</motetype_identifier>
</mote>
<mote>
<interface_config>
se.sics.cooja.interfaces.Position
<x>132.8019872469463</x>
<y>146.1533406452311</y>
<z>0.0</z>
</interface_config>
<interface_config>
se.sics.cooja.contikimote.interfaces.ContikiMoteID
<id>2</id>
</interface_config>
<interface_config>
se.sics.cooja.contikimote.interfaces.ContikiRadio
<bitrate>250.0</bitrate>
</interface_config>
<motetype_identifier>mtype456</motetype_identifier>
</mote>
<mote>
<interface_config>
se.sics.cooja.interfaces.Position
<x>0.026556260457749753</x>
<y>39.54055615854325</y>
<z>0.0</z>
</interface_config>
<interface_config>
se.sics.cooja.contikimote.interfaces.ContikiMoteID
<id>4</id>
</interface_config>
<interface_config>
se.sics.cooja.contikimote.interfaces.ContikiRadio
<bitrate>250.0</bitrate>
</interface_config>
<motetype_identifier>mtype904</motetype_identifier>
</mote>
<mote>
<interface_config>
se.sics.cooja.interfaces.Position
<x>95.52021598473031</x>
<y>148.11553913271615</y>
<z>0.0</z>
</interface_config>
<interface_config>
se.sics.cooja.contikimote.interfaces.ContikiMoteID
<id>5</id>
</interface_config>
<interface_config>
se.sics.cooja.contikimote.interfaces.ContikiRadio
<bitrate>250.0</bitrate>
</interface_config>
<motetype_identifier>mtype904</motetype_identifier>
</mote>
<mote>
<interface_config>
se.sics.cooja.interfaces.Position
<x>62.81690785997944</x>
<y>127.1854219328756</y>
<z>0.0</z>
</interface_config>
<interface_config>
se.sics.cooja.contikimote.interfaces.ContikiMoteID
<id>6</id>
</interface_config>
<interface_config>
se.sics.cooja.contikimote.interfaces.ContikiRadio
<bitrate>250.0</bitrate>
</interface_config>
<motetype_identifier>mtype904</motetype_identifier>
</mote>
<mote>
<interface_config>
se.sics.cooja.interfaces.Position
<x>32.07579822271361</x>
<y>102.33090775806494</y>
<z>0.0</z>
</interface_config>
<interface_config>
se.sics.cooja.contikimote.interfaces.ContikiMoteID
<id>7</id>
</interface_config>
<interface_config>
se.sics.cooja.contikimote.interfaces.ContikiRadio
<bitrate>250.0</bitrate>
</interface_config>
<motetype_identifier>mtype904</motetype_identifier>
</mote>
<mote>
<interface_config>
se.sics.cooja.interfaces.Position
<x>5.913151722912886</x>
<y>73.55199660828417</y>
<z>0.0</z>
</interface_config>
<interface_config>
se.sics.cooja.contikimote.interfaces.ContikiMoteID
<id>8</id>
</interface_config>
<interface_config>
se.sics.cooja.contikimote.interfaces.ContikiRadio
<bitrate>250.0</bitrate>
</interface_config>
<motetype_identifier>mtype904</motetype_identifier>
</mote>
<mote>
<interface_config>
se.sics.cooja.interfaces.Position
<x>0.0</x>
<y>0.0</y>
<z>0.0</z>
</interface_config>
<interface_config>
se.sics.cooja.contikimote.interfaces.ContikiMoteID
<id>3</id>
</interface_config>
<interface_config>
se.sics.cooja.contikimote.interfaces.ContikiRadio
<bitrate>250.0</bitrate>
</interface_config>
<motetype_identifier>mtype452</motetype_identifier>
</mote>
</simulation>
<plugin>
se.sics.cooja.plugins.SimControl
<width>280</width>
<z>2</z>
<height>160</height>
<location_x>400</location_x>
<location_y>0</location_y>
</plugin>
<plugin>
se.sics.cooja.plugins.Visualizer
<plugin_config>
<skin>se.sics.cooja.plugins.skins.IDVisualizerSkin</skin>
<skin>se.sics.cooja.plugins.skins.UDGMVisualizerSkin</skin>
<skin>se.sics.cooja.plugins.skins.GridVisualizerSkin</skin>
<skin>se.sics.cooja.plugins.skins.MoteTypeVisualizerSkin</skin>
<viewport>0.9555608221893928 0.0 0.0 0.9555608221893928 177.34962387792274 139.71659364731656</viewport>
</plugin_config>
<width>400</width>
<z>1</z>
<height>400</height>
<location_x>1</location_x>
<location_y>1</location_y>
</plugin>
<plugin>
se.sics.cooja.plugins.LogListener
<plugin_config>
<filter />
<formatted_time />
</plugin_config>
<width>1184</width>
<z>3</z>
<height>240</height>
<location_x>402</location_x>
<location_y>162</location_y>
</plugin>
<plugin>
se.sics.cooja.plugins.Notes
<plugin_config>
<notes>Enter notes here</notes>
<decorations>true</decorations>
</plugin_config>
<width>904</width>
<z>4</z>
<height>160</height>
<location_x>680</location_x>
<location_y>0</location_y>
</plugin>
<plugin>
se.sics.cooja.plugins.ScriptRunner
<plugin_config>
<script>GENERATE_MSG(0000000, "add-sink");&#xD;
//GENERATE_MSG(1000000, "remove-sink");&#xD;
//GENERATE_MSG(1020000, "add-sink");&#xD;
&#xD;
lostMsgs = 0;&#xD;
&#xD;
TIMEOUT(1000000, if(lastMsg != -1 &amp;&amp; lostMsgs == 0) { log.testOK(); } );&#xD;
&#xD;
lastMsg = -1;&#xD;
packets = "_________";&#xD;
hops = 0;&#xD;
&#xD;
while(true) {&#xD;
YIELD();&#xD;
if(msg.equals("remove-sink")) {&#xD;
m = sim.getMoteWithID(3);&#xD;
sim.removeMote(m);&#xD;
log.log("removed sink\n");&#xD;
} else if(msg.equals("add-sink")) {&#xD;
if(!sim.getMoteWithID(3)) {&#xD;
m = sim.getMoteTypes()[1].generateMote(sim);&#xD;
m.getInterfaces().getMoteID().setMoteID(3);&#xD;
sim.addMote(m);&#xD;
log.log("added sink\n");&#xD;
} else {&#xD;
log.log("did not add sink as it was already there\n"); &#xD;
}&#xD;
} else if(msg.startsWith("Sending")) {&#xD;
hops = 0;&#xD;
} else if(msg.startsWith("#L")) {&#xD;
hops++;&#xD;
} else if(msg.startsWith("Data")) {&#xD;
// log.log("" + msg + "\n"); &#xD;
data = msg.split(" ");&#xD;
num = parseInt(data[14]);&#xD;
packets = packets.substr(0, num) + "*";&#xD;
log.log("" + hops + " " + packets + "\n");&#xD;
// log.log("Num " + num + "\n");&#xD;
if(lastMsg != -1) {&#xD;
if(num != lastMsg + 1) {&#xD;
numMissed = num - lastMsg;&#xD;
lostMsgs += numMissed;&#xD;
log.log("Missed messages " + numMissed + " before " + num + "\n"); &#xD;
for(i = 0; i &lt; numMissed; i++) {&#xD;
packets = packets.substr(0, lastMsg + i) + "_"; &#xD;
}&#xD;
} &#xD;
}&#xD;
lastMsg = num;&#xD;
}&#xD;
}</script>
<active>true</active>
</plugin_config>
<width>962</width>
<z>0</z>
<height>596</height>
<location_x>603</location_x>
<location_y>43</location_y>
</plugin>
</simconf>

View file

@ -0,0 +1,345 @@
<?xml version="1.0" encoding="UTF-8"?>
<simconf>
<project EXPORT="discard">[APPS_DIR]/mrm</project>
<project EXPORT="discard">[APPS_DIR]/mspsim</project>
<project EXPORT="discard">[APPS_DIR]/avrora</project>
<project EXPORT="discard">[APPS_DIR]/serial_socket</project>
<project EXPORT="discard">[APPS_DIR]/collect-view</project>
<project EXPORT="discard">[APPS_DIR]/powertracker</project>
<simulation>
<title>My simulation</title>
<randomseed>123456</randomseed>
<motedelay_us>1000000</motedelay_us>
<radiomedium>
se.sics.cooja.radiomediums.UDGM
<transmitting_range>50.0</transmitting_range>
<interference_range>50.0</interference_range>
<success_ratio_tx>1.0</success_ratio_tx>
<success_ratio_rx>1.0</success_ratio_rx>
</radiomedium>
<events>
<logoutput>40000</logoutput>
</events>
<motetype>
se.sics.cooja.contikimote.ContikiMoteType
<identifier>mtype748</identifier>
<description>Sender</description>
<source>[CONTIKI_DIR]/regression-tests/11-rpl/code/sender-node.c</source>
<commands>make TARGET=cooja clean
make sender-node.cooja TARGET=cooja</commands>
<moteinterface>se.sics.cooja.interfaces.Position</moteinterface>
<moteinterface>se.sics.cooja.interfaces.Battery</moteinterface>
<moteinterface>se.sics.cooja.contikimote.interfaces.ContikiVib</moteinterface>
<moteinterface>se.sics.cooja.contikimote.interfaces.ContikiMoteID</moteinterface>
<moteinterface>se.sics.cooja.contikimote.interfaces.ContikiRS232</moteinterface>
<moteinterface>se.sics.cooja.contikimote.interfaces.ContikiBeeper</moteinterface>
<moteinterface>se.sics.cooja.interfaces.RimeAddress</moteinterface>
<moteinterface>se.sics.cooja.contikimote.interfaces.ContikiIPAddress</moteinterface>
<moteinterface>se.sics.cooja.contikimote.interfaces.ContikiRadio</moteinterface>
<moteinterface>se.sics.cooja.contikimote.interfaces.ContikiButton</moteinterface>
<moteinterface>se.sics.cooja.contikimote.interfaces.ContikiPIR</moteinterface>
<moteinterface>se.sics.cooja.contikimote.interfaces.ContikiClock</moteinterface>
<moteinterface>se.sics.cooja.contikimote.interfaces.ContikiLED</moteinterface>
<moteinterface>se.sics.cooja.contikimote.interfaces.ContikiCFS</moteinterface>
<moteinterface>se.sics.cooja.interfaces.Mote2MoteRelations</moteinterface>
<moteinterface>se.sics.cooja.interfaces.MoteAttributes</moteinterface>
<symbols>false</symbols>
</motetype>
<motetype>
se.sics.cooja.contikimote.ContikiMoteType
<identifier>mtype442</identifier>
<description>RPL root</description>
<source>[CONTIKI_DIR]/regression-tests/11-rpl/code/root-node.c</source>
<commands>make TARGET=cooja clean
make root-node.cooja TARGET=cooja</commands>
<moteinterface>se.sics.cooja.interfaces.Position</moteinterface>
<moteinterface>se.sics.cooja.interfaces.Battery</moteinterface>
<moteinterface>se.sics.cooja.contikimote.interfaces.ContikiVib</moteinterface>
<moteinterface>se.sics.cooja.contikimote.interfaces.ContikiMoteID</moteinterface>
<moteinterface>se.sics.cooja.contikimote.interfaces.ContikiRS232</moteinterface>
<moteinterface>se.sics.cooja.contikimote.interfaces.ContikiBeeper</moteinterface>
<moteinterface>se.sics.cooja.interfaces.RimeAddress</moteinterface>
<moteinterface>se.sics.cooja.contikimote.interfaces.ContikiIPAddress</moteinterface>
<moteinterface>se.sics.cooja.contikimote.interfaces.ContikiRadio</moteinterface>
<moteinterface>se.sics.cooja.contikimote.interfaces.ContikiButton</moteinterface>
<moteinterface>se.sics.cooja.contikimote.interfaces.ContikiPIR</moteinterface>
<moteinterface>se.sics.cooja.contikimote.interfaces.ContikiClock</moteinterface>
<moteinterface>se.sics.cooja.contikimote.interfaces.ContikiLED</moteinterface>
<moteinterface>se.sics.cooja.contikimote.interfaces.ContikiCFS</moteinterface>
<moteinterface>se.sics.cooja.interfaces.Mote2MoteRelations</moteinterface>
<moteinterface>se.sics.cooja.interfaces.MoteAttributes</moteinterface>
<symbols>false</symbols>
</motetype>
<motetype>
se.sics.cooja.contikimote.ContikiMoteType
<identifier>mtype236</identifier>
<description>Receiver</description>
<source>[CONTIKI_DIR]/regression-tests/11-rpl/code/receiver-node.c</source>
<commands>make TARGET=cooja clean
make receiver-node.cooja TARGET=cooja</commands>
<moteinterface>se.sics.cooja.interfaces.Position</moteinterface>
<moteinterface>se.sics.cooja.interfaces.Battery</moteinterface>
<moteinterface>se.sics.cooja.contikimote.interfaces.ContikiVib</moteinterface>
<moteinterface>se.sics.cooja.contikimote.interfaces.ContikiMoteID</moteinterface>
<moteinterface>se.sics.cooja.contikimote.interfaces.ContikiRS232</moteinterface>
<moteinterface>se.sics.cooja.contikimote.interfaces.ContikiBeeper</moteinterface>
<moteinterface>se.sics.cooja.interfaces.RimeAddress</moteinterface>
<moteinterface>se.sics.cooja.contikimote.interfaces.ContikiIPAddress</moteinterface>
<moteinterface>se.sics.cooja.contikimote.interfaces.ContikiRadio</moteinterface>
<moteinterface>se.sics.cooja.contikimote.interfaces.ContikiButton</moteinterface>
<moteinterface>se.sics.cooja.contikimote.interfaces.ContikiPIR</moteinterface>
<moteinterface>se.sics.cooja.contikimote.interfaces.ContikiClock</moteinterface>
<moteinterface>se.sics.cooja.contikimote.interfaces.ContikiLED</moteinterface>
<moteinterface>se.sics.cooja.contikimote.interfaces.ContikiCFS</moteinterface>
<moteinterface>se.sics.cooja.interfaces.Mote2MoteRelations</moteinterface>
<moteinterface>se.sics.cooja.interfaces.MoteAttributes</moteinterface>
<symbols>false</symbols>
</motetype>
<mote>
<interface_config>
se.sics.cooja.interfaces.Position
<x>-22.5728586847096</x>
<y>123.9358664968653</y>
<z>0.0</z>
</interface_config>
<interface_config>
se.sics.cooja.contikimote.interfaces.ContikiMoteID
<id>1</id>
</interface_config>
<interface_config>
se.sics.cooja.contikimote.interfaces.ContikiRadio
<bitrate>250.0</bitrate>
</interface_config>
<motetype_identifier>mtype236</motetype_identifier>
</mote>
<mote>
<interface_config>
se.sics.cooja.interfaces.Position
<x>116.13379149678028</x>
<y>88.36698920455684</y>
<z>0.0</z>
</interface_config>
<interface_config>
se.sics.cooja.contikimote.interfaces.ContikiMoteID
<id>2</id>
</interface_config>
<interface_config>
se.sics.cooja.contikimote.interfaces.ContikiRadio
<bitrate>250.0</bitrate>
</interface_config>
<motetype_identifier>mtype748</motetype_identifier>
</mote>
<mote>
<interface_config>
se.sics.cooja.interfaces.Position
<x>-1.39303771455413</x>
<y>100.21446701029119</y>
<z>0.0</z>
</interface_config>
<interface_config>
se.sics.cooja.contikimote.interfaces.ContikiMoteID
<id>4</id>
</interface_config>
<interface_config>
se.sics.cooja.contikimote.interfaces.ContikiRadio
<bitrate>250.0</bitrate>
</interface_config>
<motetype_identifier>mtype236</motetype_identifier>
</mote>
<mote>
<interface_config>
se.sics.cooja.interfaces.Position
<x>95.25095618820441</x>
<y>63.14998053005015</y>
<z>0.0</z>
</interface_config>
<interface_config>
se.sics.cooja.contikimote.interfaces.ContikiMoteID
<id>5</id>
</interface_config>
<interface_config>
se.sics.cooja.contikimote.interfaces.ContikiRadio
<bitrate>250.0</bitrate>
</interface_config>
<motetype_identifier>mtype236</motetype_identifier>
</mote>
<mote>
<interface_config>
se.sics.cooja.interfaces.Position
<x>66.09378990830604</x>
<y>38.32698761608261</y>
<z>0.0</z>
</interface_config>
<interface_config>
se.sics.cooja.contikimote.interfaces.ContikiMoteID
<id>6</id>
</interface_config>
<interface_config>
se.sics.cooja.contikimote.interfaces.ContikiRadio
<bitrate>250.0</bitrate>
</interface_config>
<motetype_identifier>mtype236</motetype_identifier>
</mote>
<mote>
<interface_config>
se.sics.cooja.interfaces.Position
<x>29.05630841762433</x>
<y>30.840688165838436</y>
<z>0.0</z>
</interface_config>
<interface_config>
se.sics.cooja.contikimote.interfaces.ContikiMoteID
<id>7</id>
</interface_config>
<interface_config>
se.sics.cooja.contikimote.interfaces.ContikiRadio
<bitrate>250.0</bitrate>
</interface_config>
<motetype_identifier>mtype236</motetype_identifier>
</mote>
<mote>
<interface_config>
se.sics.cooja.interfaces.Position
<x>10.931583432822638</x>
<y>69.848248459216</y>
<z>0.0</z>
</interface_config>
<interface_config>
se.sics.cooja.contikimote.interfaces.ContikiMoteID
<id>8</id>
</interface_config>
<interface_config>
se.sics.cooja.contikimote.interfaces.ContikiRadio
<bitrate>250.0</bitrate>
</interface_config>
<motetype_identifier>mtype236</motetype_identifier>
</mote>
<mote>
<interface_config>
se.sics.cooja.interfaces.Position
<x>0.0</x>
<y>0.0</y>
<z>0.0</z>
</interface_config>
<interface_config>
se.sics.cooja.contikimote.interfaces.ContikiMoteID
<id>3</id>
</interface_config>
<interface_config>
se.sics.cooja.contikimote.interfaces.ContikiRadio
<bitrate>250.0</bitrate>
</interface_config>
<motetype_identifier>mtype442</motetype_identifier>
</mote>
</simulation>
<plugin>
se.sics.cooja.plugins.SimControl
<width>280</width>
<z>0</z>
<height>160</height>
<location_x>400</location_x>
<location_y>0</location_y>
</plugin>
<plugin>
se.sics.cooja.plugins.Visualizer
<plugin_config>
<skin>se.sics.cooja.plugins.skins.IDVisualizerSkin</skin>
<skin>se.sics.cooja.plugins.skins.UDGMVisualizerSkin</skin>
<skin>se.sics.cooja.plugins.skins.GridVisualizerSkin</skin>
<skin>se.sics.cooja.plugins.skins.MoteTypeVisualizerSkin</skin>
<viewport>2.5379695437350276 0.0 0.0 2.5379695437350276 75.2726010197627 15.727272727272757</viewport>
</plugin_config>
<width>400</width>
<z>2</z>
<height>400</height>
<location_x>1</location_x>
<location_y>1</location_y>
</plugin>
<plugin>
se.sics.cooja.plugins.LogListener
<plugin_config>
<filter />
<formatted_time />
</plugin_config>
<width>1184</width>
<z>3</z>
<height>240</height>
<location_x>402</location_x>
<location_y>162</location_y>
</plugin>
<plugin>
se.sics.cooja.plugins.Notes
<plugin_config>
<notes>Enter notes here</notes>
<decorations>true</decorations>
</plugin_config>
<width>904</width>
<z>4</z>
<height>160</height>
<location_x>680</location_x>
<location_y>0</location_y>
</plugin>
<plugin>
se.sics.cooja.plugins.ScriptRunner
<plugin_config>
<script>GENERATE_MSG(0000000, "add-sink");&#xD;
GENERATE_MSG(1000000, "remove-sink");&#xD;
GENERATE_MSG(1000000, "add-sink");&#xD;
&#xD;
lostMsgs = 0;&#xD;
&#xD;
TIMEOUT(10000000, if(lastMsg != -1 &amp;&amp; lostMsgs == 0) { log.testOK(); } );&#xD;
&#xD;
lastMsg = -1;&#xD;
packets = "_________";&#xD;
hops = 0;&#xD;
&#xD;
while(true) {&#xD;
YIELD();&#xD;
if(msg.equals("remove-sink")) {&#xD;
m = sim.getMoteWithID(3);&#xD;
sim.removeMote(m);&#xD;
log.log("removed sink\n");&#xD;
} else if(msg.equals("add-sink")) {&#xD;
if(!sim.getMoteWithID(3)) {&#xD;
m = sim.getMoteTypes()[1].generateMote(sim);&#xD;
m.getInterfaces().getMoteID().setMoteID(3);&#xD;
sim.addMote(m);&#xD;
log.log("added sink\n");&#xD;
} else {&#xD;
log.log("did not add sink as it was already there\n"); &#xD;
}&#xD;
} else if(msg.startsWith("Sending")) {&#xD;
hops = 0;&#xD;
} else if(msg.startsWith("#L")) {&#xD;
hops++;&#xD;
} else if(msg.startsWith("Data")) {&#xD;
// log.log("" + msg + "\n"); &#xD;
data = msg.split(" ");&#xD;
num = parseInt(data[14]);&#xD;
packets = packets.substr(0, num) + "*";&#xD;
log.log("" + hops + " " + packets + "\n");&#xD;
// log.log("Num " + num + "\n");&#xD;
if(lastMsg != -1) {&#xD;
if(num != lastMsg + 1) {&#xD;
numMissed = num - lastMsg;&#xD;
lostMsgs += numMissed;&#xD;
log.log("Missed messages " + numMissed + " before " + num + "\n"); &#xD;
for(i = 0; i &lt; numMissed; i++) {&#xD;
packets = packets.substr(0, lastMsg + i) + "_"; &#xD;
}&#xD;
} &#xD;
}&#xD;
lastMsg = num;&#xD;
}&#xD;
}</script>
<active>true</active>
</plugin_config>
<width>962</width>
<z>1</z>
<height>596</height>
<location_x>603</location_x>
<location_y>43</location_y>
</plugin>
</simconf>

View file

@ -0,0 +1,294 @@
<?xml version="1.0" encoding="UTF-8"?>
<simconf>
<project EXPORT="discard">[APPS_DIR]/mrm</project>
<project EXPORT="discard">[APPS_DIR]/mspsim</project>
<project EXPORT="discard">[APPS_DIR]/avrora</project>
<project EXPORT="discard">[APPS_DIR]/serial_socket</project>
<project EXPORT="discard">[APPS_DIR]/collect-view</project>
<project EXPORT="discard">[APPS_DIR]/powertracker</project>
<simulation>
<title>My simulation</title>
<randomseed>123456</randomseed>
<motedelay_us>1000000</motedelay_us>
<radiomedium>
se.sics.cooja.radiomediums.UDGM
<transmitting_range>50.0</transmitting_range>
<interference_range>50.0</interference_range>
<success_ratio_tx>1.0</success_ratio_tx>
<success_ratio_rx>1.0</success_ratio_rx>
</radiomedium>
<events>
<logoutput>40000</logoutput>
</events>
<motetype>
se.sics.cooja.contikimote.ContikiMoteType
<identifier>mtype391</identifier>
<description>Sender</description>
<source>[CONTIKI_DIR]/regression-tests/11-rpl/code/sender-node.c</source>
<commands>make TARGET=cooja clean
make sender-node.cooja TARGET=cooja</commands>
<moteinterface>se.sics.cooja.interfaces.Position</moteinterface>
<moteinterface>se.sics.cooja.interfaces.Battery</moteinterface>
<moteinterface>se.sics.cooja.contikimote.interfaces.ContikiVib</moteinterface>
<moteinterface>se.sics.cooja.contikimote.interfaces.ContikiMoteID</moteinterface>
<moteinterface>se.sics.cooja.contikimote.interfaces.ContikiRS232</moteinterface>
<moteinterface>se.sics.cooja.contikimote.interfaces.ContikiBeeper</moteinterface>
<moteinterface>se.sics.cooja.interfaces.RimeAddress</moteinterface>
<moteinterface>se.sics.cooja.contikimote.interfaces.ContikiIPAddress</moteinterface>
<moteinterface>se.sics.cooja.contikimote.interfaces.ContikiRadio</moteinterface>
<moteinterface>se.sics.cooja.contikimote.interfaces.ContikiButton</moteinterface>
<moteinterface>se.sics.cooja.contikimote.interfaces.ContikiPIR</moteinterface>
<moteinterface>se.sics.cooja.contikimote.interfaces.ContikiClock</moteinterface>
<moteinterface>se.sics.cooja.contikimote.interfaces.ContikiLED</moteinterface>
<moteinterface>se.sics.cooja.contikimote.interfaces.ContikiCFS</moteinterface>
<moteinterface>se.sics.cooja.interfaces.Mote2MoteRelations</moteinterface>
<moteinterface>se.sics.cooja.interfaces.MoteAttributes</moteinterface>
<symbols>false</symbols>
</motetype>
<motetype>
se.sics.cooja.contikimote.ContikiMoteType
<identifier>mtype250</identifier>
<description>RPL root</description>
<source>[CONTIKI_DIR]/regression-tests/11-rpl/code/root-node.c</source>
<commands>make TARGET=cooja clean
make root-node.cooja TARGET=cooja</commands>
<moteinterface>se.sics.cooja.interfaces.Position</moteinterface>
<moteinterface>se.sics.cooja.interfaces.Battery</moteinterface>
<moteinterface>se.sics.cooja.contikimote.interfaces.ContikiVib</moteinterface>
<moteinterface>se.sics.cooja.contikimote.interfaces.ContikiMoteID</moteinterface>
<moteinterface>se.sics.cooja.contikimote.interfaces.ContikiRS232</moteinterface>
<moteinterface>se.sics.cooja.contikimote.interfaces.ContikiBeeper</moteinterface>
<moteinterface>se.sics.cooja.interfaces.RimeAddress</moteinterface>
<moteinterface>se.sics.cooja.contikimote.interfaces.ContikiIPAddress</moteinterface>
<moteinterface>se.sics.cooja.contikimote.interfaces.ContikiRadio</moteinterface>
<moteinterface>se.sics.cooja.contikimote.interfaces.ContikiButton</moteinterface>
<moteinterface>se.sics.cooja.contikimote.interfaces.ContikiPIR</moteinterface>
<moteinterface>se.sics.cooja.contikimote.interfaces.ContikiClock</moteinterface>
<moteinterface>se.sics.cooja.contikimote.interfaces.ContikiLED</moteinterface>
<moteinterface>se.sics.cooja.contikimote.interfaces.ContikiCFS</moteinterface>
<moteinterface>se.sics.cooja.interfaces.Mote2MoteRelations</moteinterface>
<moteinterface>se.sics.cooja.interfaces.MoteAttributes</moteinterface>
<symbols>false</symbols>
</motetype>
<motetype>
se.sics.cooja.contikimote.ContikiMoteType
<identifier>mtype822</identifier>
<description>Receiver</description>
<source>[CONTIKI_DIR]/regression-tests/11-rpl/code/receiver-node.c</source>
<commands>make TARGET=cooja clean
make receiver-node.cooja TARGET=cooja</commands>
<moteinterface>se.sics.cooja.interfaces.Position</moteinterface>
<moteinterface>se.sics.cooja.interfaces.Battery</moteinterface>
<moteinterface>se.sics.cooja.contikimote.interfaces.ContikiVib</moteinterface>
<moteinterface>se.sics.cooja.contikimote.interfaces.ContikiMoteID</moteinterface>
<moteinterface>se.sics.cooja.contikimote.interfaces.ContikiRS232</moteinterface>
<moteinterface>se.sics.cooja.contikimote.interfaces.ContikiBeeper</moteinterface>
<moteinterface>se.sics.cooja.interfaces.RimeAddress</moteinterface>
<moteinterface>se.sics.cooja.contikimote.interfaces.ContikiIPAddress</moteinterface>
<moteinterface>se.sics.cooja.contikimote.interfaces.ContikiRadio</moteinterface>
<moteinterface>se.sics.cooja.contikimote.interfaces.ContikiButton</moteinterface>
<moteinterface>se.sics.cooja.contikimote.interfaces.ContikiPIR</moteinterface>
<moteinterface>se.sics.cooja.contikimote.interfaces.ContikiClock</moteinterface>
<moteinterface>se.sics.cooja.contikimote.interfaces.ContikiLED</moteinterface>
<moteinterface>se.sics.cooja.contikimote.interfaces.ContikiCFS</moteinterface>
<moteinterface>se.sics.cooja.interfaces.Mote2MoteRelations</moteinterface>
<moteinterface>se.sics.cooja.interfaces.MoteAttributes</moteinterface>
<symbols>false</symbols>
</motetype>
<mote>
<interface_config>
se.sics.cooja.interfaces.Position
<x>7.772906112657773</x>
<y>86.396910401861</y>
<z>0.0</z>
</interface_config>
<interface_config>
se.sics.cooja.contikimote.interfaces.ContikiMoteID
<id>1</id>
</interface_config>
<interface_config>
se.sics.cooja.contikimote.interfaces.ContikiRadio
<bitrate>250.0</bitrate>
</interface_config>
<motetype_identifier>mtype822</motetype_identifier>
</mote>
<mote>
<interface_config>
se.sics.cooja.interfaces.Position
<x>75.54361692539452</x>
<y>14.292026223193414</y>
<z>0.0</z>
</interface_config>
<interface_config>
se.sics.cooja.contikimote.interfaces.ContikiMoteID
<id>2</id>
</interface_config>
<interface_config>
se.sics.cooja.contikimote.interfaces.ContikiRadio
<bitrate>250.0</bitrate>
</interface_config>
<motetype_identifier>mtype391</motetype_identifier>
</mote>
<mote>
<interface_config>
se.sics.cooja.interfaces.Position
<x>47.962513687652844</x>
<y>7.199742533488408</y>
<z>0.0</z>
</interface_config>
<interface_config>
se.sics.cooja.contikimote.interfaces.ContikiMoteID
<id>6</id>
</interface_config>
<interface_config>
se.sics.cooja.contikimote.interfaces.ContikiRadio
<bitrate>250.0</bitrate>
</interface_config>
<motetype_identifier>mtype822</motetype_identifier>
</mote>
<mote>
<interface_config>
se.sics.cooja.interfaces.Position
<x>1.8626697045702818</x>
<y>47.783365869022624</y>
<z>0.0</z>
</interface_config>
<interface_config>
se.sics.cooja.contikimote.interfaces.ContikiMoteID
<id>8</id>
</interface_config>
<interface_config>
se.sics.cooja.contikimote.interfaces.ContikiRadio
<bitrate>250.0</bitrate>
</interface_config>
<motetype_identifier>mtype822</motetype_identifier>
</mote>
<mote>
<interface_config>
se.sics.cooja.interfaces.Position
<x>0.0</x>
<y>0.0</y>
<z>0.0</z>
</interface_config>
<interface_config>
se.sics.cooja.contikimote.interfaces.ContikiMoteID
<id>3</id>
</interface_config>
<interface_config>
se.sics.cooja.contikimote.interfaces.ContikiRadio
<bitrate>250.0</bitrate>
</interface_config>
<motetype_identifier>mtype250</motetype_identifier>
</mote>
</simulation>
<plugin>
se.sics.cooja.plugins.SimControl
<width>280</width>
<z>0</z>
<height>160</height>
<location_x>400</location_x>
<location_y>0</location_y>
</plugin>
<plugin>
se.sics.cooja.plugins.Visualizer
<plugin_config>
<skin>se.sics.cooja.plugins.skins.IDVisualizerSkin</skin>
<skin>se.sics.cooja.plugins.skins.UDGMVisualizerSkin</skin>
<skin>se.sics.cooja.plugins.skins.GridVisualizerSkin</skin>
<skin>se.sics.cooja.plugins.skins.MoteTypeVisualizerSkin</skin>
<viewport>2.5379695437350276 0.0 0.0 2.5379695437350276 78.27260101976275 40.72727272727276</viewport>
</plugin_config>
<width>400</width>
<z>2</z>
<height>400</height>
<location_x>1</location_x>
<location_y>1</location_y>
</plugin>
<plugin>
se.sics.cooja.plugins.LogListener
<plugin_config>
<filter />
<formatted_time />
</plugin_config>
<width>1184</width>
<z>3</z>
<height>240</height>
<location_x>402</location_x>
<location_y>162</location_y>
</plugin>
<plugin>
se.sics.cooja.plugins.Notes
<plugin_config>
<notes>Enter notes here</notes>
<decorations>true</decorations>
</plugin_config>
<width>904</width>
<z>4</z>
<height>160</height>
<location_x>680</location_x>
<location_y>0</location_y>
</plugin>
<plugin>
se.sics.cooja.plugins.ScriptRunner
<plugin_config>
<script>GENERATE_MSG(0000000, "add-sink");&#xD;
//GENERATE_MSG(1000000, "remove-sink");&#xD;
//GENERATE_MSG(2000000, "add-sink");&#xD;
&#xD;
lostMsgs = 0;&#xD;
&#xD;
TIMEOUT(100000000, if(lastMsg != -1 &amp;&amp; lostMsgs == 0) { log.testOK(); } );&#xD;
&#xD;
lastMsg = -1;&#xD;
packets = "_________";&#xD;
hops = 0;&#xD;
&#xD;
while(true) {&#xD;
YIELD();&#xD;
if(msg.equals("remove-sink")) {&#xD;
m = sim.getMoteWithID(3);&#xD;
sim.removeMote(m);&#xD;
log.log("removed sink\n");&#xD;
} else if(msg.equals("add-sink")) {&#xD;
if(!sim.getMoteWithID(3)) {&#xD;
m = sim.getMoteTypes()[1].generateMote(sim);&#xD;
m.getInterfaces().getMoteID().setMoteID(3);&#xD;
sim.addMote(m);&#xD;
log.log("added sink\n");&#xD;
} else {&#xD;
log.log("did not add sink as it was already there\n"); &#xD;
}&#xD;
} else if(msg.startsWith("Sending")) {&#xD;
hops = 0;&#xD;
} else if(msg.startsWith("#L")) {&#xD;
hops++;&#xD;
} else if(msg.startsWith("Data")) {&#xD;
// log.log("" + msg + "\n"); &#xD;
data = msg.split(" ");&#xD;
num = parseInt(data[14]);&#xD;
packets = packets.substr(0, num) + "*";&#xD;
log.log("" + hops + " " + packets + "\n");&#xD;
// log.log("Num " + num + "\n");&#xD;
if(lastMsg != -1) {&#xD;
if(num != lastMsg + 1) {&#xD;
numMissed = num - lastMsg;&#xD;
lostMsgs += numMissed;&#xD;
log.log("Missed messages " + numMissed + " before " + num + "\n"); &#xD;
for(i = 0; i &lt; numMissed; i++) {&#xD;
packets = packets.substr(0, lastMsg + i) + "_"; &#xD;
}&#xD;
} &#xD;
}&#xD;
lastMsg = num;&#xD;
}&#xD;
}</script>
<active>true</active>
</plugin_config>
<width>962</width>
<z>1</z>
<height>596</height>
<location_x>603</location_x>
<location_y>43</location_y>
</plugin>
</simconf>

File diff suppressed because it is too large Load diff

View file

@ -0,0 +1 @@
include ../Makefile.simulation-test

View file

@ -0,0 +1,10 @@
all: sender-node receiver-node root-node
CONTIKI=../../..
WITH_UIP6=1
UIP_CONF_IPV6=1
CFLAGS+= -DUIP_CONF_IPV6_RPL
CFLAGS+=-DPROJECT_CONF_H=\"project-conf.h\"
include $(CONTIKI)/Makefile.include

View file

@ -0,0 +1,30 @@
/*
* Copyright (c) 2012, Thingsquare, www.thingsquare.com.
* 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.
*/
#define TCPIP_CONF_ANNOTATE_TRANSMISSIONS 1

View file

@ -0,0 +1,132 @@
/*
* Copyright (c) 2012, Thingsquare, www.thingsquare.com.
* 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.
*/
#include "contiki.h"
#include "lib/random.h"
#include "sys/ctimer.h"
#include "sys/etimer.h"
#include "net/uip.h"
#include "net/uip-ds6.h"
#include "net/uip-debug.h"
#include "simple-udp.h"
#include "net/rpl/rpl.h"
#include "dev/leds.h"
#include <stdio.h>
#include <string.h>
#define UDP_PORT 1234
static struct simple_udp_connection unicast_connection;
/*---------------------------------------------------------------------------*/
PROCESS(receiver_node_process, "Receiver node");
AUTOSTART_PROCESSES(&receiver_node_process);
/*---------------------------------------------------------------------------*/
static void
receiver(struct simple_udp_connection *c,
const uip_ipaddr_t *sender_addr,
uint16_t sender_port,
const uip_ipaddr_t *receiver_addr,
uint16_t receiver_port,
const uint8_t *data,
uint16_t datalen)
{
printf("Data received from ");
uip_debug_ipaddr_print(sender_addr);
printf(" on port %d from port %d with length %d: '%s'\n",
receiver_port, sender_port, datalen, data);
}
/*---------------------------------------------------------------------------*/
static uip_ipaddr_t *
set_global_address(void)
{
static uip_ipaddr_t ipaddr;
int i;
uint8_t state;
uip_ip6addr(&ipaddr, 0xaaaa, 0, 0, 0, 0, 0, 0, 0);
uip_ds6_set_addr_iid(&ipaddr, &uip_lladdr);
uip_ds6_addr_add(&ipaddr, 0, ADDR_AUTOCONF);
printf("IPv6 addresses: ");
for(i = 0; i < UIP_DS6_ADDR_NB; i++) {
state = uip_ds6_if.addr_list[i].state;
if(uip_ds6_if.addr_list[i].isused &&
(state == ADDR_TENTATIVE || state == ADDR_PREFERRED)) {
uip_debug_ipaddr_print(&uip_ds6_if.addr_list[i].ipaddr);
printf("\n");
}
}
return &ipaddr;
}
/*---------------------------------------------------------------------------*/
uint8_t should_blink = 1;
static void
route_callback(int event, uip_ipaddr_t *route, uip_ipaddr_t *ipaddr)
{
if(event == UIP_DS6_NOTIFICATION_DEFRT_ADD) {
should_blink = 0;
} else if(event == UIP_DS6_NOTIFICATION_DEFRT_RM) {
should_blink = 1;
}
}
/*---------------------------------------------------------------------------*/
PROCESS_THREAD(receiver_node_process, ev, data)
{
static struct etimer et;
static struct uip_ds6_notification n;
uip_ipaddr_t *ipaddr;
PROCESS_BEGIN();
ipaddr = set_global_address();
uip_ds6_notification_add(&n, route_callback);
simple_udp_register(&unicast_connection, UDP_PORT,
NULL, UDP_PORT, receiver);
etimer_set(&et, CLOCK_SECOND);
while(1) {
PROCESS_WAIT_EVENT_UNTIL(etimer_expired(&et));
etimer_reset(&et);
if(should_blink) {
leds_on(LEDS_ALL);
PROCESS_WAIT_EVENT_UNTIL(etimer_expired(&et));
etimer_reset(&et);
leds_off(LEDS_ALL);
}
}
PROCESS_END();
}
/*---------------------------------------------------------------------------*/

View file

@ -0,0 +1,135 @@
/*
* Copyright (c) 2012, Thingsquare, www.thingsquare.com.
* 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.
*/
#include "contiki.h"
#include "lib/random.h"
#include "sys/ctimer.h"
#include "sys/etimer.h"
#include "net/uip.h"
#include "net/uip-ds6.h"
#include "net/uip-debug.h"
#include "simple-udp.h"
#include "net/rpl/rpl.h"
#include <stdio.h>
#include <string.h>
#define UDP_PORT 1234
#define SERVICE_ID 190
#define SEND_INTERVAL (10 * CLOCK_SECOND)
#define SEND_TIME (random_rand() % (SEND_INTERVAL))
static struct simple_udp_connection unicast_connection;
/*---------------------------------------------------------------------------*/
PROCESS(unicast_receiver_process, "Unicast receiver example process");
AUTOSTART_PROCESSES(&unicast_receiver_process);
/*---------------------------------------------------------------------------*/
static void
receiver(struct simple_udp_connection *c,
const uip_ipaddr_t *sender_addr,
uint16_t sender_port,
const uip_ipaddr_t *receiver_addr,
uint16_t receiver_port,
const uint8_t *data,
uint16_t datalen)
{
printf("Data received from ");
uip_debug_ipaddr_print(sender_addr);
printf(" on port %d from port %d with length %d: '%s'\n",
receiver_port, sender_port, datalen, data);
}
/*---------------------------------------------------------------------------*/
static uip_ipaddr_t *
set_global_address(void)
{
static uip_ipaddr_t ipaddr;
int i;
uint8_t state;
uip_ip6addr(&ipaddr, 0xaaaa, 0, 0, 0, 0, 0, 0, 0);
uip_ds6_set_addr_iid(&ipaddr, &uip_lladdr);
uip_ds6_addr_add(&ipaddr, 0, ADDR_AUTOCONF);
printf("IPv6 addresses: ");
for(i = 0; i < UIP_DS6_ADDR_NB; i++) {
state = uip_ds6_if.addr_list[i].state;
if(uip_ds6_if.addr_list[i].isused &&
(state == ADDR_TENTATIVE || state == ADDR_PREFERRED)) {
uip_debug_ipaddr_print(&uip_ds6_if.addr_list[i].ipaddr);
printf("\n");
}
}
return &ipaddr;
}
/*---------------------------------------------------------------------------*/
static void
create_rpl_dag(uip_ipaddr_t *ipaddr)
{
struct uip_ds6_addr *root_if;
root_if = uip_ds6_addr_lookup(ipaddr);
if(root_if != NULL) {
rpl_dag_t *dag;
uip_ipaddr_t prefix;
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");
} else {
PRINTF("failed to create a new RPL DAG\n");
}
}
/*---------------------------------------------------------------------------*/
PROCESS_THREAD(unicast_receiver_process, ev, data)
{
uip_ipaddr_t *ipaddr;
PROCESS_BEGIN();
ipaddr = set_global_address();
create_rpl_dag(ipaddr);
simple_udp_register(&unicast_connection, UDP_PORT,
NULL, UDP_PORT, receiver);
while(1) {
PROCESS_WAIT_EVENT();
}
PROCESS_END();
}
/*---------------------------------------------------------------------------*/

View file

@ -0,0 +1,129 @@
/*
* Copyright (c) 2012, Thingsquare, www.thingsquare.com.
* 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.
*/
#include "contiki.h"
#include "lib/random.h"
#include "sys/ctimer.h"
#include "sys/etimer.h"
#include "net/uip.h"
#include "net/uip-ds6.h"
#include "net/uip-debug.h"
#include "simple-udp.h"
#include <stdio.h>
#include <string.h>
#define UDP_PORT 1234
#define SEND_INTERVAL (60 * CLOCK_SECOND)
#define SEND_TIME (random_rand() % (SEND_INTERVAL))
static struct simple_udp_connection unicast_connection;
/*---------------------------------------------------------------------------*/
PROCESS(sender_node_process, "Sender node process");
AUTOSTART_PROCESSES(&sender_node_process);
/*---------------------------------------------------------------------------*/
static void
receiver(struct simple_udp_connection *c,
const uip_ipaddr_t *sender_addr,
uint16_t sender_port,
const uip_ipaddr_t *receiver_addr,
uint16_t receiver_port,
const uint8_t *data,
uint16_t datalen)
{
printf("Sender received data on port %d from port %d with length %d\n",
receiver_port, sender_port, datalen);
}
/*---------------------------------------------------------------------------*/
static void
set_global_address(void)
{
uip_ipaddr_t ipaddr;
int i;
uint8_t state;
uip_ip6addr(&ipaddr, 0xaaaa, 0, 0, 0, 0, 0, 0, 0);
uip_ds6_set_addr_iid(&ipaddr, &uip_lladdr);
uip_ds6_addr_add(&ipaddr, 0, ADDR_AUTOCONF);
printf("IPv6 addresses: ");
for(i = 0; i < UIP_DS6_ADDR_NB; i++) {
state = uip_ds6_if.addr_list[i].state;
if(uip_ds6_if.addr_list[i].isused &&
(state == ADDR_TENTATIVE || state == ADDR_PREFERRED)) {
uip_debug_ipaddr_print(&uip_ds6_if.addr_list[i].ipaddr);
printf("\n");
}
}
}
/*---------------------------------------------------------------------------*/
PROCESS_THREAD(sender_node_process, ev, data)
{
static struct etimer periodic_timer;
static struct etimer send_timer;
uip_ipaddr_t addr;
PROCESS_BEGIN();
set_global_address();
simple_udp_register(&unicast_connection, UDP_PORT,
NULL, UDP_PORT, receiver);
etimer_set(&periodic_timer, SEND_INTERVAL);
while(1) {
PROCESS_WAIT_EVENT_UNTIL(etimer_expired(&periodic_timer));
etimer_reset(&periodic_timer);
etimer_set(&send_timer, SEND_TIME);
PROCESS_WAIT_EVENT_UNTIL(etimer_expired(&send_timer));
uip_ip6addr(&addr, 0xaaaa, 0, 0, 0, 0x0201, 0x001, 0x001, 0x001);
{
static unsigned int message_number;
char buf[20];
printf("Sending unicast to ");
uip_debug_ipaddr_print(&addr);
printf("\n");
sprintf(buf, "Message %d", message_number);
message_number++;
simple_udp_sendto(&unicast_connection, buf, strlen(buf) + 1, &addr);
}
}
PROCESS_END();
}
/*---------------------------------------------------------------------------*/

View file

@ -0,0 +1 @@
include ../Makefile.simulation-test

View file

@ -21,7 +21,7 @@ sim.setSpeedLimit(1.0);
/* create tunnel interface */
log.log("create tunnel interface\n");
launcher = new java.lang.ProcessBuilder["(java.lang.String[])"](['sh','-c',CMD_TUNNEL]);
launcher.directory(new java.io.File("../../../examples/er-rest-example"));
launcher.directory(new java.io.File("../../examples/er-rest-example"));
launcher.redirectErrorStream(true);
tunProcess = launcher.start();
tunRunnable = new Object();

49
regression-tests/Makefile Normal file
View file

@ -0,0 +1,49 @@
# Copyright (c) 2012, Thingsquare, www.thingsquare.com.
# 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.
TESTS=$(wildcard ??-*)
SUMMARIES=$(foreach test,$(TESTS),summary-$(test))
CONTIKI=..
run: clean summary
summary: $(SUMMARIES)
grep '' $(SUMMARIES) > summary
summary-%:
@make -C $* RUNALL=true summary || true
@echo -n $* | cat - $*/summary > $@
@rm $*/summary
clean:
rm -f $(SUMMARIES)
cooja: $(CONTIKI)/tools/cooja/dist/cooja.jar
$(CONTIKI)/tools/cooja/dist/cooja.jar:
(cd $(CONTIKI)/tools/cooja; ant jar)

View file

@ -0,0 +1,95 @@
# Copyright (c) 2012, Thingsquare, www.thingsquare.com.
# 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.
all: summary
build: examples tools
dirnam = $(word 1, $(subst /, ,${1}))
target = $(word 2, $(subst /, ,${1}))
# The stuff below is some GNU make magic to automatically make make
# give each compile test a number, prefixed with a 0 if the number is
# < 10, to match the way the simulation tests output works.
nine := x x x x x x x x x
max = $(subst xx,x,$(join ${1},${2}))
gt = $(filter-out $(words ${1}),$(words $(call max,${1},${2})))
addzero = $(if $(call gt,${nine},$(1)),$(words ${1}),0$(words ${1}))
define dooneexample
@echo Buildling example $(3): $(1) for target $(2)
@((cd $(EXAMPLESDIR)/$(1); \
make TARGET=$(2) clean && make TARGET=$(2)) > \
$(3)-$(1)-$(2).report 2>&1 && \
(echo $(1) $(2): OK | tee $(3)-$(1)-$(2).summary) || \
(echo $(1) $(2): FAIL ಠ.ಠ | tee $(3)-$(1)-$(2).summary ; \
tail -10 $(3)-$(1)-$(2).report > $(3)-$(1)-$(2).faillog))
endef
define doexample
$(eval i+=x)
$(call dooneexample,$(call dirnam,${1}),$(call target,${1}),$(call addzero,${i}))
endef
#end of GNU make magic
examples:
$(foreach ex, $(EXAMPLES), $(call doexample, ${ex}))
report: build
@echo Examples | cat - ??-*.report > report
@echo Tools | cat - $(foreach tool, $(TOOLS), $(tool).report) >> report
examples-summary: build
@echo Example summary | cat - $(foreach example, $(EXAMPLES), \
$(foreach target, $(EXAMPLESTARGETS), $(example)-$(target).summary)) > \
$@
@echo Tools summary | cat - $(foreach tool, $(TOOLS), $(tool).summary) >> $@
faillog-summary: build
@rm -f $@; touch $@
@$(foreach log, $(wildcard *.faillog), grep -H '' $(log) >> $@;)
summary: examples-summary faillog-summary
@cat *.summary > $@
@ls -1 ??-*.faillog > /dev/null 2>&1; [ $$? = 0 ] && tail -v ??-*.faillog >> $@ || true
@rm -f $^
tools:
@$(foreach tool, $(TOOLS), \
(((cd $(TOOLSDIR)/$(tool); make) > $(tool).report 2>&1) && \
(echo $(tool): OK | tee $(tool).summary) || \
(echo $(tool): FAIL ಠ_ಠ | tee $(tool).summary ; \
tail -10 $(tool).report > $(tool).faillog)) ; )
clean:
@rm -f *.summary *.report *.faillog summary report
@$(foreach example, $(EXAMPLES), \
$(foreach target, $(EXAMPLESTARGETS), \
(cd $(EXAMPLESDIR)/$(example); make TARGET=$(target) clean);))
@$(foreach tool, $(TOOLS), \
(cd $(TOOLSDIR)/$(tool); make clean);)

View file

@ -0,0 +1,76 @@
# Copyright (c) 2012, Thingsquare, www.thingsquare.com.
# 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.
TESTS=$(wildcard ??-*.csc)
TESTLOGS=$(patsubst %.csc,%.testlog,$(TESTS))
LOGS=$(patsubst %.csc,%.log,$(TESTS))
FAILLOGS=$(patsubst %.csc,%.faillog,$(TESTS))
CONTIKI=../..
tests: $(TESTLOGS)
report: clean tests
@echo | grep -s -e '' - $(LOGS) $(TESTLOGS) $(FAILLOGS) > $@ || true
summary: report
ifeq ($(TESTS),)
@echo No tests > $@
else
@egrep -e ' OK| FAIL' $< > $@
@ls -1 ??-*.faillog > /dev/null 2>&1; [ $$? = 0 ] && tail -v ??-*.log ??-*.faillog >> $@ || true
endif
all: cooja clean tests
ifdef RUNALL
RUNALL=true
else
RUNALL=false
endif
%.testlog: %.csc cooja
@echo -n Running test $(basename $<) ... ""
@(java -jar $(CONTIKI)/tools/cooja/dist/cooja.jar \
-nogui=$< -contiki=$(CONTIKI) > $(basename $@).log || \
(echo " FAIL ಠ_ಠ" | tee -a COOJA.testlog; \
mv COOJA.testlog $(basename $<).faillog; \
$(RUNALL))) && \
(touch COOJA.testlog; \
mv COOJA.testlog $@; \
echo " OK")
clean:
@rm -f $(TESTLOGS) $(LOGS) $(FAILLOGS) COOJA.log COOJA.testlog \
report summary
cooja: $(CONTIKI)/tools/cooja/dist/cooja.jar
$(CONTIKI)/tools/cooja/dist/cooja.jar:
(cd $(CONTIKI)/tools/cooja; ant jar)

View file

@ -1,97 +0,0 @@
#!/bin/bash
#LOG="TEST-`date '+%F'`.log"
LOG=currentlog.log
MAIL=0
CVS=0
PROGNAME=`basename $0`
Usage() {
echo >&2 "$PROGNAME:" "$@"
echo >&2 "Usage: $PROGNAME [-cvs] [-mail]"
exit 10
}
while [ $# -gt 0 ]; do
case "$1" in
-cvs) CVS=1 ;;
-mail) MAIL=1 ;;
*) Usage "Unknown option \"$1\"" ;;
esac
shift
done
if [ -z "$CONTIKI" ]; then
if [ -z "$CONTIKI_HOME" ]; then
CONTIKI_HOME=../../..
echo Undefined variable: CONTIKI_HOME. Using default: ${CONTIKI_HOME}
fi
CONTIKI=$CONTIKI_HOME
fi
if [ $MAIL -eq 1 ]; then
if [ -z "$MAILTO" ]; then
echo Undefined variable: MAILTO
exit 1
fi
fi
function mail_report() {
if [ $MAIL -eq 1 ]; then
echo ">>>>>>> Sending mail <<<<<<<<"
echo "[`date '+%F %T'`] Mailing test report" >> $LOG
cat $LOG | mail -s "Contiki test results" $MAILTO
if [ "$?" -ne 0 ]; then
echo "Failed to send mail"
echo "[`date '+%F %T'`] MAIL FAILED" >> $LOG
else
echo "[`date '+%F %T'`] test report sent" >> $LOG
fi
else
echo
echo
echo ">>>>>>> Test Report <<<<<<<<"
cat $LOG
fi
cp $LOG RUN_ALL_LAST.log
}
echo ">>>>>>> Cleaning up previous tests <<<<<<<<"
rm -f *.log *.cooja_log
rm -fr se obj_cooja
rm -f symbols.c symbols.h
echo ">>>>>>> Creating test log <<<<<<<<"
touch $LOG
if [ $CVS -eq 1 ]; then
echo ">>>>>>> Updating from CVS <<<<<<<<"
echo -n "[`date '+%F %T'`] Updating CVS: " >> $LOG
(cd $CONTIKI && cvs update -dP)
if [ "$?" != "0" ]; then
echo "FAIL" >> $LOG
mail_report
exit 1
fi
echo "OK" >> $LOG
fi
echo ">>>>>>> Building COOJA <<<<<<<<"
echo -n "[`date '+%F %T'`] Building COOJA: " >> $LOG
(cd $CONTIKI/tools/cooja && ant clean && ant jar)
if [ "$?" != "0" ]; then
echo "Compilation of COOJA failed"
echo "FAIL" >> $LOG
mail_report
exit 1
fi
echo "OK" >> $LOG
echo >> $LOG
for myfile in ./*.csc
do
TEST=`basename $myfile .csc`
bash RUN_TEST $TEST $LOG
done
mail_report

View file

@ -1,45 +0,0 @@
#!/bin/bash
# Usage
if [ $# -eq 2 ]; then
REPEATS=$1
TEST=$2
else
echo "Usage: $0 <nr_repeats> <test>"
echo "Example: $0 10 cooja_helloworld"
exit 1
fi
# Locate Contiki/COOJA
if [ -z "$CONTIKI" ]; then
if [ -z "$CONTIKI_HOME" ]; then
CONTIKI_HOME=../../..
fi
CONTIKI=$CONTIKI_HOME
fi
# Clean up
rm -f *.log *.cooja_log
rm -fr se obj_cooja
rm -f symbols.c symbols.h
# Compile COOJA
echo ">>>>>>> Building COOJA <<<<<<<<"
(cd $CONTIKI/tools/cooja && ant clean && ant jar)
if [ "$?" != "0" ]; then
echo "Compilation of COOJA failed"
exit 1
fi
# Run tests
for COUNTER in `seq 1 $REPEATS`;
do
echo ">>>>>>> Test $COUNTER/$REPEATS: $TEST-$COUNTER.log <<<<<<<<"
bash RUN_TEST $TEST RUN_REPEATED_LAST.log
mv $TEST.log $TEST-$COUNTER.log
done
echo
cat RUN_REPEATED_LAST.log
echo
echo ">>>>>>> DONE! Test logs stored in $TEST-[1-$REPEATS].log <<<<<<<<"

View file

@ -1,63 +0,0 @@
#!/bin/bash
if [ $# -lt 1 -o $# -gt 2 ]; then
echo "Usage: $0 <test> [logfile]"
exit
fi
TEST=$1
LOG=/dev/null
if [ $# -eq 2 ]; then
LOG=$2
fi
echo ">>>>>>> Starting test: $TEST <<<<<<<<"
echo -n "[`date '+%F %T'`] $TEST: " >> $LOG
if [ -f "COOJA.log" ]; then
rm COOJA.log
fi
if [ -f "COOJA.testlog" ]; then
rm COOJA.testlog
fi
java -mx512m -jar ../dist/cooja.jar -nogui=$TEST.csc
if [ -f "COOJA.log" ]; then
mv COOJA.log $TEST.cooja_log
fi
if [ -f "COOJA.testlog" ]; then
mv COOJA.testlog $TEST.log
fi
OK=0
if [ -f "$TEST.log" ]; then
OK=`grep "TEST OK" $TEST.log | wc -l`
fi
if [ $OK == 0 ]; then
echo "FAIL" >> $LOG
if [ -f "$TEST.info" ]; then
echo "-- TEST INFO ($TEST.info) --" >> $LOG
cat $TEST.info >> $LOG
else
echo "-- NO TEST INFO AVAILABLE ($TEST.info) --" >> $LOG
fi
if [ -f "$TEST.log" ]; then
echo "-- TEST OUTPUT (tail $TEST.log) --" >> $LOG
tail -5 $TEST.log >> $LOG
else
echo "-- NO TEST OUTPUT AVAILABLE ($TEST.log) --" >> $LOG
fi
echo "-- COOJA OUTPUT (tail $TEST.cooja_log) --" >> $LOG
tail -10 $TEST.cooja_log >> $LOG
echo >> $LOG
else
echo "OK" >> $LOG
fi
echo >> $LOG
if [ $OK == 0 ]; then
echo ">>>>>>> Finished test: $TEST FAILED <<<<<<<<"
else
echo ">>>>>>> Finished test: $TEST OK <<<<<<<<"
fi
echo ""

View file

@ -1 +0,0 @@
Hello world test (single node, OS-level)

View file

@ -1,2 +0,0 @@
Two COOJA nodes: examples/udp-ipv6/udp-{server,client}.c.
Test success after 5 replies

View file

@ -1 +0,0 @@
Cross-level communication test. Cooja+Sky+ESB+App running nullmac and Rime example-abc. Requires compilation in /tools/cooja/examples/appmote_rimeabc.

View file

@ -1 +0,0 @@
Single ESB mote running Hello world application

View file

@ -1,2 +0,0 @@
Five Contiki motes in a line, all running examples/telnet-server/telnet-server.c. Mote 1 (172.16.1.0) is connected to the native network via Native IP Gateway.
Test succeeds if all five nodes can be pinged from the native network (at least 10/20 ping replies must be received from each mote).

View file

@ -1 +0,0 @@
1xSky node: examples/sky-ip/sky-telnet-server.c. Sends 10 pings to 172.16.1.0 via the native IP stack. Test succeeds if more than 5 ping replies are received.

View file

@ -1 +0,0 @@
Four Sky nodes running both the shell and a CFS webserver. Test uses shell commands echo, write, append and wget to generate and transfer files over a multi-hop link. Test uses NULLMAC-

View file

@ -1 +0,0 @@
Single Sky node running examples/multi-threading/multi-threading.c. Waits until both threads have counted up and down 5 times.

View file

@ -1 +0,0 @@
Two Sky nodes running Rime anonymous broadcast (examples/rime/example-abc.c). Test finishes when both nodes have received more than 30 messages each.

View file

@ -1 +0,0 @@
50 Contiki motes running examples/rime/example-collect.c. The sink is randomly created after startup. The test fails if the sink receives less than 8 packets from each node before timeout, or if the sink receives 15 packets from any node (fairness). Test timeout: 600 seconds.

View file

@ -1 +0,0 @@
Tests the Rime collect primitive on the sky platform, uses the code in examples/rime/example-collect.c

View file

@ -1 +0,0 @@
Two OS-level nodes: examples/rime/example-rucb.c. 99% TX success.

View file

@ -1 +0,0 @@
4 Sky nodes running examples/rime/example-runicast.c. Tests both timeout and send acknowledgements.

View file

@ -1 +0,0 @@
Rime trickle (test-trickle.c). Ten Sky nodes, node one send message.

View file

@ -1 +0,0 @@
Sky IPv6 RPL test: 24 nodes sending data over UDP to one sink. 10 packets per node should be received.

View file

@ -1 +0,0 @@
Tests node local checkpointing on the Sky platform. A single node checkpoints and rollbacks with a repeating echo background process. Running examples/sky-shell/sky-checkpoint.c

View file

@ -1 +0,0 @@
Single Sky node. Coffee consistency test.

View file

@ -1 +0,0 @@
Sky-collect running on 7 Sky nodes. Test waits until sensor data has been received from every node at least 5 times. If any node successfully transmits 20 packets to the sink, the test fails.

View file

@ -1 +0,0 @@
Three Sky nodes running a Deluge test. examples/sky/test-deluge.c

View file

@ -1 +0,0 @@
Single sky mote running Hello world application

View file

@ -1 +0,0 @@
IPv6 multihop routing using Rime route discovery using 5 Sky nodes. Test success when client receives response from server.

Some files were not shown because too many files have changed in this diff Show more