Merge pull request #52 from simonduq/pr/default-802.15.4-2015
802.15.4-2015 frames v2 as default
This commit is contained in:
commit
dcc33984c2
@ -145,7 +145,7 @@ frame802154_has_panid(frame802154_fcf_t *fcf, int *has_src_pan_id, int *has_dest
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if(fcf->frame_version == FRAME802154_IEEE802154E_2012) {
|
if(fcf->frame_version == FRAME802154_IEEE802154_2015) {
|
||||||
/*
|
/*
|
||||||
* IEEE 802.15.4-2015
|
* IEEE 802.15.4-2015
|
||||||
* Table 7-2, PAN ID Compression value for frame version 0b10
|
* Table 7-2, PAN ID Compression value for frame version 0b10
|
||||||
@ -302,7 +302,7 @@ field_len(frame802154_t *p, field_length_t *flen)
|
|||||||
/* IEEE802.15.4e changes the meaning of PAN ID Compression (see Table 2a).
|
/* IEEE802.15.4e changes the meaning of PAN ID Compression (see Table 2a).
|
||||||
* In this case, we leave the decision whether to compress PAN ID or not
|
* In this case, we leave the decision whether to compress PAN ID or not
|
||||||
* up to the caller. */
|
* up to the caller. */
|
||||||
if(p->fcf.frame_version < FRAME802154_IEEE802154E_2012) {
|
if(p->fcf.frame_version < FRAME802154_IEEE802154_2015) {
|
||||||
/* Set PAN ID compression bit if src pan id matches dest pan id. */
|
/* Set PAN ID compression bit if src pan id matches dest pan id. */
|
||||||
if((p->fcf.dest_addr_mode & 3) && (p->fcf.src_addr_mode & 3) &&
|
if((p->fcf.dest_addr_mode & 3) && (p->fcf.src_addr_mode & 3) &&
|
||||||
p->src_pid == p->dest_pid) {
|
p->src_pid == p->dest_pid) {
|
||||||
|
@ -77,7 +77,7 @@
|
|||||||
#ifdef FRAME802154_CONF_VERSION
|
#ifdef FRAME802154_CONF_VERSION
|
||||||
#define FRAME802154_VERSION FRAME802154_CONF_VERSION
|
#define FRAME802154_VERSION FRAME802154_CONF_VERSION
|
||||||
#else /* FRAME802154_CONF_VERSION */
|
#else /* FRAME802154_CONF_VERSION */
|
||||||
#define FRAME802154_VERSION FRAME802154_IEEE802154_2006
|
#define FRAME802154_VERSION FRAME802154_IEEE802154_2015
|
||||||
#endif /* FRAME802154_CONF_VERSION */
|
#endif /* FRAME802154_CONF_VERSION */
|
||||||
|
|
||||||
#ifdef FRAME802154_CONF_SUPPR_SEQNO
|
#ifdef FRAME802154_CONF_SUPPR_SEQNO
|
||||||
@ -111,7 +111,7 @@
|
|||||||
|
|
||||||
#define FRAME802154_IEEE802154_2003 (0x00)
|
#define FRAME802154_IEEE802154_2003 (0x00)
|
||||||
#define FRAME802154_IEEE802154_2006 (0x01)
|
#define FRAME802154_IEEE802154_2006 (0x01)
|
||||||
#define FRAME802154_IEEE802154E_2012 (0x02)
|
#define FRAME802154_IEEE802154_2015 (0x02)
|
||||||
|
|
||||||
#define FRAME802154_SECURITY_LEVEL_NONE (0)
|
#define FRAME802154_SECURITY_LEVEL_NONE (0)
|
||||||
#define FRAME802154_SECURITY_LEVEL_MIC_32 (1)
|
#define FRAME802154_SECURITY_LEVEL_MIC_32 (1)
|
||||||
|
@ -81,7 +81,7 @@ create_frame(int type, int do_create)
|
|||||||
if(packetbuf_holds_broadcast()) {
|
if(packetbuf_holds_broadcast()) {
|
||||||
params.fcf.ack_required = 0;
|
params.fcf.ack_required = 0;
|
||||||
/* Suppress seqno on broadcast if supported (frame v2 or more) */
|
/* Suppress seqno on broadcast if supported (frame v2 or more) */
|
||||||
params.fcf.sequence_number_suppression = FRAME802154_VERSION >= FRAME802154_IEEE802154E_2012;
|
params.fcf.sequence_number_suppression = FRAME802154_VERSION >= FRAME802154_IEEE802154_2015;
|
||||||
} else {
|
} else {
|
||||||
params.fcf.ack_required = packetbuf_attr(PACKETBUF_ATTR_MAC_ACK);
|
params.fcf.ack_required = packetbuf_attr(PACKETBUF_ATTR_MAC_ACK);
|
||||||
params.fcf.sequence_number_suppression = FRAME802154_SUPPR_SEQNO;
|
params.fcf.sequence_number_suppression = FRAME802154_SUPPR_SEQNO;
|
||||||
|
@ -69,7 +69,7 @@ tsch_packet_create_eack(uint8_t *buf, int buf_size,
|
|||||||
|
|
||||||
memset(&p, 0, sizeof(p));
|
memset(&p, 0, sizeof(p));
|
||||||
p.fcf.frame_type = FRAME802154_ACKFRAME;
|
p.fcf.frame_type = FRAME802154_ACKFRAME;
|
||||||
p.fcf.frame_version = FRAME802154_IEEE802154E_2012;
|
p.fcf.frame_version = FRAME802154_IEEE802154_2015;
|
||||||
p.fcf.ie_list_present = 1;
|
p.fcf.ie_list_present = 1;
|
||||||
/* Compression unset. According to IEEE802.15.4e-2012:
|
/* Compression unset. According to IEEE802.15.4e-2012:
|
||||||
* - if no address is present: elide PAN ID
|
* - if no address is present: elide PAN ID
|
||||||
@ -201,7 +201,7 @@ tsch_packet_create_eb(uint8_t *buf, int buf_size,
|
|||||||
memset(&p, 0, sizeof(p));
|
memset(&p, 0, sizeof(p));
|
||||||
p.fcf.frame_type = FRAME802154_BEACONFRAME;
|
p.fcf.frame_type = FRAME802154_BEACONFRAME;
|
||||||
p.fcf.ie_list_present = 1;
|
p.fcf.ie_list_present = 1;
|
||||||
p.fcf.frame_version = FRAME802154_IEEE802154E_2012;
|
p.fcf.frame_version = FRAME802154_IEEE802154_2015;
|
||||||
p.fcf.src_addr_mode = LINKADDR_SIZE > 2 ? FRAME802154_LONGADDRMODE : FRAME802154_SHORTADDRMODE;
|
p.fcf.src_addr_mode = LINKADDR_SIZE > 2 ? FRAME802154_LONGADDRMODE : FRAME802154_SHORTADDRMODE;
|
||||||
p.fcf.dest_addr_mode = FRAME802154_SHORTADDRMODE;
|
p.fcf.dest_addr_mode = FRAME802154_SHORTADDRMODE;
|
||||||
p.fcf.sequence_number_suppression = 1;
|
p.fcf.sequence_number_suppression = 1;
|
||||||
@ -356,7 +356,7 @@ tsch_packet_parse_eb(const uint8_t *buf, int buf_size,
|
|||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
if(frame->fcf.frame_version < FRAME802154_IEEE802154E_2012
|
if(frame->fcf.frame_version < FRAME802154_IEEE802154_2015
|
||||||
|| frame->fcf.frame_type != FRAME802154_BEACONFRAME) {
|
|| frame->fcf.frame_type != FRAME802154_BEACONFRAME) {
|
||||||
LOG_INFO("! parse_eb: frame is not a valid TSCH beacon. Frame version %u, type %u, FCF %02x %02x\n",
|
LOG_INFO("! parse_eb: frame is not a valid TSCH beacon. Frame version %u, type %u, FCF %02x %02x\n",
|
||||||
frame->fcf.frame_version, frame->fcf.frame_type, buf[0], buf[1]);
|
frame->fcf.frame_version, frame->fcf.frame_type, buf[0], buf[1]);
|
||||||
|
@ -62,8 +62,8 @@
|
|||||||
#include "net/mac/tsch/tsch-rpl.h"
|
#include "net/mac/tsch/tsch-rpl.h"
|
||||||
#endif /* UIP_CONF_IPV6_RPL */
|
#endif /* UIP_CONF_IPV6_RPL */
|
||||||
|
|
||||||
#if FRAME802154_VERSION < FRAME802154_IEEE802154E_2012
|
#if FRAME802154_VERSION < FRAME802154_IEEE802154_2015
|
||||||
#error TSCH: FRAME802154_VERSION must be at least FRAME802154_IEEE802154E_2012
|
#error TSCH: FRAME802154_VERSION must be at least FRAME802154_IEEE802154_2015
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
/* Log configuration */
|
/* Log configuration */
|
||||||
@ -421,7 +421,7 @@ tsch_rx_process_pending()
|
|||||||
uint8_t ret = frame802154_parse(current_input->payload, current_input->len, &frame);
|
uint8_t ret = frame802154_parse(current_input->payload, current_input->len, &frame);
|
||||||
int is_data = ret && frame.fcf.frame_type == FRAME802154_DATAFRAME;
|
int is_data = ret && frame.fcf.frame_type == FRAME802154_DATAFRAME;
|
||||||
int is_eb = ret
|
int is_eb = ret
|
||||||
&& frame.fcf.frame_version == FRAME802154_IEEE802154E_2012
|
&& frame.fcf.frame_version == FRAME802154_IEEE802154_2015
|
||||||
&& frame.fcf.frame_type == FRAME802154_BEACONFRAME;
|
&& frame.fcf.frame_type == FRAME802154_BEACONFRAME;
|
||||||
|
|
||||||
if(is_data) {
|
if(is_data) {
|
||||||
|
@ -67,10 +67,6 @@
|
|||||||
#undef NETSTACK_CONF_MAC
|
#undef NETSTACK_CONF_MAC
|
||||||
#define NETSTACK_CONF_MAC tschmac_driver
|
#define NETSTACK_CONF_MAC tschmac_driver
|
||||||
|
|
||||||
/* IEEE802.15.4 frame version */
|
|
||||||
#undef FRAME802154_CONF_VERSION
|
|
||||||
#define FRAME802154_CONF_VERSION FRAME802154_IEEE802154E_2012
|
|
||||||
|
|
||||||
/* TSCH and RPL callbacks */
|
/* TSCH and RPL callbacks */
|
||||||
#define RPL_CALLBACK_PARENT_SWITCH tsch_rpl_callback_parent_switch
|
#define RPL_CALLBACK_PARENT_SWITCH tsch_rpl_callback_parent_switch
|
||||||
#define RPL_CALLBACK_NEW_DIO_INTERVAL tsch_rpl_callback_new_dio_interval
|
#define RPL_CALLBACK_NEW_DIO_INTERVAL tsch_rpl_callback_new_dio_interval
|
||||||
|
@ -62,10 +62,6 @@
|
|||||||
#undef NETSTACK_CONF_MAC
|
#undef NETSTACK_CONF_MAC
|
||||||
#define NETSTACK_CONF_MAC tschmac_driver
|
#define NETSTACK_CONF_MAC tschmac_driver
|
||||||
|
|
||||||
/* IEEE802.15.4 frame version */
|
|
||||||
#undef FRAME802154_CONF_VERSION
|
|
||||||
#define FRAME802154_CONF_VERSION FRAME802154_IEEE802154E_2012
|
|
||||||
|
|
||||||
/* TSCH and RPL callbacks */
|
/* TSCH and RPL callbacks */
|
||||||
#define RPL_CALLBACK_PARENT_SWITCH tsch_rpl_callback_parent_switch
|
#define RPL_CALLBACK_PARENT_SWITCH tsch_rpl_callback_parent_switch
|
||||||
#define RPL_CALLBACK_NEW_DIO_INTERVAL tsch_rpl_callback_new_dio_interval
|
#define RPL_CALLBACK_NEW_DIO_INTERVAL tsch_rpl_callback_new_dio_interval
|
||||||
|
@ -58,10 +58,6 @@
|
|||||||
|
|
||||||
#define NETSTACK_CONF_MAC tschmac_driver
|
#define NETSTACK_CONF_MAC tschmac_driver
|
||||||
|
|
||||||
/* IEEE802.15.4 frame version */
|
|
||||||
#undef FRAME802154_CONF_VERSION
|
|
||||||
#define FRAME802154_CONF_VERSION FRAME802154_IEEE802154E_2012
|
|
||||||
|
|
||||||
/* TSCH and RPL callbacks */
|
/* TSCH and RPL callbacks */
|
||||||
#define RPL_CALLBACK_PARENT_SWITCH tsch_rpl_callback_parent_switch
|
#define RPL_CALLBACK_PARENT_SWITCH tsch_rpl_callback_parent_switch
|
||||||
#define RPL_CALLBACK_NEW_DIO_INTERVAL tsch_rpl_callback_new_dio_interval
|
#define RPL_CALLBACK_NEW_DIO_INTERVAL tsch_rpl_callback_new_dio_interval
|
||||||
|
@ -139,9 +139,6 @@
|
|||||||
|
|
||||||
#if WITH_TSCH
|
#if WITH_TSCH
|
||||||
|
|
||||||
#undef FRAME802154_CONF_VERSION
|
|
||||||
#define FRAME802154_CONF_VERSION FRAME802154_IEEE802154E_2012
|
|
||||||
|
|
||||||
/* Contiki netstack: MAC */
|
/* Contiki netstack: MAC */
|
||||||
#undef NETSTACK_CONF_MAC
|
#undef NETSTACK_CONF_MAC
|
||||||
#define NETSTACK_CONF_MAC tschmac_driver
|
#define NETSTACK_CONF_MAC tschmac_driver
|
||||||
|
@ -48,9 +48,6 @@
|
|||||||
#undef NETSTACK_CONF_MAC
|
#undef NETSTACK_CONF_MAC
|
||||||
#define NETSTACK_CONF_MAC tschmac_driver
|
#define NETSTACK_CONF_MAC tschmac_driver
|
||||||
|
|
||||||
#undef FRAME802154_CONF_VERSION
|
|
||||||
#define FRAME802154_CONF_VERSION FRAME802154_IEEE802154E_2012
|
|
||||||
|
|
||||||
#if CONTIKI_TARGET_COOJA
|
#if CONTIKI_TARGET_COOJA
|
||||||
#define COOJA_CONF_SIMULATE_TURNAROUND 0
|
#define COOJA_CONF_SIMULATE_TURNAROUND 0
|
||||||
#endif /* CONTIKI_TARGET_COOJA */
|
#endif /* CONTIKI_TARGET_COOJA */
|
||||||
|
@ -32,9 +32,6 @@
|
|||||||
#ifndef _PROJECT_TSCH_CONF_H
|
#ifndef _PROJECT_TSCH_CONF_H
|
||||||
#define _PROJECT_TSCH_CONF_H
|
#define _PROJECT_TSCH_CONF_H
|
||||||
|
|
||||||
#undef FRAME802154_CONF_VERSION
|
|
||||||
#define FRAME802154_CONF_VERSION FRAME802154_IEEE802154E_2012
|
|
||||||
|
|
||||||
#undef NETSTACK_CONF_MAC
|
#undef NETSTACK_CONF_MAC
|
||||||
#define NETSTACK_CONF_MAC tschmac_driver
|
#define NETSTACK_CONF_MAC tschmac_driver
|
||||||
|
|
||||||
|
@ -181,7 +181,7 @@ setup_frame802154_2006_fcf(const panid_test_def *t, frame802154_fcf_t *fcf)
|
|||||||
static void
|
static void
|
||||||
setup_frame802154_2015_fcf(const panid_test_def *t, frame802154_fcf_t *fcf)
|
setup_frame802154_2015_fcf(const panid_test_def *t, frame802154_fcf_t *fcf)
|
||||||
{
|
{
|
||||||
fcf->frame_version = FRAME802154_IEEE802154E_2012;
|
fcf->frame_version = FRAME802154_IEEE802154_2015;
|
||||||
|
|
||||||
setup_addr_mode(t->dest_addr_mode, &fcf->dest_addr_mode);
|
setup_addr_mode(t->dest_addr_mode, &fcf->dest_addr_mode);
|
||||||
setup_addr_mode(t->src_addr_mode, &fcf->src_addr_mode);
|
setup_addr_mode(t->src_addr_mode, &fcf->src_addr_mode);
|
||||||
|
@ -230,7 +230,7 @@ test_parse_eb(const eb_test_vector_t *v)
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
if(frame.fcf.frame_type != FRAME802154_BEACONFRAME ||
|
if(frame.fcf.frame_type != FRAME802154_BEACONFRAME ||
|
||||||
frame.fcf.frame_version != FRAME802154_IEEE802154E_2012) {
|
frame.fcf.frame_version != FRAME802154_IEEE802154_2015) {
|
||||||
return FAILURE;
|
return FAILURE;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -315,7 +315,7 @@ test_parse_eack(const eack_test_vector_t *v)
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
if(frame.fcf.frame_type != FRAME802154_ACKFRAME ||
|
if(frame.fcf.frame_type != FRAME802154_ACKFRAME ||
|
||||||
frame.fcf.frame_version != FRAME802154_IEEE802154E_2012) {
|
frame.fcf.frame_version != FRAME802154_IEEE802154_2015) {
|
||||||
return FAILURE;
|
return FAILURE;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1,292 +0,0 @@
|
|||||||
<?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>
|
|
||||||
org.contikios.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>
|
|
||||||
org.contikios.cooja.contikimote.ContikiMoteType
|
|
||||||
<identifier>mtype110</identifier>
|
|
||||||
<description>Sender</description>
|
|
||||||
<source>[CONFIG_DIR]/code/sender-node.c</source>
|
|
||||||
<commands>make TARGET=cooja clean
|
|
||||||
make sender-node.cooja DEFINES=RPL_CONF_WITH_DAO_ACK=0 TARGET=cooja</commands>
|
|
||||||
<moteinterface>org.contikios.cooja.interfaces.Position</moteinterface>
|
|
||||||
<moteinterface>org.contikios.cooja.interfaces.Battery</moteinterface>
|
|
||||||
<moteinterface>org.contikios.cooja.contikimote.interfaces.ContikiVib</moteinterface>
|
|
||||||
<moteinterface>org.contikios.cooja.contikimote.interfaces.ContikiMoteID</moteinterface>
|
|
||||||
<moteinterface>org.contikios.cooja.contikimote.interfaces.ContikiRS232</moteinterface>
|
|
||||||
<moteinterface>org.contikios.cooja.contikimote.interfaces.ContikiBeeper</moteinterface>
|
|
||||||
<moteinterface>org.contikios.cooja.interfaces.RimeAddress</moteinterface>
|
|
||||||
<moteinterface>org.contikios.cooja.contikimote.interfaces.ContikiIPAddress</moteinterface>
|
|
||||||
<moteinterface>org.contikios.cooja.contikimote.interfaces.ContikiRadio</moteinterface>
|
|
||||||
<moteinterface>org.contikios.cooja.contikimote.interfaces.ContikiButton</moteinterface>
|
|
||||||
<moteinterface>org.contikios.cooja.contikimote.interfaces.ContikiPIR</moteinterface>
|
|
||||||
<moteinterface>org.contikios.cooja.contikimote.interfaces.ContikiClock</moteinterface>
|
|
||||||
<moteinterface>org.contikios.cooja.contikimote.interfaces.ContikiLED</moteinterface>
|
|
||||||
<moteinterface>org.contikios.cooja.contikimote.interfaces.ContikiCFS</moteinterface>
|
|
||||||
<moteinterface>org.contikios.cooja.interfaces.Mote2MoteRelations</moteinterface>
|
|
||||||
<moteinterface>org.contikios.cooja.interfaces.MoteAttributes</moteinterface>
|
|
||||||
<symbols>false</symbols>
|
|
||||||
</motetype>
|
|
||||||
<motetype>
|
|
||||||
org.contikios.cooja.contikimote.ContikiMoteType
|
|
||||||
<identifier>mtype792</identifier>
|
|
||||||
<description>RPL root</description>
|
|
||||||
<source>[CONFIG_DIR]/code/root-node.c</source>
|
|
||||||
<commands>make TARGET=cooja clean
|
|
||||||
make root-node.cooja DEFINES=RPL_CONF_WITH_DAO_ACK=0 TARGET=cooja</commands>
|
|
||||||
<moteinterface>org.contikios.cooja.interfaces.Position</moteinterface>
|
|
||||||
<moteinterface>org.contikios.cooja.interfaces.Battery</moteinterface>
|
|
||||||
<moteinterface>org.contikios.cooja.contikimote.interfaces.ContikiVib</moteinterface>
|
|
||||||
<moteinterface>org.contikios.cooja.contikimote.interfaces.ContikiMoteID</moteinterface>
|
|
||||||
<moteinterface>org.contikios.cooja.contikimote.interfaces.ContikiRS232</moteinterface>
|
|
||||||
<moteinterface>org.contikios.cooja.contikimote.interfaces.ContikiBeeper</moteinterface>
|
|
||||||
<moteinterface>org.contikios.cooja.interfaces.RimeAddress</moteinterface>
|
|
||||||
<moteinterface>org.contikios.cooja.contikimote.interfaces.ContikiIPAddress</moteinterface>
|
|
||||||
<moteinterface>org.contikios.cooja.contikimote.interfaces.ContikiRadio</moteinterface>
|
|
||||||
<moteinterface>org.contikios.cooja.contikimote.interfaces.ContikiButton</moteinterface>
|
|
||||||
<moteinterface>org.contikios.cooja.contikimote.interfaces.ContikiPIR</moteinterface>
|
|
||||||
<moteinterface>org.contikios.cooja.contikimote.interfaces.ContikiClock</moteinterface>
|
|
||||||
<moteinterface>org.contikios.cooja.contikimote.interfaces.ContikiLED</moteinterface>
|
|
||||||
<moteinterface>org.contikios.cooja.contikimote.interfaces.ContikiCFS</moteinterface>
|
|
||||||
<moteinterface>org.contikios.cooja.interfaces.Mote2MoteRelations</moteinterface>
|
|
||||||
<moteinterface>org.contikios.cooja.interfaces.MoteAttributes</moteinterface>
|
|
||||||
<symbols>false</symbols>
|
|
||||||
</motetype>
|
|
||||||
<motetype>
|
|
||||||
org.contikios.cooja.contikimote.ContikiMoteType
|
|
||||||
<identifier>mtype964</identifier>
|
|
||||||
<description>Receiver</description>
|
|
||||||
<source>[CONFIG_DIR]/code/receiver-node.c</source>
|
|
||||||
<commands>make TARGET=cooja clean
|
|
||||||
make receiver-node.cooja DEFINES=RPL_CONF_WITH_DAO_ACK=0 TARGET=cooja</commands>
|
|
||||||
<moteinterface>org.contikios.cooja.interfaces.Position</moteinterface>
|
|
||||||
<moteinterface>org.contikios.cooja.interfaces.Battery</moteinterface>
|
|
||||||
<moteinterface>org.contikios.cooja.contikimote.interfaces.ContikiVib</moteinterface>
|
|
||||||
<moteinterface>org.contikios.cooja.contikimote.interfaces.ContikiMoteID</moteinterface>
|
|
||||||
<moteinterface>org.contikios.cooja.contikimote.interfaces.ContikiRS232</moteinterface>
|
|
||||||
<moteinterface>org.contikios.cooja.contikimote.interfaces.ContikiBeeper</moteinterface>
|
|
||||||
<moteinterface>org.contikios.cooja.interfaces.RimeAddress</moteinterface>
|
|
||||||
<moteinterface>org.contikios.cooja.contikimote.interfaces.ContikiIPAddress</moteinterface>
|
|
||||||
<moteinterface>org.contikios.cooja.contikimote.interfaces.ContikiRadio</moteinterface>
|
|
||||||
<moteinterface>org.contikios.cooja.contikimote.interfaces.ContikiButton</moteinterface>
|
|
||||||
<moteinterface>org.contikios.cooja.contikimote.interfaces.ContikiPIR</moteinterface>
|
|
||||||
<moteinterface>org.contikios.cooja.contikimote.interfaces.ContikiClock</moteinterface>
|
|
||||||
<moteinterface>org.contikios.cooja.contikimote.interfaces.ContikiLED</moteinterface>
|
|
||||||
<moteinterface>org.contikios.cooja.contikimote.interfaces.ContikiCFS</moteinterface>
|
|
||||||
<moteinterface>org.contikios.cooja.interfaces.Mote2MoteRelations</moteinterface>
|
|
||||||
<moteinterface>org.contikios.cooja.interfaces.MoteAttributes</moteinterface>
|
|
||||||
<symbols>false</symbols>
|
|
||||||
</motetype>
|
|
||||||
<mote>
|
|
||||||
<interface_config>
|
|
||||||
org.contikios.cooja.interfaces.Position
|
|
||||||
<x>7.772906112657773</x>
|
|
||||||
<y>86.396910401861</y>
|
|
||||||
<z>0.0</z>
|
|
||||||
</interface_config>
|
|
||||||
<interface_config>
|
|
||||||
org.contikios.cooja.contikimote.interfaces.ContikiMoteID
|
|
||||||
<id>1</id>
|
|
||||||
</interface_config>
|
|
||||||
<interface_config>
|
|
||||||
org.contikios.cooja.contikimote.interfaces.ContikiRadio
|
|
||||||
<bitrate>250.0</bitrate>
|
|
||||||
</interface_config>
|
|
||||||
<motetype_identifier>mtype964</motetype_identifier>
|
|
||||||
</mote>
|
|
||||||
<mote>
|
|
||||||
<interface_config>
|
|
||||||
org.contikios.cooja.interfaces.Position
|
|
||||||
<x>75.54361692539452</x>
|
|
||||||
<y>14.292026223193414</y>
|
|
||||||
<z>0.0</z>
|
|
||||||
</interface_config>
|
|
||||||
<interface_config>
|
|
||||||
org.contikios.cooja.contikimote.interfaces.ContikiMoteID
|
|
||||||
<id>2</id>
|
|
||||||
</interface_config>
|
|
||||||
<interface_config>
|
|
||||||
org.contikios.cooja.contikimote.interfaces.ContikiRadio
|
|
||||||
<bitrate>250.0</bitrate>
|
|
||||||
</interface_config>
|
|
||||||
<motetype_identifier>mtype110</motetype_identifier>
|
|
||||||
</mote>
|
|
||||||
<mote>
|
|
||||||
<interface_config>
|
|
||||||
org.contikios.cooja.interfaces.Position
|
|
||||||
<x>47.962513687652844</x>
|
|
||||||
<y>7.199742533488408</y>
|
|
||||||
<z>0.0</z>
|
|
||||||
</interface_config>
|
|
||||||
<interface_config>
|
|
||||||
org.contikios.cooja.contikimote.interfaces.ContikiMoteID
|
|
||||||
<id>6</id>
|
|
||||||
</interface_config>
|
|
||||||
<interface_config>
|
|
||||||
org.contikios.cooja.contikimote.interfaces.ContikiRadio
|
|
||||||
<bitrate>250.0</bitrate>
|
|
||||||
</interface_config>
|
|
||||||
<motetype_identifier>mtype964</motetype_identifier>
|
|
||||||
</mote>
|
|
||||||
<mote>
|
|
||||||
<interface_config>
|
|
||||||
org.contikios.cooja.interfaces.Position
|
|
||||||
<x>1.8626697045702818</x>
|
|
||||||
<y>47.783365869022624</y>
|
|
||||||
<z>0.0</z>
|
|
||||||
</interface_config>
|
|
||||||
<interface_config>
|
|
||||||
org.contikios.cooja.contikimote.interfaces.ContikiMoteID
|
|
||||||
<id>8</id>
|
|
||||||
</interface_config>
|
|
||||||
<interface_config>
|
|
||||||
org.contikios.cooja.contikimote.interfaces.ContikiRadio
|
|
||||||
<bitrate>250.0</bitrate>
|
|
||||||
</interface_config>
|
|
||||||
<motetype_identifier>mtype964</motetype_identifier>
|
|
||||||
</mote>
|
|
||||||
<mote>
|
|
||||||
<interface_config>
|
|
||||||
org.contikios.cooja.interfaces.Position
|
|
||||||
<x>0.0</x>
|
|
||||||
<y>0.0</y>
|
|
||||||
<z>0.0</z>
|
|
||||||
</interface_config>
|
|
||||||
<interface_config>
|
|
||||||
org.contikios.cooja.contikimote.interfaces.ContikiMoteID
|
|
||||||
<id>3</id>
|
|
||||||
</interface_config>
|
|
||||||
<interface_config>
|
|
||||||
org.contikios.cooja.contikimote.interfaces.ContikiRadio
|
|
||||||
<bitrate>250.0</bitrate>
|
|
||||||
</interface_config>
|
|
||||||
<motetype_identifier>mtype792</motetype_identifier>
|
|
||||||
</mote>
|
|
||||||
</simulation>
|
|
||||||
<plugin>
|
|
||||||
org.contikios.cooja.plugins.SimControl
|
|
||||||
<width>280</width>
|
|
||||||
<z>0</z>
|
|
||||||
<height>160</height>
|
|
||||||
<location_x>400</location_x>
|
|
||||||
<location_y>0</location_y>
|
|
||||||
</plugin>
|
|
||||||
<plugin>
|
|
||||||
org.contikios.cooja.plugins.Visualizer
|
|
||||||
<plugin_config>
|
|
||||||
<skin>org.contikios.cooja.plugins.skins.IDVisualizerSkin</skin>
|
|
||||||
<skin>org.contikios.cooja.plugins.skins.UDGMVisualizerSkin</skin>
|
|
||||||
<skin>org.contikios.cooja.plugins.skins.GridVisualizerSkin</skin>
|
|
||||||
<skin>org.contikios.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>
|
|
||||||
org.contikios.cooja.plugins.LogListener
|
|
||||||
<plugin_config>
|
|
||||||
<filter />
|
|
||||||
<formatted_time />
|
|
||||||
<coloring />
|
|
||||||
</plugin_config>
|
|
||||||
<width>1184</width>
|
|
||||||
<z>3</z>
|
|
||||||
<height>240</height>
|
|
||||||
<location_x>402</location_x>
|
|
||||||
<location_y>162</location_y>
|
|
||||||
</plugin>
|
|
||||||
<plugin>
|
|
||||||
org.contikios.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>
|
|
||||||
org.contikios.cooja.plugins.ScriptRunner
|
|
||||||
<plugin_config>
|
|
||||||
<script>GENERATE_MSG(0000000, "add-sink");
|
|
||||||
//GENERATE_MSG(1000000, "remove-sink");
|
|
||||||
//GENERATE_MSG(2000000, "add-sink");
|
|
||||||

|
|
||||||
lostMsgs = 0;
|
|
||||||

|
|
||||||
TIMEOUT(100000000, if(lastMsg != -1 && lostMsgs == 0) { log.testOK(); } );
|
|
||||||

|
|
||||||
lastMsg = -1;
|
|
||||||
packets = "_________";
|
|
||||||
hops = 0;
|
|
||||||

|
|
||||||
while(true) {
|
|
||||||
YIELD();
|
|
||||||
if(msg.equals("remove-sink")) {
|
|
||||||
m = sim.getMoteWithID(3);
|
|
||||||
sim.removeMote(m);
|
|
||||||
log.log("removed sink\n");
|
|
||||||
} else if(msg.equals("add-sink")) {
|
|
||||||
if(!sim.getMoteWithID(3)) {
|
|
||||||
m = sim.getMoteTypes()[1].generateMote(sim);
|
|
||||||
m.getInterfaces().getMoteID().setMoteID(3);
|
|
||||||
sim.addMote(m);
|
|
||||||
log.log("added sink\n");
|
|
||||||
} else {
|
|
||||||
log.log("did not add sink as it was already there\n"); 
|
|
||||||
}
|
|
||||||
} else if(msg.startsWith("Sending")) {
|
|
||||||
hops = 0;
|
|
||||||
} else if(msg.startsWith("#L") && msg.endsWith("1; red")) {
|
|
||||||
hops++;
|
|
||||||
} else if(msg.startsWith("Data")) {
|
|
||||||
data = msg.split(" ");
|
|
||||||
num = parseInt(data[14]);
|
|
||||||
if(lastMsg != -1) {
|
|
||||||
if(num != lastMsg + 1) {
|
|
||||||
numMissed = num - lastMsg - 1;
|
|
||||||
lostMsgs += numMissed; 
|
|
||||||
log.log("Missed messages " + numMissed + " before " + num + "\n"); 
|
|
||||||
for(i = 0; i < numMissed; i++) {
|
|
||||||
packets = packets.substr(0, lastMsg + i + 1).concat("_"); 
|
|
||||||
}
|
|
||||||
} 
|
|
||||||
}
|
|
||||||
packets = packets.substr(0, num).concat("*");
|
|
||||||
log.log("" + hops + " " + packets + "\n");
|
|
||||||
lastMsg = num;
|
|
||||||
}
|
|
||||||
}</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>
|
|
Loading…
Reference in New Issue
Block a user