mirror of
https://github.com/oliverschmidt/contiki.git
synced 2024-12-22 10:30:13 +00:00
NetDB: a simple DBMS application using Rime's Mesh protocol to transfer queries and responses.
This commit is contained in:
parent
639bb72855
commit
da4d0280e8
6
examples/antelope/netdb/Makefile
Normal file
6
examples/antelope/netdb/Makefile
Normal file
@ -0,0 +1,6 @@
|
||||
CONTIKI = ../../../
|
||||
APPS += antelope
|
||||
CFLAGS += -Wall -g -DPROJECT_CONF_H=\"project-conf.h\"
|
||||
SMALL = 1
|
||||
|
||||
include $(CONTIKI)/Makefile.include
|
133
examples/antelope/netdb/netdb-client.c
Normal file
133
examples/antelope/netdb/netdb-client.c
Normal file
@ -0,0 +1,133 @@
|
||||
/*
|
||||
* Copyright (c) 2011, 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.
|
||||
*/
|
||||
|
||||
/**
|
||||
* \file
|
||||
* A small command-line interface for the querying remote database systems.
|
||||
* \author
|
||||
* Nicolas Tsiftes <nvt@sics.se>
|
||||
*/
|
||||
|
||||
#include <stdio.h>
|
||||
|
||||
#include "contiki.h"
|
||||
#include "dev/serial-line.h"
|
||||
#include "net/rime.h"
|
||||
#include "net/rime/mesh.h"
|
||||
|
||||
#include "antelope.h"
|
||||
/*---------------------------------------------------------------------------*/
|
||||
#define MAX_QUERY_SIZE 100
|
||||
|
||||
#define NETDB_CHANNEL 70
|
||||
|
||||
#ifndef SERVER_ID
|
||||
#define SERVER_ID 4
|
||||
#endif
|
||||
/*---------------------------------------------------------------------------*/
|
||||
PROCESS(netdb_process, "NetDB");
|
||||
AUTOSTART_PROCESSES(&netdb_process);
|
||||
|
||||
static unsigned server_id = SERVER_ID;
|
||||
static struct mesh_conn mesh;
|
||||
/*---------------------------------------------------------------------------*/
|
||||
PROCESS(shell_process, "Shell Process");
|
||||
|
||||
PROCESS_THREAD(shell_process, ev, data)
|
||||
{
|
||||
rimeaddr_t addr;
|
||||
|
||||
PROCESS_BEGIN();
|
||||
|
||||
printf("NetDB client\n");
|
||||
|
||||
for(;;) {
|
||||
PROCESS_WAIT_EVENT_UNTIL(ev == serial_line_event_message && data != NULL);
|
||||
if(strncmp(data, "server ", 7) == 0) {
|
||||
server_id = atoi((char *)data + 7);
|
||||
} else {
|
||||
printf("%lu Transmitting query \"%s\" to node %u\n", clock_time(), (char *)data, server_id);
|
||||
packetbuf_copyfrom(data, strlen(data));
|
||||
addr.u8[0] = server_id;
|
||||
addr.u8[1] = 0;
|
||||
packetbuf_set_attr(PACKETBUF_ATTR_PACKET_TYPE,
|
||||
PACKETBUF_ATTR_PACKET_TYPE_STREAM);
|
||||
mesh_send(&mesh, &addr);
|
||||
}
|
||||
}
|
||||
|
||||
PROCESS_END();
|
||||
}
|
||||
|
||||
/*---------------------------------------------------------------------------*/
|
||||
static void
|
||||
sent(struct mesh_conn *c)
|
||||
{
|
||||
}
|
||||
|
||||
static void
|
||||
timedout(struct mesh_conn *c)
|
||||
{
|
||||
printf("Failed to send packet: time out\n");
|
||||
}
|
||||
|
||||
static void
|
||||
received(struct mesh_conn *c, const rimeaddr_t *from, uint8_t hops)
|
||||
{
|
||||
char *data;
|
||||
unsigned len;
|
||||
static char reply[MAX_QUERY_SIZE + 1];
|
||||
|
||||
data = (char *)packetbuf_dataptr();
|
||||
len = packetbuf_datalen();
|
||||
|
||||
if(len > MAX_QUERY_SIZE) {
|
||||
printf("Too long query: %d bytes\n", len);
|
||||
return;
|
||||
}
|
||||
|
||||
memcpy(reply, data, len);
|
||||
reply[len] = '\0';
|
||||
|
||||
printf("%lu Reply received from %d.%d (%d hops): %s",
|
||||
clock_time(), from->u8[0], from->u8[1], (int)hops, reply);
|
||||
}
|
||||
|
||||
static const struct mesh_callbacks callbacks = {received, sent, timedout};
|
||||
/*---------------------------------------------------------------------------*/
|
||||
PROCESS_THREAD(netdb_process, ev, data)
|
||||
{
|
||||
PROCESS_EXITHANDLER(mesh_close(&mesh));
|
||||
PROCESS_BEGIN();
|
||||
|
||||
mesh_open(&mesh, NETDB_CHANNEL, &callbacks);
|
||||
process_start(&shell_process, NULL);
|
||||
|
||||
PROCESS_END();
|
||||
}
|
300
examples/antelope/netdb/netdb-server.c
Normal file
300
examples/antelope/netdb/netdb-server.c
Normal file
@ -0,0 +1,300 @@
|
||||
/*
|
||||
* Copyright (c) 2011, 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.
|
||||
*/
|
||||
|
||||
/**
|
||||
* \file
|
||||
* A small command-line interface for the querying remote database systems.
|
||||
* \author
|
||||
* Nicolas Tsiftes <nvt@sics.se>
|
||||
*/
|
||||
|
||||
#include <stdio.h>
|
||||
|
||||
#include "contiki.h"
|
||||
#include "dev/serial-line.h"
|
||||
#include "dev/sht11.h"
|
||||
#include "lib/random.h"
|
||||
#include "net/rime.h"
|
||||
#include "net/rime/mesh.h"
|
||||
|
||||
#include "antelope.h"
|
||||
/*---------------------------------------------------------------------------*/
|
||||
/* Sampling interval in Hz. */
|
||||
#ifndef SAMPLING_INTERVAL
|
||||
#define SAMPLING_INTERVAL 60
|
||||
#endif
|
||||
|
||||
#ifndef RESPONSE_LIMIT
|
||||
#define RESPONSE_LIMIT 1000
|
||||
#endif
|
||||
|
||||
#ifndef PREPARE_DB
|
||||
#define PREPARE_DB 1
|
||||
#endif
|
||||
|
||||
#ifndef CARDINALITY
|
||||
#define CARDINALITY 1000
|
||||
#endif
|
||||
|
||||
#define MAX_BUFFER_SIZE 80
|
||||
|
||||
#define NETDB_CHANNEL 70
|
||||
/*---------------------------------------------------------------------------*/
|
||||
PROCESS(netdb_process, "NetDB");
|
||||
AUTOSTART_PROCESSES(&netdb_process);
|
||||
|
||||
static struct mesh_conn mesh;
|
||||
static rimeaddr_t reply_addr;
|
||||
static uint8_t buffer_offset;
|
||||
static char buffer[MAX_BUFFER_SIZE];
|
||||
/*---------------------------------------------------------------------------*/
|
||||
static void
|
||||
send_buffered_data(void)
|
||||
{
|
||||
if(buffer_offset > 0) {
|
||||
packetbuf_copyfrom(buffer, buffer_offset);
|
||||
mesh_send(&mesh, &reply_addr);
|
||||
buffer_offset = 0;
|
||||
}
|
||||
}
|
||||
/*---------------------------------------------------------------------------*/
|
||||
static int
|
||||
buffer_db_data(const char *format, ...)
|
||||
{
|
||||
va_list ap;
|
||||
size_t len;
|
||||
char tmp[MAX_BUFFER_SIZE + 1];
|
||||
|
||||
va_start(ap, format);
|
||||
len = vsnprintf(tmp, sizeof(tmp), format, ap);
|
||||
va_end(ap);
|
||||
|
||||
if(len < 0) {
|
||||
return -1;
|
||||
}
|
||||
|
||||
if(len + buffer_offset > sizeof(buffer)) {
|
||||
send_buffered_data();
|
||||
}
|
||||
|
||||
memcpy(&buffer[buffer_offset], tmp, len);
|
||||
buffer_offset += len;
|
||||
|
||||
return len;
|
||||
}
|
||||
/*---------------------------------------------------------------------------*/
|
||||
static void
|
||||
take_sample(void)
|
||||
{
|
||||
unsigned seconds;
|
||||
unsigned humidity;
|
||||
|
||||
seconds = clock_seconds();
|
||||
humidity = /*sht11_humidity()*/ random_rand();
|
||||
if(DB_ERROR(db_query(NULL, "INSERT (%u, %u) INTO samples;",
|
||||
seconds, humidity))) {
|
||||
printf("DB insertion failed\n");
|
||||
}
|
||||
}
|
||||
/*---------------------------------------------------------------------------*/
|
||||
static void
|
||||
stop_handler(void *ptr)
|
||||
{
|
||||
printf("END\n");
|
||||
}
|
||||
/*---------------------------------------------------------------------------*/
|
||||
PROCESS(query_process, "Query process");
|
||||
|
||||
PROCESS_THREAD(query_process, ev, data)
|
||||
{
|
||||
static db_handle_t handle;
|
||||
db_result_t result;
|
||||
static tuple_id_t matching;
|
||||
static tuple_id_t processed;
|
||||
#if !PREPARE_DB
|
||||
static struct etimer sampling_timer;
|
||||
#endif
|
||||
static unsigned i, errors;
|
||||
|
||||
PROCESS_BEGIN();
|
||||
|
||||
printf("NetDB host\n");
|
||||
|
||||
db_init();
|
||||
db_set_output_function(buffer_db_data);
|
||||
|
||||
db_query(NULL, "REMOVE RELATION samples;");
|
||||
db_query(NULL, "CREATE RELATION samples;");
|
||||
db_query(NULL, "CREATE ATTRIBUTE time DOMAIN INT IN samples;");
|
||||
db_query(NULL, "CREATE ATTRIBUTE hum DOMAIN INT IN samples;");
|
||||
db_query(NULL, "CREATE INDEX samples.time TYPE INLINE;");
|
||||
|
||||
#if PREPARE_DB
|
||||
printf("Preparing the DB with %d tuples...\n", CARDINALITY);
|
||||
errors = 0;
|
||||
for(i = 1; i <= CARDINALITY; i++) {
|
||||
PROCESS_PAUSE();
|
||||
|
||||
result = db_query(NULL, "INSERT (%u, %u) INTO samples;",
|
||||
i, (unsigned)random_rand());
|
||||
if(DB_ERROR(result)) {
|
||||
errors++;
|
||||
}
|
||||
}
|
||||
printf("Done. Insertion errors: %d\n", errors);
|
||||
printf("Ready to process queries\n");
|
||||
#else
|
||||
etimer_set(&sampling_timer, SAMPLING_INTERVAL * CLOCK_SECOND);
|
||||
#endif
|
||||
|
||||
for(;;) {
|
||||
PROCESS_WAIT_EVENT();
|
||||
|
||||
if(ev == serial_line_event_message && data != NULL) {
|
||||
printf("START %s\n", (char *)data);
|
||||
result = db_query(&handle, data);
|
||||
if(DB_ERROR(result)) {
|
||||
buffer_db_data("Query error: %s\n", db_get_result_message(result));
|
||||
stop_handler(NULL);
|
||||
db_free(&handle);
|
||||
continue;
|
||||
}
|
||||
|
||||
if(!db_processing(&handle)) {
|
||||
buffer_db_data("OK\n");
|
||||
send_buffered_data();
|
||||
stop_handler(NULL);
|
||||
continue;
|
||||
}
|
||||
|
||||
packetbuf_set_attr(PACKETBUF_ATTR_PACKET_TYPE,
|
||||
PACKETBUF_ATTR_PACKET_TYPE_STREAM);
|
||||
|
||||
db_print_header(&handle);
|
||||
|
||||
matching = 0;
|
||||
processed = 0;
|
||||
|
||||
while(db_processing(&handle)) {
|
||||
PROCESS_PAUSE();
|
||||
|
||||
if(matching == RESPONSE_LIMIT) {
|
||||
buffer_db_data("Response suppressed at %u tuples: limit reached\n",
|
||||
RESPONSE_LIMIT);
|
||||
stop_handler(NULL);
|
||||
db_free(&handle);
|
||||
break;
|
||||
}
|
||||
|
||||
result = db_process(&handle);
|
||||
if(result == DB_GOT_ROW) {
|
||||
/* The processed tuple matched the condition in the query. */
|
||||
matching++;
|
||||
processed++;
|
||||
db_print_tuple(&handle);
|
||||
} else if(result == DB_OK) {
|
||||
/* A tuple was processed, but did not match the condition. */
|
||||
processed++;
|
||||
continue;
|
||||
} else {
|
||||
if(result == DB_FINISHED) {
|
||||
/* The processing has finished. Wait for a new command. */
|
||||
buffer_db_data("[%ld tuples returned; %ld tuples processed]\n",
|
||||
(long)matching, (long)processed);
|
||||
buffer_db_data("OK\n");
|
||||
} else if(DB_ERROR(result)) {
|
||||
buffer_db_data("Processing error: %s\n",
|
||||
db_get_result_message(result));
|
||||
}
|
||||
stop_handler(NULL);
|
||||
db_free(&handle);
|
||||
}
|
||||
}
|
||||
send_buffered_data();
|
||||
}
|
||||
|
||||
#if !PREPARE_DB
|
||||
if(etimer_expired(&sampling_timer)) {
|
||||
take_sample();
|
||||
etimer_reset(&sampling_timer);
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
PROCESS_END();
|
||||
}
|
||||
/*---------------------------------------------------------------------------*/
|
||||
static void
|
||||
sent(struct mesh_conn *c)
|
||||
{
|
||||
}
|
||||
|
||||
static void
|
||||
timedout(struct mesh_conn *c)
|
||||
{
|
||||
printf("packet time out\n");
|
||||
}
|
||||
|
||||
static void
|
||||
received(struct mesh_conn *c, const rimeaddr_t *from, uint8_t hops)
|
||||
{
|
||||
char *data;
|
||||
unsigned len;
|
||||
static char query[MAX_BUFFER_SIZE + 1];
|
||||
|
||||
data = (char *)packetbuf_dataptr();
|
||||
len = packetbuf_datalen();
|
||||
|
||||
if(len > MAX_BUFFER_SIZE) {
|
||||
buffer_db_data("Too long query: %d bytes\n", len);
|
||||
return;
|
||||
}
|
||||
|
||||
memcpy(query, data, len);
|
||||
query[len] = '\0';
|
||||
|
||||
printf("Query received from %d.%d: %s (%d hops)\n",
|
||||
from->u8[0], from->u8[1], query, (int)hops);
|
||||
rimeaddr_copy(&reply_addr, from);
|
||||
|
||||
process_post(&query_process, serial_line_event_message, query);
|
||||
}
|
||||
|
||||
static const struct mesh_callbacks callbacks = {received, sent, timedout};
|
||||
/*---------------------------------------------------------------------------*/
|
||||
PROCESS_THREAD(netdb_process, ev, data)
|
||||
{
|
||||
PROCESS_EXITHANDLER(mesh_close(&mesh));
|
||||
PROCESS_BEGIN();
|
||||
|
||||
mesh_open(&mesh, NETDB_CHANNEL, &callbacks);
|
||||
process_start(&query_process, NULL);
|
||||
|
||||
PROCESS_END();
|
||||
}
|
271
examples/antelope/netdb/netdb.csc
Executable file
271
examples/antelope/netdb/netdb.csc
Executable file
@ -0,0 +1,271 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<simconf>
|
||||
<project EXPORT="discard">[CONTIKI_DIR]/tools/cooja/apps/mrm</project>
|
||||
<project EXPORT="discard">[CONTIKI_DIR]/tools/cooja/apps/mspsim</project>
|
||||
<project EXPORT="discard">[CONTIKI_DIR]/tools/cooja/apps/avrora</project>
|
||||
<project EXPORT="discard">[CONTIKI_DIR]/tools/cooja/apps/serial_socket</project>
|
||||
<project EXPORT="discard">[CONTIKI_DIR]/tools/cooja/apps/collect-view</project>
|
||||
<simulation>
|
||||
<title>NetDB</title>
|
||||
<delaytime>0</delaytime>
|
||||
<randomseed>123456</randomseed>
|
||||
<motedelay_us>1000000</motedelay_us>
|
||||
<radiomedium>
|
||||
se.sics.cooja.radiomediums.UDGM
|
||||
<transmitting_range>30.0</transmitting_range>
|
||||
<interference_range>30.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.mspmote.SkyMoteType
|
||||
<identifier>sky1</identifier>
|
||||
<description>NetDB Server</description>
|
||||
<source EXPORT="discard">[CONTIKI_DIR]/examples/antelope/netdb/netdb-server.c</source>
|
||||
<commands EXPORT="discard">make netdb-server.sky TARGET=sky</commands>
|
||||
<firmware EXPORT="copy">[CONTIKI_DIR]/examples/antelope/netdb/netdb-server.sky</firmware>
|
||||
<moteinterface>se.sics.cooja.interfaces.Position</moteinterface>
|
||||
<moteinterface>se.sics.cooja.interfaces.RimeAddress</moteinterface>
|
||||
<moteinterface>se.sics.cooja.interfaces.IPAddress</moteinterface>
|
||||
<moteinterface>se.sics.cooja.interfaces.Mote2MoteRelations</moteinterface>
|
||||
<moteinterface>se.sics.cooja.interfaces.MoteAttributes</moteinterface>
|
||||
<moteinterface>se.sics.cooja.mspmote.interfaces.MspClock</moteinterface>
|
||||
<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.SkyCoffeeFilesystem</moteinterface>
|
||||
<moteinterface>se.sics.cooja.mspmote.interfaces.SkyByteRadio</moteinterface>
|
||||
<moteinterface>se.sics.cooja.mspmote.interfaces.MspSerial</moteinterface>
|
||||
<moteinterface>se.sics.cooja.mspmote.interfaces.SkyLED</moteinterface>
|
||||
<moteinterface>se.sics.cooja.mspmote.interfaces.MspDebugOutput</moteinterface>
|
||||
<moteinterface>se.sics.cooja.mspmote.interfaces.SkyTemperature</moteinterface>
|
||||
</motetype>
|
||||
<motetype>
|
||||
se.sics.cooja.mspmote.SkyMoteType
|
||||
<identifier>sky2</identifier>
|
||||
<description>NetDB Client</description>
|
||||
<source EXPORT="discard">[CONTIKI_DIR]/examples/antelope/netdb/netdb-client.c</source>
|
||||
<commands EXPORT="discard">make netdb-client.sky TARGET=sky</commands>
|
||||
<firmware EXPORT="copy">[CONTIKI_DIR]/examples/antelope/netdb/netdb-client.sky</firmware>
|
||||
<moteinterface>se.sics.cooja.interfaces.Position</moteinterface>
|
||||
<moteinterface>se.sics.cooja.interfaces.RimeAddress</moteinterface>
|
||||
<moteinterface>se.sics.cooja.interfaces.IPAddress</moteinterface>
|
||||
<moteinterface>se.sics.cooja.interfaces.Mote2MoteRelations</moteinterface>
|
||||
<moteinterface>se.sics.cooja.interfaces.MoteAttributes</moteinterface>
|
||||
<moteinterface>se.sics.cooja.mspmote.interfaces.MspClock</moteinterface>
|
||||
<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.SkyCoffeeFilesystem</moteinterface>
|
||||
<moteinterface>se.sics.cooja.mspmote.interfaces.SkyByteRadio</moteinterface>
|
||||
<moteinterface>se.sics.cooja.mspmote.interfaces.MspSerial</moteinterface>
|
||||
<moteinterface>se.sics.cooja.mspmote.interfaces.SkyLED</moteinterface>
|
||||
<moteinterface>se.sics.cooja.mspmote.interfaces.MspDebugOutput</moteinterface>
|
||||
<moteinterface>se.sics.cooja.mspmote.interfaces.SkyTemperature</moteinterface>
|
||||
</motetype>
|
||||
<mote>
|
||||
<breakpoints />
|
||||
<interface_config>
|
||||
se.sics.cooja.interfaces.Position
|
||||
<x>23.57340748739308</x>
|
||||
<y>46.80222047486912</y>
|
||||
<z>0.0</z>
|
||||
</interface_config>
|
||||
<interface_config>
|
||||
se.sics.cooja.mspmote.interfaces.MspMoteID
|
||||
<id>1</id>
|
||||
</interface_config>
|
||||
<motetype_identifier>sky1</motetype_identifier>
|
||||
</mote>
|
||||
<mote>
|
||||
<breakpoints />
|
||||
<interface_config>
|
||||
se.sics.cooja.interfaces.Position
|
||||
<x>40.39130096157144</x>
|
||||
<y>70.54634688655467</y>
|
||||
<z>0.0</z>
|
||||
</interface_config>
|
||||
<interface_config>
|
||||
se.sics.cooja.mspmote.interfaces.MspMoteID
|
||||
<id>2</id>
|
||||
</interface_config>
|
||||
<motetype_identifier>sky1</motetype_identifier>
|
||||
</mote>
|
||||
<mote>
|
||||
<breakpoints />
|
||||
<interface_config>
|
||||
se.sics.cooja.interfaces.Position
|
||||
<x>66.04131381969006</x>
|
||||
<y>36.41113701058369</y>
|
||||
<z>0.0</z>
|
||||
</interface_config>
|
||||
<interface_config>
|
||||
se.sics.cooja.mspmote.interfaces.MspMoteID
|
||||
<id>3</id>
|
||||
</interface_config>
|
||||
<motetype_identifier>sky1</motetype_identifier>
|
||||
</mote>
|
||||
<mote>
|
||||
<breakpoints />
|
||||
<interface_config>
|
||||
se.sics.cooja.interfaces.Position
|
||||
<x>63.00130046120498</x>
|
||||
<y>80.89331313174746</y>
|
||||
<z>0.0</z>
|
||||
</interface_config>
|
||||
<interface_config>
|
||||
se.sics.cooja.mspmote.interfaces.MspMoteID
|
||||
<id>4</id>
|
||||
</interface_config>
|
||||
<motetype_identifier>sky1</motetype_identifier>
|
||||
</mote>
|
||||
<mote>
|
||||
<breakpoints />
|
||||
<interface_config>
|
||||
se.sics.cooja.interfaces.Position
|
||||
<x>40.2894982777653</x>
|
||||
<y>95.14334789567525</y>
|
||||
<z>0.0</z>
|
||||
</interface_config>
|
||||
<interface_config>
|
||||
se.sics.cooja.mspmote.interfaces.MspMoteID
|
||||
<id>5</id>
|
||||
</interface_config>
|
||||
<motetype_identifier>sky1</motetype_identifier>
|
||||
</mote>
|
||||
<mote>
|
||||
<breakpoints />
|
||||
<interface_config>
|
||||
se.sics.cooja.interfaces.Position
|
||||
<x>-13.168104050312492</x>
|
||||
<y>40.250683112542255</y>
|
||||
<z>0.0</z>
|
||||
</interface_config>
|
||||
<interface_config>
|
||||
se.sics.cooja.mspmote.interfaces.MspMoteID
|
||||
<id>6</id>
|
||||
</interface_config>
|
||||
<motetype_identifier>sky1</motetype_identifier>
|
||||
</mote>
|
||||
<mote>
|
||||
<breakpoints />
|
||||
<interface_config>
|
||||
se.sics.cooja.interfaces.Position
|
||||
<x>80.95025965975177</x>
|
||||
<y>44.99507552455861</y>
|
||||
<z>0.0</z>
|
||||
</interface_config>
|
||||
<interface_config>
|
||||
se.sics.cooja.mspmote.interfaces.MspMoteID
|
||||
<id>7</id>
|
||||
</interface_config>
|
||||
<motetype_identifier>sky1</motetype_identifier>
|
||||
</mote>
|
||||
<mote>
|
||||
<breakpoints />
|
||||
<interface_config>
|
||||
se.sics.cooja.interfaces.Position
|
||||
<x>6.857316697020866</x>
|
||||
<y>33.24863334754029</y>
|
||||
<z>0.0</z>
|
||||
</interface_config>
|
||||
<interface_config>
|
||||
se.sics.cooja.mspmote.interfaces.MspMoteID
|
||||
<id>8</id>
|
||||
</interface_config>
|
||||
<motetype_identifier>sky1</motetype_identifier>
|
||||
</mote>
|
||||
<mote>
|
||||
<breakpoints />
|
||||
<interface_config>
|
||||
se.sics.cooja.interfaces.Position
|
||||
<x>35.975659895989395</x>
|
||||
<y>27.42171932830696</y>
|
||||
<z>0.0</z>
|
||||
</interface_config>
|
||||
<interface_config>
|
||||
se.sics.cooja.mspmote.interfaces.MspMoteID
|
||||
<id>9</id>
|
||||
</interface_config>
|
||||
<motetype_identifier>sky1</motetype_identifier>
|
||||
</mote>
|
||||
<mote>
|
||||
<breakpoints />
|
||||
<interface_config>
|
||||
se.sics.cooja.interfaces.Position
|
||||
<x>13.672853648109518</x>
|
||||
<y>68.2461872644317</y>
|
||||
<z>0.0</z>
|
||||
</interface_config>
|
||||
<interface_config>
|
||||
se.sics.cooja.mspmote.interfaces.MspMoteID
|
||||
<id>10</id>
|
||||
</interface_config>
|
||||
<motetype_identifier>sky1</motetype_identifier>
|
||||
</mote>
|
||||
<mote>
|
||||
<breakpoints />
|
||||
<interface_config>
|
||||
se.sics.cooja.interfaces.Position
|
||||
<x>44.62423029692567</x>
|
||||
<y>48.53691502749644</y>
|
||||
<z>0.0</z>
|
||||
</interface_config>
|
||||
<interface_config>
|
||||
se.sics.cooja.mspmote.interfaces.MspMoteID
|
||||
<id>51</id>
|
||||
</interface_config>
|
||||
<motetype_identifier>sky2</motetype_identifier>
|
||||
</mote>
|
||||
</simulation>
|
||||
<plugin>
|
||||
se.sics.cooja.plugins.SimControl
|
||||
<width>259</width>
|
||||
<z>3</z>
|
||||
<height>205</height>
|
||||
<location_x>0</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.MoteTypeVisualizerSkin</skin>
|
||||
<skin>se.sics.cooja.plugins.skins.UDGMVisualizerSkin</skin>
|
||||
<viewport>4.472125038273293 0.0 0.0 4.472125038273293 79.43486237544504 -89.06315297501011</viewport>
|
||||
</plugin_config>
|
||||
<width>475</width>
|
||||
<z>0</z>
|
||||
<height>429</height>
|
||||
<location_x>644</location_x>
|
||||
<location_y>9</location_y>
|
||||
</plugin>
|
||||
<plugin>
|
||||
se.sics.cooja.plugins.LogListener
|
||||
<plugin_config>
|
||||
<filter>ID:4$</filter>
|
||||
</plugin_config>
|
||||
<width>1024</width>
|
||||
<z>2</z>
|
||||
<height>150</height>
|
||||
<location_x>0</location_x>
|
||||
<location_y>389</location_y>
|
||||
</plugin>
|
||||
<plugin>
|
||||
se.sics.cooja.plugins.MoteInterfaceViewer
|
||||
<mote_arg>10</mote_arg>
|
||||
<plugin_config>
|
||||
<interface>Serial port</interface>
|
||||
<scrollpos>0,0</scrollpos>
|
||||
</plugin_config>
|
||||
<width>588</width>
|
||||
<z>1</z>
|
||||
<height>399</height>
|
||||
<location_x>505</location_x>
|
||||
<location_y>520</location_y>
|
||||
</plugin>
|
||||
</simconf>
|
||||
|
20
examples/antelope/netdb/project-conf.h
Normal file
20
examples/antelope/netdb/project-conf.h
Normal file
@ -0,0 +1,20 @@
|
||||
#undef QUEUEBUF_CONF_NUM
|
||||
#define QUEUEBUF_CONF_NUM 4
|
||||
|
||||
#undef NETSTACK_CONF_RDC
|
||||
#define NETSTACK_CONF_RDC nullrdc_driver
|
||||
|
||||
#undef NETSTACK_CONF_RDC_CHANNEL_CHECK_RATE
|
||||
#define NETSTACK_CONF_RDC_CHANNEL_CHECK_RATE 4
|
||||
|
||||
#undef DCOSYNC_CONF_ENABLED
|
||||
#define DCOSYNC_CONF_ENABLED 0
|
||||
|
||||
#undef DB_FEATURE_JOIN
|
||||
#define DB_FEATURE_JOIN 0
|
||||
|
||||
#undef RF_CHANNEL
|
||||
#define RF_CHANNEL 16
|
||||
|
||||
#undef ROUTE_CONF_DEFAULT_LIFETIME
|
||||
#define ROUTE_CONF_DEFAULT_LIFETIME 300
|
Loading…
Reference in New Issue
Block a user