Remove the rpl-simple example and associated tests
This commit is contained in:
parent
0cd779f878
commit
6e02eb5aed
@ -1,7 +0,0 @@
|
||||
all: node
|
||||
CONTIKI=../../..
|
||||
|
||||
# Set MAKE_MAC = MAKE_MAC_TSCH to run TSCH instead
|
||||
MAKE_MAC = MAKE_MAC_CSMA
|
||||
|
||||
include $(CONTIKI)/Makefile.include
|
@ -1,170 +0,0 @@
|
||||
/*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions
|
||||
* are met:
|
||||
* 1. Redistributions of source code must retain the above copyright
|
||||
* notice, this list of conditions and the following disclaimer.
|
||||
* 2. Redistributions in binary form must reproduce the above copyright
|
||||
* notice, this list of conditions and the following disclaimer in the
|
||||
* documentation and/or other materials provided with the distribution.
|
||||
* 3. Neither the name of the Institute nor the names of its contributors
|
||||
* may be used to endorse or promote products derived from this software
|
||||
* without specific prior written permission.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE INSTITUTE AND CONTRIBUTORS ``AS IS'' AND
|
||||
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
||||
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
||||
* ARE DISCLAIMED. IN NO EVENT SHALL THE INSTITUTE OR CONTRIBUTORS BE LIABLE
|
||||
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
|
||||
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
|
||||
* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
|
||||
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
|
||||
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
|
||||
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
||||
* SUCH DAMAGE.
|
||||
*
|
||||
* This file is part of the Contiki operating system.
|
||||
*
|
||||
*/
|
||||
|
||||
#include "contiki.h"
|
||||
#include "lib/random.h"
|
||||
#include "sys/ctimer.h"
|
||||
#include "net/ipv6/uip.h"
|
||||
#include "net/ipv6/uip-ds6.h"
|
||||
#include "net/ipv6/uip-udp-packet.h"
|
||||
#include "rpl.h"
|
||||
#include "rpl-dag-root.h"
|
||||
#include "node-id.h"
|
||||
#include "simple-udp.h"
|
||||
#include "sys/ctimer.h"
|
||||
#include <stdio.h>
|
||||
#include <string.h>
|
||||
|
||||
#include "dev/serial-line.h"
|
||||
#include "net/ipv6/uip-ds6-route.h"
|
||||
|
||||
/* Log configuration */
|
||||
#include "sys/log.h"
|
||||
#define LOG_MODULE "App"
|
||||
#define LOG_LEVEL LOG_LEVEL_INFO
|
||||
|
||||
#define UDP_PORT 8765
|
||||
|
||||
#define START_INTERVAL (5 * CLOCK_SECOND)
|
||||
#define SEND_INTERVAL (30 * CLOCK_SECOND)
|
||||
|
||||
static struct simple_udp_connection udp_conn;
|
||||
|
||||
static uip_ipaddr_t node_ipaddr;
|
||||
static uip_ipaddr_t root_ipaddr;
|
||||
static uip_ipaddr_t destination_ipaddr;
|
||||
|
||||
/*---------------------------------------------------------------------------*/
|
||||
PROCESS(node_process, "RPL Simple Process");
|
||||
AUTOSTART_PROCESSES(&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)
|
||||
{
|
||||
unsigned seq_id;
|
||||
memcpy(&seq_id, data, sizeof(int));
|
||||
if(uip_ip6addr_cmp(&destination_ipaddr, &node_ipaddr)) {
|
||||
LOG_INFO("received request %u from ", seq_id);
|
||||
LOG_INFO_6ADDR(sender_addr);
|
||||
LOG_INFO_("\n");
|
||||
|
||||
LOG_INFO("sending reply %u to ", seq_id);
|
||||
LOG_INFO_6ADDR(sender_addr);
|
||||
LOG_INFO_("\n");
|
||||
simple_udp_sendto(&udp_conn, &seq_id, sizeof(seq_id), sender_addr);
|
||||
} else {
|
||||
static unsigned reply_count = 0;
|
||||
reply_count++;
|
||||
LOG_INFO("received reply %u (%u/%u) from ", seq_id, reply_count, seq_id);
|
||||
LOG_INFO_6ADDR(sender_addr);
|
||||
LOG_INFO_("\n");
|
||||
}
|
||||
}
|
||||
/*---------------------------------------------------------------------------*/
|
||||
static void
|
||||
send_packet(void *ptr)
|
||||
{
|
||||
if(rpl_is_reachable()) {
|
||||
static unsigned seq_id = 0;
|
||||
LOG_INFO("sending request %u to ", ++seq_id);
|
||||
LOG_INFO_6ADDR(&destination_ipaddr);
|
||||
LOG_INFO_("\n");
|
||||
simple_udp_sendto(&udp_conn, &seq_id, sizeof(seq_id), &destination_ipaddr);
|
||||
} else {
|
||||
LOG_INFO("not connected yet\n");
|
||||
}
|
||||
}
|
||||
/*---------------------------------------------------------------------------*/
|
||||
static void
|
||||
get_global_address(void)
|
||||
{
|
||||
int i;
|
||||
uint8_t state;
|
||||
|
||||
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_PREFERRED &&
|
||||
!uip_is_addr_linklocal(&uip_ds6_if.addr_list[i].ipaddr)) {
|
||||
uip_ip6addr_copy(&node_ipaddr, &uip_ds6_if.addr_list[i].ipaddr);
|
||||
}
|
||||
}
|
||||
}
|
||||
/*---------------------------------------------------------------------------*/
|
||||
PROCESS_THREAD(node_process, ev, data)
|
||||
{
|
||||
static struct etimer periodic;
|
||||
static struct ctimer backoff_timer;
|
||||
|
||||
PROCESS_BEGIN();
|
||||
|
||||
/* Hardcoded IPv6 addresses */
|
||||
uip_ip6addr(&root_ipaddr, UIP_DS6_DEFAULT_PREFIX, 0, 0, 0, 0x0212, 0x7401, 0x0001, 0x0101);
|
||||
uip_ip6addr(&destination_ipaddr, UIP_DS6_DEFAULT_PREFIX, 0, 0, 0, 0x0212, 0x7401, 0x0001, 0x0101);
|
||||
|
||||
rpl_dag_root_init(NULL, NULL);
|
||||
get_global_address();
|
||||
/* Configure root */
|
||||
if(uip_ip6addr_cmp(&root_ipaddr, &node_ipaddr)) {
|
||||
rpl_dag_root_init_dag_immediately();
|
||||
}
|
||||
|
||||
/* New connection with remote host */
|
||||
simple_udp_register(&udp_conn, UDP_PORT, NULL, UDP_PORT, receiver);
|
||||
/* Wait for START_INTERVAL */
|
||||
etimer_set(&periodic, START_INTERVAL);
|
||||
PROCESS_WAIT_EVENT_UNTIL(etimer_expired(&periodic));
|
||||
|
||||
#if MAC_CONF_WITH_TSCH
|
||||
NETSTACK_MAC.on();
|
||||
#endif /* MAC_CONF_WITH_TSCH */
|
||||
|
||||
if(!uip_ip6addr_cmp(&destination_ipaddr, &node_ipaddr)) {
|
||||
/* Send data periodically */
|
||||
etimer_set(&periodic, SEND_INTERVAL);
|
||||
while(1) {
|
||||
PROCESS_YIELD();
|
||||
|
||||
if(etimer_expired(&periodic)) {
|
||||
etimer_reset(&periodic);
|
||||
ctimer_set(&backoff_timer, random_rand() % (SEND_INTERVAL), send_packet, NULL);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
PROCESS_END();
|
||||
}
|
||||
/*---------------------------------------------------------------------------*/
|
@ -1,52 +0,0 @@
|
||||
/*
|
||||
* Copyright (c) 2015, Swedish Institute of Computer Science.
|
||||
* All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions
|
||||
* are met:
|
||||
* 1. Redistributions of source code must retain the above copyright
|
||||
* notice, this list of conditions and the following disclaimer.
|
||||
* 2. Redistributions in binary form must reproduce the above copyright
|
||||
* notice, this list of conditions and the following disclaimer in the
|
||||
* documentation and/or other materials provided with the distribution.
|
||||
* 3. Neither the name of the Institute nor the names of its contributors
|
||||
* may be used to endorse or promote products derived from this software
|
||||
* without specific prior written permission.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE INSTITUTE AND CONTRIBUTORS ``AS IS'' AND
|
||||
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
||||
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
||||
* ARE DISCLAIMED. IN NO EVENT SHALL THE INSTITUTE OR CONTRIBUTORS BE LIABLE
|
||||
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
|
||||
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
|
||||
* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
|
||||
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
|
||||
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
|
||||
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
||||
* SUCH DAMAGE.
|
||||
*/
|
||||
|
||||
#ifndef PROJECT_CONF_H_
|
||||
#define PROJECT_CONF_H_
|
||||
|
||||
/* Network size and PAN-ID */
|
||||
#define NBR_TABLE_CONF_MAX_NEIGHBORS 25
|
||||
|
||||
#define NETSTACK_MAX_ROUTE_ENTRIES 25
|
||||
|
||||
#define IEEE802154_CONF_PANID 0xf123
|
||||
|
||||
/* Save some space */
|
||||
#define SICSLOWPAN_CONF_FRAG 0
|
||||
|
||||
/* Do not start TSCH at init, wait for NETSTACK_MAC.on() */
|
||||
#define TSCH_CONF_AUTOSTART 0
|
||||
|
||||
/* 6TiSCH minimal schedule length.
|
||||
* Larger values result in less frequent active slots: reduces capacity and saves energy. */
|
||||
#define TSCH_SCHEDULE_CONF_DEFAULT_LENGTH 3
|
||||
|
||||
#define TSCH_SCHEDULE_CONF_MAX_LINKS 4
|
||||
|
||||
#endif
|
@ -1,148 +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>Simple RPL Example</title>
|
||||
<randomseed>generated</randomseed>
|
||||
<motedelay_us>5000000</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.mspmote.SkyMoteType
|
||||
<identifier>sky2</identifier>
|
||||
<description>Sky Mote Type #sky2</description>
|
||||
<firmware EXPORT="copy">[CONTIKI_DIR]/examples/ipv6/rpl-simple/node.sky</firmware>
|
||||
<moteinterface>org.contikios.cooja.interfaces.Position</moteinterface>
|
||||
<moteinterface>org.contikios.cooja.interfaces.RimeAddress</moteinterface>
|
||||
<moteinterface>org.contikios.cooja.interfaces.IPAddress</moteinterface>
|
||||
<moteinterface>org.contikios.cooja.interfaces.Mote2MoteRelations</moteinterface>
|
||||
<moteinterface>org.contikios.cooja.interfaces.MoteAttributes</moteinterface>
|
||||
<moteinterface>org.contikios.cooja.mspmote.interfaces.MspClock</moteinterface>
|
||||
<moteinterface>org.contikios.cooja.mspmote.interfaces.MspMoteID</moteinterface>
|
||||
<moteinterface>org.contikios.cooja.mspmote.interfaces.SkyButton</moteinterface>
|
||||
<moteinterface>org.contikios.cooja.mspmote.interfaces.SkyFlash</moteinterface>
|
||||
<moteinterface>org.contikios.cooja.mspmote.interfaces.SkyCoffeeFilesystem</moteinterface>
|
||||
<moteinterface>org.contikios.cooja.mspmote.interfaces.Msp802154Radio</moteinterface>
|
||||
<moteinterface>org.contikios.cooja.mspmote.interfaces.MspSerial</moteinterface>
|
||||
<moteinterface>org.contikios.cooja.mspmote.interfaces.SkyLED</moteinterface>
|
||||
<moteinterface>org.contikios.cooja.mspmote.interfaces.MspDebugOutput</moteinterface>
|
||||
<moteinterface>org.contikios.cooja.mspmote.interfaces.SkyTemperature</moteinterface>
|
||||
</motetype>
|
||||
<mote>
|
||||
<breakpoints />
|
||||
<interface_config>
|
||||
org.contikios.cooja.interfaces.Position
|
||||
<x>48.435974731198804</x>
|
||||
<y>-66.16503914182063</y>
|
||||
<z>0.0</z>
|
||||
</interface_config>
|
||||
<interface_config>
|
||||
org.contikios.cooja.mspmote.interfaces.MspClock
|
||||
<deviation>1.0</deviation>
|
||||
</interface_config>
|
||||
<interface_config>
|
||||
org.contikios.cooja.mspmote.interfaces.MspMoteID
|
||||
<id>1</id>
|
||||
</interface_config>
|
||||
<motetype_identifier>sky2</motetype_identifier>
|
||||
</mote>
|
||||
<mote>
|
||||
<breakpoints />
|
||||
<interface_config>
|
||||
org.contikios.cooja.interfaces.Position
|
||||
<x>28.87281458333398</x>
|
||||
<y>-21.744318674852618</y>
|
||||
<z>0.0</z>
|
||||
</interface_config>
|
||||
<interface_config>
|
||||
org.contikios.cooja.mspmote.interfaces.MspClock
|
||||
<deviation>1.0</deviation>
|
||||
</interface_config>
|
||||
<interface_config>
|
||||
org.contikios.cooja.mspmote.interfaces.MspMoteID
|
||||
<id>2</id>
|
||||
</interface_config>
|
||||
<motetype_identifier>sky2</motetype_identifier>
|
||||
</mote>
|
||||
</simulation>
|
||||
<plugin>
|
||||
org.contikios.cooja.plugins.SimControl
|
||||
<width>185</width>
|
||||
<z>2</z>
|
||||
<height>154</height>
|
||||
<location_x>1651</location_x>
|
||||
<location_y>778</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.AttributeVisualizerSkin</skin>
|
||||
<viewport>1.260147830790386 0.0 0.0 1.260147830790386 105.5104655860535 140.74330745981246</viewport>
|
||||
</plugin_config>
|
||||
<width>258</width>
|
||||
<z>1</z>
|
||||
<height>309</height>
|
||||
<location_x>1573</location_x>
|
||||
<location_y>11</location_y>
|
||||
</plugin>
|
||||
<plugin>
|
||||
org.contikios.cooja.plugins.LogListener
|
||||
<plugin_config>
|
||||
<filter />
|
||||
<formatted_time />
|
||||
<coloring />
|
||||
</plugin_config>
|
||||
<width>854</width>
|
||||
<z>3</z>
|
||||
<height>919</height>
|
||||
<location_x>5</location_x>
|
||||
<location_y>2</location_y>
|
||||
</plugin>
|
||||
<plugin>
|
||||
org.contikios.cooja.plugins.TimeLine
|
||||
<plugin_config>
|
||||
<mote>0</mote>
|
||||
<mote>1</mote>
|
||||
<showRadioRXTX />
|
||||
<showRadioHW />
|
||||
<showLEDs />
|
||||
<zoomfactor>2736.9736958636</zoomfactor>
|
||||
</plugin_config>
|
||||
<width>1858</width>
|
||||
<z>4</z>
|
||||
<height>223</height>
|
||||
<location_x>0</location_x>
|
||||
<location_y>931</location_y>
|
||||
</plugin>
|
||||
<plugin>
|
||||
org.contikios.cooja.plugins.RadioLogger
|
||||
<plugin_config>
|
||||
<split>477</split>
|
||||
<formatted_time />
|
||||
<showdups>false</showdups>
|
||||
<hidenodests>false</hidenodests>
|
||||
<analyzers name="6lowpan" />
|
||||
</plugin_config>
|
||||
<width>874</width>
|
||||
<z>0</z>
|
||||
<height>917</height>
|
||||
<location_x>857</location_x>
|
||||
<location_y>10</location_y>
|
||||
</plugin>
|
||||
</simconf>
|
||||
|
@ -8,7 +8,6 @@ eeprom-test/native \
|
||||
ipv6/multicast/sky \
|
||||
logging/native \
|
||||
ipv6/rpl-udp/sky \
|
||||
ipv6/rpl-simple/sky \
|
||||
|
||||
TOOLS=
|
||||
|
||||
|
@ -14,7 +14,6 @@ platform-specific/cc26xx/very-sleepy-demo/srf06-cc26xx \
|
||||
hello-world/cc2538dk \
|
||||
ipv6/rpl-border-router/cc2538dk \
|
||||
ipv6/rpl-udp/cc2538dk \
|
||||
ipv6/rpl-simple/cc2538dk \
|
||||
ipv6/coap-example/cc2538dk \
|
||||
ipso-objects/cc2538dk \
|
||||
platform-specific/cc2538dk/udp-ipv6-echo-server/cc2538dk \
|
||||
|
Loading…
Reference in New Issue
Block a user