Merge pull request #63 from sics-iot/pr/restructuring
New repository structure
This commit is contained in:
commit
0b315d8056
|
@ -81,7 +81,7 @@ platform/galileo/bsp/grub/bin/
|
|||
*.prg
|
||||
*.dsc
|
||||
|
||||
#regression tests artifacts
|
||||
#test artifacts
|
||||
*.testlog
|
||||
*.log.prog
|
||||
*.report
|
||||
|
@ -90,8 +90,8 @@ summary
|
|||
*.runerr
|
||||
*.runlog
|
||||
*.faillog
|
||||
regression-tests/[0-9][0-9]-*/report
|
||||
regression-tests/[0-9][0-9]-*/org/
|
||||
tests/[0-9][0-9]-*/report
|
||||
tests/[0-9][0-9]-*/org/
|
||||
|
||||
# cscope files
|
||||
cscope.*
|
||||
|
|
10
.travis.yml
10
.travis.yml
|
@ -77,15 +77,15 @@ before_script:
|
|||
fi
|
||||
|
||||
script:
|
||||
## regression-tests/Makefile handles most of generic logic
|
||||
- "make -C regression-tests/??-$BUILD_TYPE RUNALL=true summary"
|
||||
## tests/Makefile handles most of generic logic
|
||||
- "make -C tests/??-$BUILD_TYPE RUNALL=true summary"
|
||||
|
||||
after_script:
|
||||
## Print cooja test logs
|
||||
- "[ ${BUILD_CATEGORY:-0} = sim ] && tail regression-tests/??-$BUILD_TYPE/*.testlog"
|
||||
- "[ ${BUILD_CATEGORY:-0} = sim ] && tail tests/??-$BUILD_TYPE/*.testlog"
|
||||
## Print a basic summary
|
||||
- "echo 'Summary:'; cat regression-tests/??-$BUILD_TYPE/summary"
|
||||
- "FAILS=`grep -c ' FAIL ' regression-tests/??-$BUILD_TYPE/summary`"
|
||||
- "echo 'Summary:'; cat tests/??-$BUILD_TYPE/summary"
|
||||
- "FAILS=`grep -c ' FAIL ' tests/??-$BUILD_TYPE/summary`"
|
||||
## This will detect whether the build should pass or fail
|
||||
- "test $FAILS -eq 0; exit $?"
|
||||
|
||||
|
|
|
@ -46,12 +46,15 @@ usage:
|
|||
@echo "make MAKETARGETS... [TARGET=(TARGET)] [savetarget] [targets]"
|
||||
|
||||
targets:
|
||||
@ls -1 $(CONTIKI)/arch/platform $(TARGETDIRS) | grep -v CVS
|
||||
@ls -1 $(CONTIKI)/arch/platform $(TARGETDIRS)
|
||||
|
||||
savetarget:
|
||||
-@rm -f Makefile.target
|
||||
@echo "saving Makefile.target"
|
||||
@echo >Makefile.target "TARGET = $(TARGET)"
|
||||
ifneq ($(BOARD),)
|
||||
@echo >>Makefile.target "BOARD = $(BOARD)"
|
||||
endif
|
||||
|
||||
savedefines:
|
||||
-@rm -f Makefile.$(TARGET).defines
|
||||
|
@ -60,12 +63,16 @@ savedefines:
|
|||
|
||||
OBJECTDIR = obj_$(TARGET)
|
||||
|
||||
LOWERCASE = -abcdefghijklmnopqrstuvwxyz
|
||||
UPPERCASE = _ABCDEFGHIJKLMNOPQRSTUVWXYZ
|
||||
LOWERCASE = -abcdefghijklmnopqrstuvwxyz/
|
||||
UPPERCASE = _ABCDEFGHIJKLMNOPQRSTUVWXYZ_
|
||||
TARGET_UPPERCASE := ${strip ${shell echo $(TARGET) | sed y!$(LOWERCASE)!$(UPPERCASE)!}}
|
||||
CFLAGS += -DCONTIKI=1 -DCONTIKI_TARGET_$(TARGET_UPPERCASE)=1
|
||||
ifneq ($(BOARD),)
|
||||
TARGET_BOARD_UPPERCASE := ${strip ${shell echo $(BOARD) | sed y!$(LOWERCASE)!$(UPPERCASE)!}}
|
||||
CFLAGS += -DCONTIKI_BOARD_$(TARGET_BOARD_UPPERCASE)=1
|
||||
endif
|
||||
|
||||
MODULES += core/sys core/dev core/lib
|
||||
MODULES += os os/sys os/dev os/lib os/services
|
||||
|
||||
# Include IPv6, RPL
|
||||
|
||||
|
@ -82,25 +89,22 @@ ifeq ($(CONTIKI_WITH_IPV6),1)
|
|||
CFLAGS += -DNETSTACK_CONF_WITH_IPV6=1
|
||||
CONTIKI_WITH_RPL ?= 1
|
||||
CONTIKI_WITH_RPL_LITE ?= 1
|
||||
MODULES += core/net/ipv6 core/net/ip
|
||||
MODULES += os/net/ipv6 os/net/ip
|
||||
endif
|
||||
|
||||
ifeq ($(CONTIKI_WITH_RPL),1)
|
||||
CFLAGS += -DUIP_CONF_IPV6_RPL=1
|
||||
ifeq ($(CONTIKI_WITH_RPL_LITE),1)
|
||||
CFLAGS += -DUIP_CONF_IPV6_RPL_LITE=1
|
||||
MODULES += core/net/rpl-lite
|
||||
MODULES += os/net/rpl-lite
|
||||
else
|
||||
MODULES += core/net/rpl
|
||||
MODULES += os/net/rpl
|
||||
endif
|
||||
else
|
||||
CFLAGS += -DUIP_CONF_IPV6_RPL=0
|
||||
endif
|
||||
|
||||
CONTIKI_SOURCEFILES += $(CONTIKIFILES)
|
||||
|
||||
CONTIKIDIRS += ${addprefix $(CONTIKI)/core/,dev lib net net/mac \
|
||||
sys cfs . }
|
||||
MODULES += os os/net os/net/mac os/storage
|
||||
|
||||
oname = ${patsubst %.c,%.o,${patsubst %.S,%.o,$(1)}}
|
||||
|
||||
|
@ -114,19 +118,6 @@ $(OBJECTDIR):
|
|||
|
||||
uniq = $(if $1,$(firstword $1) $(call uniq,$(filter-out $(firstword $1),$1)))
|
||||
|
||||
### Include application makefiles
|
||||
|
||||
ifdef APPS
|
||||
APPDS = ${wildcard ${foreach DIR, $(APPDIRS), ${addprefix $(DIR)/, $(APPS)}}} \
|
||||
${wildcard ${addprefix $(CONTIKI)/apps/, $(APPS)} \
|
||||
${addprefix $(CONTIKI)/arch/platform/$(TARGET)/apps/, $(APPS)} \
|
||||
$(APPS)}
|
||||
APPINCLUDES = ${foreach APP, $(APPS), ${wildcard ${foreach DIR, $(APPDS), $(DIR)/Makefile.$(APP)}}}
|
||||
-include $(APPINCLUDES)
|
||||
APP_SOURCES = ${foreach d, $(APPDS), ${subst ${d}/,,${wildcard $(d)/*.c}}}
|
||||
CONTIKI_SOURCEFILES += $(APP_SOURCES)
|
||||
endif
|
||||
|
||||
### Include target makefile (TODO Unsafe?)
|
||||
|
||||
target_makefile := $(wildcard $(CONTIKI)/arch/platform/$(TARGET)/Makefile.$(TARGET) ${foreach TDIR, $(TARGETDIRS), $(TDIR)/$(TARGET)/Makefile.$(TARGET)})
|
||||
|
@ -145,8 +136,9 @@ ifdef MODULES
|
|||
UNIQUEMODULES = $(call uniq,$(MODULES))
|
||||
MODULEDIRS = ${wildcard ${addprefix $(CONTIKI)/, $(UNIQUEMODULES)}}
|
||||
MODULES_SOURCES = ${foreach d, $(MODULEDIRS), ${subst ${d}/,,${wildcard $(d)/*.c}}}
|
||||
MODULES_INCLUDES = ${wildcard ${foreach d, $(MODULEDIRS), $(d)/Makefile.${notdir $(d)}}}
|
||||
-include $(MODULE_INCLUDES)
|
||||
CONTIKI_SOURCEFILES += $(MODULES_SOURCES)
|
||||
APPDS += $(MODULEDIRS)
|
||||
endif
|
||||
|
||||
### Verbosity control. Use make V=1 to get verbose builds.
|
||||
|
@ -179,7 +171,7 @@ CONTIKI_CPU_DIRS_CONCAT = ${addprefix $(CONTIKI_CPU)/, \
|
|||
CONTIKI_ARCH_DIRS = ${addprefix $(CONTIKI)/, arch}
|
||||
|
||||
SOURCEDIRS = . $(PROJECTDIRS) $(CONTIKI_TARGET_DIRS_CONCAT) $(CONTIKI_ARCH_DIRS) \
|
||||
$(CONTIKI_CPU_DIRS_CONCAT) $(CONTIKIDIRS) $(APPDS) $(EXTERNALDIRS) ${dir $(target_makefile)}
|
||||
$(CONTIKI_CPU_DIRS_CONCAT) $(CONTIKIDIRS) $(MODULEDIRS) $(EXTERNALDIRS) ${dir $(target_makefile)}
|
||||
|
||||
vpath %.c $(SOURCEDIRS)
|
||||
vpath %.S $(SOURCEDIRS)
|
||||
|
|
|
@ -1,2 +0,0 @@
|
|||
# Erbium will implement the REST Engine
|
||||
CFLAGS += -DREST=coap_rest_implementation
|
|
@ -1,287 +0,0 @@
|
|||
/*
|
||||
* Copyright (c) 2009, Swedish Institute of Computer Science.
|
||||
* All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions
|
||||
* are met:
|
||||
* 1. Redistributions of source code must retain the above copyright
|
||||
* notice, this list of conditions and the following disclaimer.
|
||||
* 2. Redistributions in binary form must reproduce the above copyright
|
||||
* notice, this list of conditions and the following disclaimer in the
|
||||
* documentation and/or other materials provided with the distribution.
|
||||
* 3. Neither the name of the Institute nor the names of its contributors
|
||||
* may be used to endorse or promote products derived from this software
|
||||
* without specific prior written permission.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE INSTITUTE AND CONTRIBUTORS ``AS IS'' AND
|
||||
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
||||
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
||||
* ARE DISCLAIMED. IN NO EVENT SHALL THE INSTITUTE OR CONTRIBUTORS BE LIABLE
|
||||
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
|
||||
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
|
||||
* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
|
||||
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
|
||||
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
|
||||
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
||||
* SUCH DAMAGE.
|
||||
*
|
||||
* This file is part of the Contiki operating system.
|
||||
*
|
||||
*/
|
||||
|
||||
/**
|
||||
* \file
|
||||
* Contiki interface to post to http basic auth services
|
||||
* \author
|
||||
* Adam Dunkels <adam@sics.se>
|
||||
*/
|
||||
|
||||
#include "contiki.h"
|
||||
#include "contiki-net.h"
|
||||
|
||||
#include "http-post-auth.h"
|
||||
|
||||
#include <stdio.h>
|
||||
#include <string.h>
|
||||
|
||||
#define MAX_USERNAME_PASSWORD 32
|
||||
#define MAX_MESSAGE 160
|
||||
#define MAX_LENGTH 10
|
||||
|
||||
#define HOST_NAME "api.example.org"
|
||||
|
||||
struct http_post_auth_state {
|
||||
unsigned char timer;
|
||||
struct psock sin, sout;
|
||||
char lengthstr[MAX_LENGTH];
|
||||
char base64_username_password[MAX_USERNAME_PASSWORD];
|
||||
char message[MAX_MESSAGE];
|
||||
uint8_t inputbuf[UIP_TCP_MSS];
|
||||
uip_ipaddr_t addr;
|
||||
};
|
||||
|
||||
struct http_post_auth_state conn;
|
||||
|
||||
#ifndef DEBUG
|
||||
#define DEBUG 0
|
||||
#endif
|
||||
#if DEBUG
|
||||
#include <stdio.h>
|
||||
#define PRINTF(...) printf(__VA_ARGS__)
|
||||
#else
|
||||
#define PRINTF(...)
|
||||
#endif
|
||||
|
||||
PROCESS(http_post_auth_process, "HTTP POST auth client");
|
||||
/*---------------------------------------------------------------------------*/
|
||||
static uint8_t
|
||||
base64_encode_6bits(uint8_t c)
|
||||
{
|
||||
if(c <= 25) {
|
||||
return c + 'A';
|
||||
} else if(c <= 51) {
|
||||
return c - 26 + 'a';
|
||||
} else if(c <= 61) {
|
||||
return c - 52 + '0';
|
||||
} else if(c == 62) {
|
||||
return '+';
|
||||
} else if(c == 63) {
|
||||
return '/';
|
||||
}
|
||||
/* This shouldn't happen because only 6 bits of data should be
|
||||
passed to this function. */
|
||||
return '=';
|
||||
}
|
||||
/*---------------------------------------------------------------------------*/
|
||||
static void
|
||||
base64_encode_24bits(const uint8_t inputdata[], char outputdata[], int len)
|
||||
{
|
||||
switch(len) {
|
||||
case 0:
|
||||
outputdata[0] = outputdata[1] = outputdata[2] = outputdata[3] = '=';
|
||||
break;
|
||||
case 1:
|
||||
outputdata[0] = base64_encode_6bits((inputdata[0] >> 2) & 0x3f);
|
||||
outputdata[1] = base64_encode_6bits((((inputdata[0] << 4) & 0x30)));
|
||||
outputdata[2] = outputdata[3] = '=';
|
||||
break;
|
||||
case 2:
|
||||
outputdata[0] = base64_encode_6bits((inputdata[0] >> 2) & 0x3f);
|
||||
outputdata[1] = base64_encode_6bits((((inputdata[0] << 4) & 0x30) |
|
||||
(inputdata[1] >> 4)) & 0x3f);
|
||||
outputdata[2] = base64_encode_6bits((((inputdata[1] << 2) & 0x3f)));
|
||||
outputdata[3] = '=';
|
||||
break;
|
||||
case 3:
|
||||
default:
|
||||
outputdata[0] = base64_encode_6bits((inputdata[0] >> 2) & 0x3f);
|
||||
outputdata[1] = base64_encode_6bits((((inputdata[0] << 4) & 0x30) |
|
||||
(inputdata[1] >> 4)) & 0x3f);
|
||||
outputdata[2] = base64_encode_6bits((((inputdata[1] << 2) & 0x3c) |
|
||||
(inputdata[2] >> 6)) & 0x3f);
|
||||
outputdata[3] = base64_encode_6bits((inputdata[2]) & 0x3f);
|
||||
break;
|
||||
}
|
||||
}
|
||||
/*---------------------------------------------------------------------------*/
|
||||
int
|
||||
http_post_auth(const uint8_t *username_password, const char *msg)
|
||||
{
|
||||
int len;
|
||||
int i, j;
|
||||
struct http_post_auth_state *s;
|
||||
|
||||
process_exit(&http_post_auth_process);
|
||||
|
||||
/* s = (struct http_post_auth_state *)memb_alloc(&conns);*/
|
||||
s = &conn;
|
||||
if(s == NULL) {
|
||||
PRINTF("Could not allocate memory for the tweet\n");
|
||||
return 0;
|
||||
}
|
||||
PSOCK_INIT(&s->sin, (uint8_t *)s->inputbuf, sizeof(s->inputbuf) - 1);
|
||||
PSOCK_INIT(&s->sout, (uint8_t *)s->inputbuf, sizeof(s->inputbuf) - 1);
|
||||
s->timer = 0;
|
||||
|
||||
/* dec64 encode username:password pair */
|
||||
len = strlen((char *)username_password);
|
||||
j = 0;
|
||||
for(i = 0; i < len; i += 3) {
|
||||
base64_encode_24bits(&username_password[i], &s->base64_username_password[j],
|
||||
len - i);
|
||||
j += 4;
|
||||
}
|
||||
s->base64_username_password[j] = 0;
|
||||
|
||||
/* Copy the status message, and avoid the leading whitespace. */
|
||||
strcpy(s->message, "status=");
|
||||
strcpy(&s->message[7], msg);
|
||||
|
||||
/* PRINTF("username_password '%s'\n", s->base64_username_password);
|
||||
PRINTF("message '%s'\n", s->message);*/
|
||||
|
||||
/* Spawn process to deal with TCP connection */
|
||||
process_start(&http_post_auth_process, (void *)s);
|
||||
return 1;
|
||||
}
|
||||
/*---------------------------------------------------------------------------*/
|
||||
static int
|
||||
handle_output(struct http_post_auth_state *s)
|
||||
{
|
||||
PSOCK_BEGIN(&s->sout);
|
||||
/* Send POST header */
|
||||
|
||||
PSOCK_SEND_STR(&s->sout, "POST /statuses/update.json HTTP/1.1\r\n");
|
||||
|
||||
/* Send Authorization header */
|
||||
PSOCK_SEND_STR(&s->sout, "Authorization: Basic ");
|
||||
PSOCK_SEND_STR(&s->sout, s->base64_username_password);
|
||||
PSOCK_SEND_STR(&s->sout, "\r\n");
|
||||
|
||||
/* Send Agent header */
|
||||
PSOCK_SEND_STR(&s->sout, "User-Agent: Contiki 2.x\r\n");
|
||||
PSOCK_SEND_STR(&s->sout, "Host: " HOST_NAME "\r\n");
|
||||
PSOCK_SEND_STR(&s->sout, "Accept: */*\r\n");
|
||||
|
||||
/* Send Content length header */
|
||||
PSOCK_SEND_STR(&s->sout, "Content-Length: ");
|
||||
snprintf(s->lengthstr, sizeof(s->lengthstr), "%d", strlen(s->message));
|
||||
PSOCK_SEND_STR(&s->sout, s->lengthstr);
|
||||
PSOCK_SEND_STR(&s->sout, "\r\n");
|
||||
|
||||
/* Send Content type header */
|
||||
PSOCK_SEND_STR(&s->sout,
|
||||
"Content-Type: application/x-www-form-urlencoded\r\n\r\n");
|
||||
|
||||
|
||||
/* Send status message */
|
||||
PSOCK_SEND_STR(&s->sout, s->message);
|
||||
|
||||
/* Close connection */
|
||||
PSOCK_CLOSE(&s->sout);
|
||||
PSOCK_EXIT(&s->sout);
|
||||
PSOCK_END(&s->sout);
|
||||
}
|
||||
/*---------------------------------------------------------------------------*/
|
||||
static int
|
||||
handle_input(struct http_post_auth_state *s)
|
||||
{
|
||||
PSOCK_BEGIN(&s->sin);
|
||||
|
||||
/* We don't care about input data for now */
|
||||
|
||||
PSOCK_END(&s->sin);
|
||||
}
|
||||
/*---------------------------------------------------------------------------*/
|
||||
static void
|
||||
handle_connection(struct http_post_auth_state *s)
|
||||
{
|
||||
handle_input(s);
|
||||
handle_output(s);
|
||||
}
|
||||
/*---------------------------------------------------------------------------*/
|
||||
PROCESS_THREAD(http_post_auth_process, ev, data)
|
||||
{
|
||||
struct http_post_auth_state *s = data;
|
||||
struct uip_conn *conn;
|
||||
|
||||
PROCESS_BEGIN();
|
||||
|
||||
/* Lookup host */
|
||||
|
||||
/* XXX for now, just use 128.121.146.228 */
|
||||
uip_ipaddr(&s->addr, 128,121,146,228);
|
||||
|
||||
|
||||
/* Open a TCP connection to port 80 */
|
||||
conn = tcp_connect(&s->addr, uip_htons(80), s);
|
||||
if(conn == NULL) {
|
||||
PRINTF("Could not open TCP connection\n");
|
||||
/* memb_free(&conns, s);*/
|
||||
PROCESS_EXIT();
|
||||
}
|
||||
|
||||
while(1) {
|
||||
PROCESS_WAIT_EVENT();
|
||||
|
||||
if(ev == tcpip_event) {
|
||||
struct http_post_auth_state *s = (struct http_post_auth_state *)data;
|
||||
|
||||
if(uip_closed() || uip_aborted() || uip_timedout()) {
|
||||
if(uip_closed()) {
|
||||
PRINTF("Connection closed\n");
|
||||
} else {
|
||||
PRINTF("Connection aborted/timedout\n");
|
||||
}
|
||||
/* if(s != NULL) {
|
||||
memb_free(&conns, s);
|
||||
}*/
|
||||
PROCESS_EXIT();
|
||||
} else if(uip_connected()) {
|
||||
handle_connection(s);
|
||||
s->timer = 0;
|
||||
} else if(s != NULL) {
|
||||
if(uip_poll()) {
|
||||
++s->timer;
|
||||
if(s->timer >= 20) {
|
||||
PRINTF("Timed out due to inactivity\n");
|
||||
uip_abort();
|
||||
PROCESS_EXIT();
|
||||
/* memb_free(&conns, s);*/
|
||||
}
|
||||
} else {
|
||||
s->timer = 0;
|
||||
}
|
||||
handle_connection(s);
|
||||
} else {
|
||||
PRINTF("Abort because s == NULL\n");
|
||||
uip_abort();
|
||||
PROCESS_EXIT();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
PROCESS_END();
|
||||
}
|
||||
/*---------------------------------------------------------------------------*/
|
|
@ -1,42 +0,0 @@
|
|||
/*
|
||||
* Copyright (c) 2009, Swedish Institute of Computer Science.
|
||||
* All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions
|
||||
* are met:
|
||||
* 1. Redistributions of source code must retain the above copyright
|
||||
* notice, this list of conditions and the following disclaimer.
|
||||
* 2. Redistributions in binary form must reproduce the above copyright
|
||||
* notice, this list of conditions and the following disclaimer in the
|
||||
* documentation and/or other materials provided with the distribution.
|
||||
* 3. Neither the name of the Institute nor the names of its contributors
|
||||
* may be used to endorse or promote products derived from this software
|
||||
* without specific prior written permission.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE INSTITUTE AND CONTRIBUTORS ``AS IS'' AND
|
||||
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
||||
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
||||
* ARE DISCLAIMED. IN NO EVENT SHALL THE INSTITUTE OR CONTRIBUTORS BE LIABLE
|
||||
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
|
||||
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
|
||||
* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
|
||||
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
|
||||
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
|
||||
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
||||
* SUCH DAMAGE.
|
||||
*
|
||||
* This file is part of the Contiki operating system.
|
||||
*
|
||||
*/
|
||||
|
||||
#ifndef HTTP_POST_AUTH_H_
|
||||
#define HTTP_POST_AUTH_H_
|
||||
|
||||
#include "contiki-net.h"
|
||||
|
||||
PROCESS_NAME(http_post_auth_process);
|
||||
|
||||
int http_post_auth(const uint8_t *username_password, const char *message);
|
||||
|
||||
#endif /* HTTP_POST_AUTH_H_ */
|
|
@ -1,176 +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 "contiki-lib.h"
|
||||
#include "contiki-net.h"
|
||||
|
||||
#include "mac.h"
|
||||
|
||||
#include <string.h>
|
||||
#include <stdio.h>
|
||||
|
||||
#define MACDEBUG 0
|
||||
|
||||
#define DEBUG 0
|
||||
#if DEBUG
|
||||
#include <stdio.h>
|
||||
#define PRINTF(...) printf(__VA_ARGS__)
|
||||
#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])
|
||||
#define PRINTLLADDR(lladdr) PRINTF(" %02x:%02x:%02x:%02x:%02x:%02x ",lladdr->addr[0], lladdr->addr[1], lladdr->addr[2], lladdr->addr[3],lladdr->addr[4], lladdr->addr[5])
|
||||
#else
|
||||
#define PRINTF(...)
|
||||
#define PRINT6ADDR(addr)
|
||||
#endif
|
||||
|
||||
#define PING6_NB 5
|
||||
#define PING6_DATALEN 16
|
||||
|
||||
#define UIP_IP_BUF ((struct uip_ip_hdr *)&uip_buf[UIP_LLH_LEN])
|
||||
#define UIP_ICMP_BUF ((struct uip_icmp_hdr *)&uip_buf[uip_l2_l3_hdr_len])
|
||||
|
||||
static struct etimer ping6_periodic_timer;
|
||||
static uint8_t count = 0;
|
||||
static char command[20];
|
||||
static uint16_t addr[8];
|
||||
uip_ipaddr_t dest_addr;
|
||||
|
||||
PROCESS(ping6_process, "PING6 process");
|
||||
AUTOSTART_PROCESSES(&ping6_process);
|
||||
|
||||
|
||||
/*---------------------------------------------------------------------------*/
|
||||
static uint8_t
|
||||
ping6handler(process_event_t ev, process_data_t data)
|
||||
{
|
||||
if(count == 0){
|
||||
#if MACDEBUG
|
||||
// Setup destination address.
|
||||
addr[0] = 0xFE80;
|
||||
addr[4] = 0x6466;
|
||||
addr[5] = 0x6666;
|
||||
addr[6] = 0x6666;
|
||||
addr[7] = 0x6666;
|
||||
uip_ip6addr(&dest_addr, addr[0], addr[1],addr[2],
|
||||
addr[3],addr[4],addr[5],addr[6],addr[7]);
|
||||
|
||||
// Set the command to fool the 'if' below.
|
||||
memcpy(command, (void *)"ping6", 5);
|
||||
|
||||
#else
|
||||
/* prompt */
|
||||
printf("> ");
|
||||
/** \note the scanf here is blocking (the all stack is blocked waiting
|
||||
* for user input). This is far from ideal and could be improved
|
||||
*/
|
||||
scanf("%s", command);
|
||||
|
||||
if(strcmp(command,"ping6") != 0){
|
||||
PRINTF("> invalid command\n");
|
||||
return 0;
|
||||
}
|
||||
|
||||
if(scanf(" %04x:%04x:%04x:%04x:%04x:%04x:%04x:%04x",
|
||||
&addr[0],&addr[1],&addr[2],&addr[3],
|
||||
&addr[4],&addr[5],&addr[6],&addr[7]) == 8){
|
||||
|
||||
uip_ip6addr(&dest_addr, addr[0], addr[1],addr[2],
|
||||
addr[3],addr[4],addr[5],addr[6],addr[7]);
|
||||
} else {
|
||||
PRINTF("> invalid ipv6 address format\n");
|
||||
return 0;
|
||||
}
|
||||
#endif
|
||||
|
||||
}
|
||||
|
||||
if((strcmp(command,"ping6") == 0) && (count < PING6_NB)){
|
||||
|
||||
UIP_IP_BUF->vtc = 0x60;
|
||||
UIP_IP_BUF->tcflow = 1;
|
||||
UIP_IP_BUF->flow = 0;
|
||||
UIP_IP_BUF->proto = UIP_PROTO_ICMP6;
|
||||
UIP_IP_BUF->ttl = uip_ds6_if.cur_hop_limit;
|
||||
uip_ipaddr_copy(&UIP_IP_BUF->destipaddr, &dest_addr);
|
||||
uip_ds6_select_src(&UIP_IP_BUF->srcipaddr, &UIP_IP_BUF->destipaddr);
|
||||
|
||||
UIP_ICMP_BUF->type = ICMP6_ECHO_REQUEST;
|
||||
UIP_ICMP_BUF->icode = 0;
|
||||
/* set identifier and sequence number to 0 */
|
||||
memset((uint8_t *)UIP_ICMP_BUF + UIP_ICMPH_LEN, 0, 4);
|
||||
/* put one byte of data */
|
||||
memset((uint8_t *)UIP_ICMP_BUF + UIP_ICMPH_LEN + UIP_ICMP6_ECHO_REQUEST_LEN,
|
||||
count, PING6_DATALEN);
|
||||
|
||||
|
||||
uip_len = UIP_ICMPH_LEN + UIP_ICMP6_ECHO_REQUEST_LEN + UIP_IPH_LEN + PING6_DATALEN;
|
||||
UIP_IP_BUF->len[0] = (uint8_t)((uip_len - 40) >> 8);
|
||||
UIP_IP_BUF->len[1] = (uint8_t)((uip_len - 40) & 0x00FF);
|
||||
|
||||
UIP_ICMP_BUF->icmpchksum = 0;
|
||||
UIP_ICMP_BUF->icmpchksum = ~uip_icmp6chksum();
|
||||
|
||||
|
||||
PRINTF("Sending Echo Request to");
|
||||
PRINT6ADDR(&UIP_IP_BUF->destipaddr);
|
||||
PRINTF("from");
|
||||
PRINT6ADDR(&UIP_IP_BUF->srcipaddr);
|
||||
PRINTF("\n");
|
||||
UIP_STAT(++uip_stat.icmp.sent);
|
||||
|
||||
tcpip_ipv6_output();
|
||||
|
||||
count++;
|
||||
etimer_set(&ping6_periodic_timer, 3 * CLOCK_SECOND);
|
||||
return 1;
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
/*---------------------------------------------------------------------------*/
|
||||
PROCESS_THREAD(ping6_process, ev, data)
|
||||
{
|
||||
|
||||
uint8_t cont = 1;
|
||||
|
||||
PROCESS_BEGIN();
|
||||
PRINTF("In Process PING6\n");
|
||||
PRINTF("Wait for DAD\n");
|
||||
|
||||
etimer_set(&ping6_periodic_timer, 15*CLOCK_SECOND);
|
||||
|
||||
while(cont) {
|
||||
PROCESS_YIELD();
|
||||
cont = ping6handler(ev, data);
|
||||
}
|
||||
|
||||
PRINTF("END PING6\n");
|
||||
PROCESS_END();
|
||||
}
|
||||
/*---------------------------------------------------------------------------*/
|
|
@ -1,8 +0,0 @@
|
|||
#ifndef PING6_H_
|
||||
#define PING6_H_
|
||||
|
||||
#include "contiki.h"
|
||||
|
||||
PROCESS_NAME(ping6_process);
|
||||
|
||||
#endif /* PING6_H_ */
|
|
@ -41,7 +41,7 @@
|
|||
* Random number generator routines exploiting the cc2538 hardware
|
||||
* capabilities.
|
||||
*
|
||||
* This file overrides core/lib/random.c.
|
||||
* This file overrides os/lib/random.c.
|
||||
*/
|
||||
#include "contiki.h"
|
||||
#include "dev/rfcore.h"
|
||||
|
|
|
@ -34,7 +34,7 @@
|
|||
* Random number generator routines exploiting the cc2530 hardware
|
||||
* capabilities.
|
||||
*
|
||||
* This file overrides core/lib/random.c.
|
||||
* This file overrides os/lib/random.c.
|
||||
*
|
||||
* \author
|
||||
* George Oikonomou - <oikonomou@users.sourceforge.net>
|
||||
|
|
|
@ -34,7 +34,7 @@
|
|||
*
|
||||
* \file
|
||||
*
|
||||
* This file overrides core/lib/random.c and calls SoC-specific RNG functions
|
||||
* This file overrides os/lib/random.c and calls SoC-specific RNG functions
|
||||
*/
|
||||
/*---------------------------------------------------------------------------*/
|
||||
#include "contiki.h"
|
||||
|
|
|
@ -41,7 +41,7 @@
|
|||
* Random number generator routines exploiting the nRF52 hardware
|
||||
* capabilities.
|
||||
*
|
||||
* This file overrides core/lib/random.c.
|
||||
* This file overrides os/lib/random.c.
|
||||
*
|
||||
* \author
|
||||
* Wojciech Bober <wojciech.bober@nordicsemi.no>
|
||||
|
|
|
@ -19,8 +19,9 @@ CLEAN += *.cc2538dk
|
|||
CONTIKI_CPU=$(CONTIKI)/arch/cpu/cc2538
|
||||
include $(CONTIKI_CPU)/Makefile.cc2538
|
||||
|
||||
MODULES += core/net core/net/mac core/net/mac/framer \
|
||||
core/net/mac/csma core/net/mac/nullmac
|
||||
MODULES += os/net os/net/mac os/net/mac/framer \
|
||||
os/net/mac/csma os/net/mac/nullmac \
|
||||
os/storage/cfs
|
||||
|
||||
PYTHON = python
|
||||
BSL_FLAGS += -e -w -v
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
COOJAPLATFORMDIR=$(CONTIKI)/arch/platform/cooja
|
||||
|
||||
MODULES += core/net/ip64
|
||||
MODULES += os/net/ip64
|
||||
include $(COOJAPLATFORMDIR)/Makefile.cooja
|
||||
|
||||
vpath %.c $(COOJAPLATFORMDIR) $(COOJAPLATFORMDIR)/dev \
|
||||
|
|
|
@ -77,8 +77,8 @@ CFLAGSNO += -Werror
|
|||
endif
|
||||
CFLAGS += $(CFLAGSNO)
|
||||
|
||||
MODULES += core/net core/net/mac core/net/mac/framer core/net/ip64-addr \
|
||||
core/net/mac/csma core/net/mac/nullmac
|
||||
MODULES += os/net os/net/mac os/net/mac/framer os/net/ip64-addr \
|
||||
os/net/mac/csma os/net/mac/nullmac
|
||||
|
||||
## Copied from Makefile.include, since Cooja overrides CFLAGS et al
|
||||
HAS_STACK = 0
|
||||
|
|
|
@ -143,8 +143,8 @@ endif
|
|||
CLEAN += *.jn516x
|
||||
CLEAN += *.jn516x.bin
|
||||
|
||||
MODULES += core/net core/net/mac core/net/mac/framer \
|
||||
core/net/mac/csma core/net/mac/nullmac
|
||||
MODULES += os/net os/net/mac os/net/mac/framer \
|
||||
os/net/mac/csma os/net/mac/nullmac
|
||||
|
||||
CONTIKI_TARGET_SOURCEFILES += $(ARCH)
|
||||
CONTIKI_SOURCEFILES += $(CONTIKI_TARGET_SOURCEFILES)
|
||||
|
|
|
@ -1,17 +1,16 @@
|
|||
This directory contains the contiki driver for the sensors (light, humidity and temperature sensor) available on the
|
||||
NXP DR1175 board. This board is part of the NXP JN516X Evaluation Kit (see http://www.nxp.com/documents/leaflet/75017368.pdf).
|
||||
This directory contains the contiki driver for the sensors (light, humidity and temperature sensor) available on the
|
||||
NXP DR1175 board. This board is part of the NXP JN516X Evaluation Kit (see http://www.nxp.com/documents/leaflet/75017368.pdf).
|
||||
|
||||
The dr1175 sensor code interfaces to the contiki `core/lib/sensors.c` framework.
|
||||
The code is specificaly for the JN516X platform, because it makes use of the platform\DK4 libraries
|
||||
of this JN516X SDK.
|
||||
The dr1175 sensor code interfaces to the contiki `os/lib/sensors.c` framework.
|
||||
The code is specificaly for the JN516X platform, because it makes use of the platform\DK4 libraries of this JN516X SDK.
|
||||
`examples/jn516x/rpl/coap-dr1175-node.c` shows an example on using this contiki driver.
|
||||
|
||||
Mapping of LEDs on JN516x DR1175/DR1174:
|
||||
leds.h: led on DR1175/DR1174:
|
||||
DR1174+DR1175:
|
||||
LEDS_RED Red led in RGB-led with level control on DR1175
|
||||
LEDS_GREEN Green led in RGB-led with level control on DR1175
|
||||
LEDS_BLUE Blue led in RGB-led with level control on DR1175
|
||||
LEDS_RED Red led in RGB-led with level control on DR1175
|
||||
LEDS_GREEN Green led in RGB-led with level control on DR1175
|
||||
LEDS_BLUE Blue led in RGB-led with level control on DR1175
|
||||
LEDS_WHITE White power led with level control on DR1175
|
||||
LEDS_GP0 LEDS D3 on DR1174
|
||||
LEDS_GP1 LEDS D6 on DR1174
|
||||
|
|
|
@ -1,9 +1,9 @@
|
|||
This directory contains the contiki driver for the sensor (potentiometer) available on the
|
||||
This directory contains the contiki driver for the sensor (potentiometer) available on the
|
||||
NXP DR1199 board. This board is part of the NXP JN516x Evaluation Kit (see http://www.nxp.com/documents/leaflet/75017368.pdf).
|
||||
The driver for the switches on the DR1199 are supported by `dev/dr1174` when compiled with the flag `SENSOR_BOARD_DR1199` set.
|
||||
|
||||
The dr1199 sensor code interfaces to contiki `core/lib/sensors.c` framework.
|
||||
The code is specificaly for the JN516X platform, because it makes use of the platform\DK4 libraries
|
||||
The dr1199 sensor code interfaces to contiki `os/lib/sensors.c` framework.
|
||||
The code is specificaly for the JN516X platform, because it makes use of the platform\DK4 libraries
|
||||
of this JN516X SDK.
|
||||
`examples/jn516x/rpl/coap-dr1199-node.c` shows an example on using this contiki driver.
|
||||
leds-arch.c implements the led driver for leds D3 and D6 on the DR1174 base-board and the DR1199 board.
|
||||
|
@ -11,7 +11,7 @@ Mapping of LEDs on JN516x DR1199/DR1174:
|
|||
leds.h: led on DR1174:
|
||||
DR1174+DR1199:
|
||||
leds.h physical leds
|
||||
LEDS_GREEN LED D1 on DR1199
|
||||
LEDS_GREEN LED D1 on DR1199
|
||||
LEDS_BLUE LED D2 on DR1199
|
||||
LEDS_RED LED D3 on DR1199
|
||||
LEDS_GP0 LED D3 on DR1174
|
||||
|
|
|
@ -42,5 +42,5 @@ CURSES_LIBS ?= -lncurses
|
|||
|
||||
TARGET_LIBFILES += $(CURSES_LIBS)
|
||||
|
||||
MODULES+=core/net core/net/mac core/net/mac/framer core/net/ip64-addr/ \
|
||||
core/net/mac/csma core/net/mac/nullmac
|
||||
MODULES+=os/net os/net/mac os/net/mac/framer os/net/ip64-addr/ \
|
||||
os/net/mac/csma os/net/mac/nullmac
|
||||
|
|
|
@ -28,5 +28,5 @@ SMALL ?= 0
|
|||
CONTIKI_CPU=$(CONTIKI)/arch/cpu/nrf52832
|
||||
include $(CONTIKI_CPU)/Makefile.nrf52832
|
||||
|
||||
MODULES += core/net core/net/mac core/net/mac/framer \
|
||||
core/net/mac/csma core/net/mac/nullmac
|
||||
MODULES += os/net os/net/mac os/net/mac/framer \
|
||||
os/net/mac/csma os/net/mac/nullmac
|
||||
|
|
|
@ -26,8 +26,9 @@ CLEAN += *.openmote-cc2538
|
|||
CONTIKI_CPU=$(CONTIKI)/arch/cpu/cc2538
|
||||
include $(CONTIKI_CPU)/Makefile.cc2538
|
||||
|
||||
MODULES += core/net core/net/mac core/net/mac/framer \
|
||||
core/net/mac/csma core/net/mac/nullmac
|
||||
MODULES += os/net os/net/mac os/net/mac/framer \
|
||||
os/net/mac/csma os/net/mac/nullmac \
|
||||
os/storage/cfs
|
||||
|
||||
PYTHON = python
|
||||
BSL_FLAGS += -e --bootloader-invert-lines -w -v -b 450000
|
||||
|
|
|
@ -6,6 +6,7 @@ CONTIKI_TARGET_SOURCEFILES += contiki-sky-platform.c \
|
|||
|
||||
include $(CONTIKI)/arch/platform/sky/Makefile.common
|
||||
|
||||
MODULES += core/net/mac core/net/mac/framer core/net \
|
||||
core/net/mac/csma core/net/mac/nullmac \
|
||||
arch/dev/cc2420 arch/dev/sht11 arch/dev/ds2411
|
||||
MODULES += os/net/mac os/net/mac/framer os/net \
|
||||
os/net/mac/csma os/net/mac/nullmac \
|
||||
arch/dev/cc2420 arch/dev/sht11 arch/dev/ds2411 \
|
||||
os/storage/cfs
|
||||
|
|
|
@ -24,8 +24,8 @@ in cpu/msp430/dev/uart1.c or platform/sky/slip_uart1.c, depending on
|
|||
weather or not the Tmote Sky is running TCP/IP or not.
|
||||
|
||||
There are currently two CC2420 drivers in the Contiki source code,
|
||||
core/dev/simple-cc2420.c (a really simple CC2420 driver) and
|
||||
core/dev/cc2420.c (a more feature-rich CC2420 driver).
|
||||
os/dev/simple-cc2420.c (a really simple CC2420 driver) and
|
||||
os/dev/cc2420.c (a more feature-rich CC2420 driver).
|
||||
|
||||
More information about the Tmote Sky, including data sheets, can be
|
||||
found at Moteiv's web site: http://www.moteiv.com
|
||||
|
|
|
@ -32,5 +32,5 @@ SMALL ?= 0
|
|||
CONTIKI_CPU=$(CONTIKI)/arch/cpu/cc26xx-cc13xx
|
||||
include $(CONTIKI_CPU)/Makefile.$(CPU_FAMILY)
|
||||
|
||||
MODULES += core/net core/net/mac core/net/mac/framer \
|
||||
core/net/mac/csma core/net/mac/nullmac
|
||||
MODULES += os/net os/net/mac os/net/mac/framer \
|
||||
os/net/mac/csma os/net/mac/nullmac
|
||||
|
|
|
@ -45,12 +45,13 @@ CLEAN += *.zoul
|
|||
CONTIKI_CPU=$(CONTIKI)/arch/cpu/cc2538
|
||||
include $(CONTIKI_CPU)/Makefile.cc2538
|
||||
|
||||
MODULES += core/net core/net/mac core/net/mac/framer \
|
||||
core/net/mac/csma core/net/mac/nullmac \
|
||||
arch/dev/cc1200
|
||||
MODULES += os/net os/net/mac os/net/mac/framer \
|
||||
os/net/mac/csma os/net/mac/nullmac \
|
||||
arch/dev/cc1200 \
|
||||
os/storage/cfs
|
||||
|
||||
ifeq ($(WITH_IP64),1)
|
||||
MODULES += core/net/ip64
|
||||
MODULES += os/net/ip64
|
||||
endif
|
||||
|
||||
BSL = $(CONTIKI)/tools/cc2538-bsl/cc2538-bsl.py
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
MOTELIST_ZOLERTIA = remote
|
||||
BOARD_SOURCEFILES += board.c antenna-sw.c mmc-arch.c rtcc.c power-mgmt.c leds-arch.c
|
||||
|
||||
MODULES += core/lib/fs/fat core/lib/fs/fat/option arch/platform/zoul/fs/fat arch/dev/disk/mmc
|
||||
MODULES += os/lib/fs/fat os/lib/fs/fat/option arch/platform/zoul/fs/fat arch/dev/disk/mmc
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
MOTELIST_ZOLERTIA = remote
|
||||
BOARD_SOURCEFILES += board.c antenna-sw.c mmc-arch.c rtcc.c leds-res-arch.c power-mgmt.c
|
||||
|
||||
MODULES += core/lib/fs/fat core/lib/fs/fat/option arch/platform/zoul/fs/fat arch/dev/disk/mmc
|
||||
MODULES += os/lib/fs/fat os/lib/fs/fat/option arch/platform/zoul/fs/fat arch/dev/disk/mmc
|
||||
|
|
|
@ -1,140 +0,0 @@
|
|||
/*
|
||||
* Copyright (c) 2004, Swedish Institute of Computer Science.
|
||||
* All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions
|
||||
* are met:
|
||||
* 1. Redistributions of source code must retain the above copyright
|
||||
* notice, this list of conditions and the following disclaimer.
|
||||
* 2. Redistributions in binary form must reproduce the above copyright
|
||||
* notice, this list of conditions and the following disclaimer in the
|
||||
* documentation and/or other materials provided with the distribution.
|
||||
* 3. Neither the name of the Institute nor the names of its contributors
|
||||
* may be used to endorse or promote products derived from this software
|
||||
* without specific prior written permission.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE INSTITUTE AND CONTRIBUTORS ``AS IS'' AND
|
||||
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
||||
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
||||
* ARE DISCLAIMED. IN NO EVENT SHALL THE INSTITUTE OR CONTRIBUTORS BE LIABLE
|
||||
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
|
||||
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
|
||||
* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
|
||||
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
|
||||
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
|
||||
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
||||
* SUCH DAMAGE.
|
||||
*
|
||||
* This file is part of the Contiki operating system.
|
||||
*
|
||||
* Author: Adam Dunkels <adam@sics.se>
|
||||
*
|
||||
*/
|
||||
|
||||
#include "cfs/cfs.h"
|
||||
#include "dev/eeprom.h"
|
||||
|
||||
struct filestate {
|
||||
int flag;
|
||||
#define FLAG_FILE_CLOSED 0
|
||||
#define FLAG_FILE_OPEN 1
|
||||
eeprom_addr_t fileptr;
|
||||
eeprom_addr_t filesize;
|
||||
};
|
||||
|
||||
static struct filestate file;
|
||||
|
||||
#ifdef CFS_EEPROM_CONF_OFFSET
|
||||
#define CFS_EEPROM_OFFSET CFS_EEPROM_CONF_OFFSET
|
||||
#else
|
||||
#define CFS_EEPROM_OFFSET 0
|
||||
#endif
|
||||
|
||||
/*---------------------------------------------------------------------------*/
|
||||
int
|
||||
cfs_open(const char *n, int f)
|
||||
{
|
||||
if(file.flag == FLAG_FILE_CLOSED) {
|
||||
file.flag = FLAG_FILE_OPEN;
|
||||
if(f & CFS_READ) {
|
||||
file.fileptr = 0;
|
||||
}
|
||||
if(f & CFS_WRITE){
|
||||
if(f & CFS_APPEND) {
|
||||
file.fileptr = file.filesize;
|
||||
} else {
|
||||
file.fileptr = 0;
|
||||
file.filesize = 0;
|
||||
}
|
||||
}
|
||||
return 1;
|
||||
} else {
|
||||
return -1;
|
||||
}
|
||||
}
|
||||
/*---------------------------------------------------------------------------*/
|
||||
void
|
||||
cfs_close(int f)
|
||||
{
|
||||
file.flag = FLAG_FILE_CLOSED;
|
||||
}
|
||||
/*---------------------------------------------------------------------------*/
|
||||
int
|
||||
cfs_read(int f, void *buf, unsigned int len)
|
||||
{
|
||||
if(f == 1) {
|
||||
eeprom_read(CFS_EEPROM_OFFSET + file.fileptr, buf, len);
|
||||
file.fileptr += len;
|
||||
return len;
|
||||
} else {
|
||||
return -1;
|
||||
}
|
||||
}
|
||||
/*---------------------------------------------------------------------------*/
|
||||
int
|
||||
cfs_write(int f, const void *buf, unsigned int len)
|
||||
{
|
||||
if(f == 1) {
|
||||
eeprom_write(CFS_EEPROM_OFFSET + file.fileptr, (unsigned char *)buf, len);
|
||||
file.fileptr += len;
|
||||
return len;
|
||||
} else {
|
||||
return -1;
|
||||
}
|
||||
}
|
||||
/*---------------------------------------------------------------------------*/
|
||||
cfs_offset_t
|
||||
cfs_seek(int f, cfs_offset_t o, int w)
|
||||
{
|
||||
if(w == CFS_SEEK_SET && f == 1) {
|
||||
file.fileptr = o;
|
||||
return o;
|
||||
} else {
|
||||
return -1;
|
||||
}
|
||||
}
|
||||
/*---------------------------------------------------------------------------*/
|
||||
int
|
||||
cfs_remove(const char *name)
|
||||
{
|
||||
return -1;
|
||||
}
|
||||
/*---------------------------------------------------------------------------*/
|
||||
int
|
||||
cfs_opendir(struct cfs_dir *p, const char *n)
|
||||
{
|
||||
return -1;
|
||||
}
|
||||
/*---------------------------------------------------------------------------*/
|
||||
int
|
||||
cfs_readdir(struct cfs_dir *p, struct cfs_dirent *e)
|
||||
{
|
||||
return -1;
|
||||
}
|
||||
/*---------------------------------------------------------------------------*/
|
||||
void
|
||||
cfs_closedir(struct cfs_dir *p)
|
||||
{
|
||||
}
|
||||
/*---------------------------------------------------------------------------*/
|
|
@ -1,164 +0,0 @@
|
|||
/*
|
||||
* Copyright (c) 2004, Swedish Institute of Computer Science.
|
||||
* All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions
|
||||
* are met:
|
||||
* 1. Redistributions of source code must retain the above copyright
|
||||
* notice, this list of conditions and the following disclaimer.
|
||||
* 2. Redistributions in binary form must reproduce the above copyright
|
||||
* notice, this list of conditions and the following disclaimer in the
|
||||
* documentation and/or other materials provided with the distribution.
|
||||
* 3. Neither the name of the Institute nor the names of its contributors
|
||||
* may be used to endorse or promote products derived from this software
|
||||
* without specific prior written permission.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE INSTITUTE AND CONTRIBUTORS ``AS IS'' AND
|
||||
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
||||
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
||||
* ARE DISCLAIMED. IN NO EVENT SHALL THE INSTITUTE OR CONTRIBUTORS BE LIABLE
|
||||
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
|
||||
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
|
||||
* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
|
||||
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
|
||||
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
|
||||
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
||||
* SUCH DAMAGE.
|
||||
*
|
||||
* This file is part of the Contiki operating system.
|
||||
*
|
||||
* Author: Adam Dunkels <adam@sics.se>
|
||||
*
|
||||
*/
|
||||
|
||||
#include <string.h>
|
||||
|
||||
#include "cfs/cfs.h"
|
||||
|
||||
struct filestate {
|
||||
int flag;
|
||||
#define FLAG_FILE_CLOSED 0
|
||||
#define FLAG_FILE_OPEN 1
|
||||
int fileptr;
|
||||
int filesize;
|
||||
};
|
||||
|
||||
#ifdef CFS_RAM_CONF_SIZE
|
||||
#define CFS_RAM_SIZE CFS_RAM_CONF_SIZE
|
||||
#else
|
||||
#define CFS_RAM_SIZE 4096
|
||||
#endif
|
||||
|
||||
static struct filestate file;
|
||||
static char filemem[CFS_RAM_SIZE];
|
||||
|
||||
/*---------------------------------------------------------------------------*/
|
||||
int
|
||||
cfs_open(const char *n, int f)
|
||||
{
|
||||
if(file.flag == FLAG_FILE_CLOSED) {
|
||||
file.flag = FLAG_FILE_OPEN;
|
||||
if(f & CFS_READ) {
|
||||
file.fileptr = 0;
|
||||
}
|
||||
if(f & CFS_WRITE){
|
||||
if(f & CFS_APPEND) {
|
||||
file.fileptr = file.filesize;
|
||||
} else {
|
||||
file.fileptr = 0;
|
||||
file.filesize = 0;
|
||||
}
|
||||
}
|
||||
return 1;
|
||||
} else {
|
||||
return -1;
|
||||
}
|
||||
}
|
||||
/*---------------------------------------------------------------------------*/
|
||||
void
|
||||
cfs_close(int f)
|
||||
{
|
||||
file.flag = FLAG_FILE_CLOSED;
|
||||
}
|
||||
/*---------------------------------------------------------------------------*/
|
||||
int
|
||||
cfs_read(int f, void *buf, unsigned int len)
|
||||
{
|
||||
if(file.fileptr + len > sizeof(filemem)) {
|
||||
len = sizeof(filemem) - file.fileptr;
|
||||
}
|
||||
|
||||
if(file.fileptr + len > file.filesize) {
|
||||
len = file.filesize - file.fileptr;
|
||||
}
|
||||
|
||||
if(f == 1) {
|
||||
memcpy(buf, &filemem[file.fileptr], len);
|
||||
file.fileptr += len;
|
||||
return len;
|
||||
} else {
|
||||
return -1;
|
||||
}
|
||||
}
|
||||
/*---------------------------------------------------------------------------*/
|
||||
int
|
||||
cfs_write(int f, const void *buf, unsigned int len)
|
||||
{
|
||||
if(file.fileptr >= sizeof(filemem)) {
|
||||
return 0;
|
||||
}
|
||||
if(file.fileptr + len > sizeof(filemem)) {
|
||||
len = sizeof(filemem) - file.fileptr;
|
||||
}
|
||||
|
||||
if(file.fileptr + len > file.filesize) {
|
||||
/* Extend the size of the file. */
|
||||
file.filesize = file.fileptr + len;
|
||||
}
|
||||
|
||||
if(f == 1) {
|
||||
memcpy(&filemem[file.fileptr], buf, len);
|
||||
file.fileptr += len;
|
||||
return len;
|
||||
} else {
|
||||
return -1;
|
||||
}
|
||||
}
|
||||
/*---------------------------------------------------------------------------*/
|
||||
cfs_offset_t
|
||||
cfs_seek(int f, cfs_offset_t o, int w)
|
||||
{
|
||||
if(w == CFS_SEEK_SET && f == 1) {
|
||||
if(o > file.filesize) {
|
||||
o = file.filesize;
|
||||
}
|
||||
file.fileptr = o;
|
||||
return o;
|
||||
}
|
||||
return (cfs_offset_t)-1;
|
||||
}
|
||||
/*---------------------------------------------------------------------------*/
|
||||
int
|
||||
cfs_remove(const char *name)
|
||||
{
|
||||
return -1;
|
||||
}
|
||||
/*---------------------------------------------------------------------------*/
|
||||
int
|
||||
cfs_opendir(struct cfs_dir *p, const char *n)
|
||||
{
|
||||
return -1;
|
||||
}
|
||||
/*---------------------------------------------------------------------------*/
|
||||
int
|
||||
cfs_readdir(struct cfs_dir *p, struct cfs_dirent *e)
|
||||
{
|
||||
return -1;
|
||||
}
|
||||
/*---------------------------------------------------------------------------*/
|
||||
void
|
||||
cfs_closedir(struct cfs_dir *p)
|
||||
{
|
||||
}
|
||||
/*---------------------------------------------------------------------------*/
|
|
@ -1,174 +0,0 @@
|
|||
/*
|
||||
* Copyright (c) 2004, Swedish Institute of Computer Science.
|
||||
* All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions
|
||||
* are met:
|
||||
* 1. Redistributions of source code must retain the above copyright
|
||||
* notice, this list of conditions and the following disclaimer.
|
||||
* 2. Redistributions in binary form must reproduce the above copyright
|
||||
* notice, this list of conditions and the following disclaimer in the
|
||||
* documentation and/or other materials provided with the distribution.
|
||||
* 3. Neither the name of the Institute nor the names of its contributors
|
||||
* may be used to endorse or promote products derived from this software
|
||||
* without specific prior written permission.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE INSTITUTE AND CONTRIBUTORS ``AS IS'' AND
|
||||
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
||||
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
||||
* ARE DISCLAIMED. IN NO EVENT SHALL THE INSTITUTE OR CONTRIBUTORS BE LIABLE
|
||||
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
|
||||
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
|
||||
* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
|
||||
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
|
||||
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
|
||||
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
||||
* SUCH DAMAGE.
|
||||
*
|
||||
* This file is part of the Contiki operating system.
|
||||
*
|
||||
* Author: Adam Dunkels <adam@sics.se>
|
||||
*
|
||||
*/
|
||||
|
||||
#include "cfs/cfs.h"
|
||||
#include "dev/xmem.h"
|
||||
|
||||
struct filestate {
|
||||
int flag;
|
||||
#define FLAG_FILE_CLOSED 0
|
||||
#define FLAG_FILE_OPEN 1
|
||||
unsigned int fileptr;
|
||||
unsigned int filesize;
|
||||
};
|
||||
|
||||
#ifdef CFS_XMEM_CONF_OFFSET
|
||||
#define CFS_XMEM_OFFSET CFS_XMEM_CONF_OFFSET
|
||||
#else
|
||||
#define CFS_XMEM_OFFSET 0
|
||||
#endif
|
||||
|
||||
/* Note the CFS_XMEM_CONF_SIZE must be a tuple of XMEM_ERASE_UNIT_SIZE */
|
||||
#ifdef CFS_XMEM_CONF_SIZE
|
||||
#define CFS_XMEM_SIZE CFS_XMEM_CONF_SIZE
|
||||
#else
|
||||
#define CFS_XMEM_SIZE XMEM_ERASE_UNIT_SIZE
|
||||
#endif
|
||||
|
||||
static struct filestate file;
|
||||
|
||||
/*---------------------------------------------------------------------------*/
|
||||
int
|
||||
cfs_open(const char *n, int f)
|
||||
{
|
||||
if(file.flag == FLAG_FILE_CLOSED) {
|
||||
file.flag = FLAG_FILE_OPEN;
|
||||
if(f & CFS_READ) {
|
||||
file.fileptr = 0;
|
||||
}
|
||||
if(f & CFS_WRITE){
|
||||
if(f & CFS_APPEND) {
|
||||
file.fileptr = file.filesize;
|
||||
} else {
|
||||
file.fileptr = 0;
|
||||
file.filesize = 0;
|
||||
xmem_erase(CFS_XMEM_SIZE, CFS_XMEM_OFFSET);
|
||||
}
|
||||
}
|
||||
return 1;
|
||||
} else {
|
||||
return -1;
|
||||
}
|
||||
}
|
||||
/*---------------------------------------------------------------------------*/
|
||||
void
|
||||
cfs_close(int f)
|
||||
{
|
||||
file.flag = FLAG_FILE_CLOSED;
|
||||
}
|
||||
/*---------------------------------------------------------------------------*/
|
||||
int
|
||||
cfs_read(int f, void *buf, unsigned int len)
|
||||
{
|
||||
if(file.fileptr + len > CFS_XMEM_SIZE) {
|
||||
len = CFS_XMEM_SIZE - file.fileptr;
|
||||
}
|
||||
|
||||
if(file.fileptr + len > file.filesize) {
|
||||
len = file.filesize - file.fileptr;
|
||||
}
|
||||
|
||||
if(f == 1) {
|
||||
xmem_pread(buf, len, CFS_XMEM_OFFSET + file.fileptr);
|
||||
file.fileptr += len;
|
||||
return len;
|
||||
} else {
|
||||
return -1;
|
||||
}
|
||||
}
|
||||
/*---------------------------------------------------------------------------*/
|
||||
int
|
||||
cfs_write(int f, const void *buf, unsigned int len)
|
||||
{
|
||||
if(file.fileptr >= CFS_XMEM_SIZE) {
|
||||
return 0;
|
||||
}
|
||||
if(file.fileptr + len > CFS_XMEM_SIZE) {
|
||||
len = CFS_XMEM_SIZE - file.fileptr;
|
||||
}
|
||||
|
||||
if(file.fileptr + len > file.filesize) {
|
||||
/* Extend the size of the file. */
|
||||
file.filesize = file.fileptr + len;
|
||||
}
|
||||
|
||||
if(f == 1) {
|
||||
xmem_pwrite(buf, len, CFS_XMEM_OFFSET + file.fileptr);
|
||||
file.fileptr += len;
|
||||
return len;
|
||||
} else {
|
||||
return -1;
|
||||
}
|
||||
}
|
||||
/*---------------------------------------------------------------------------*/
|
||||
cfs_offset_t
|
||||
cfs_seek(int f, cfs_offset_t o, int w)
|
||||
{
|
||||
if(w == CFS_SEEK_SET && f == 1) {
|
||||
if(o > file.filesize) {
|
||||
o = file.filesize;
|
||||
}
|
||||
file.fileptr = o;
|
||||
return o;
|
||||
}
|
||||
return -1;
|
||||
}
|
||||
/*---------------------------------------------------------------------------*/
|
||||
int
|
||||
cfs_remove(const char *name)
|
||||
{
|
||||
file.flag = FLAG_FILE_CLOSED;
|
||||
file.fileptr = 0;
|
||||
file.filesize = 0;
|
||||
xmem_erase(CFS_XMEM_SIZE, CFS_XMEM_OFFSET);
|
||||
return 0;
|
||||
}
|
||||
/*---------------------------------------------------------------------------*/
|
||||
int
|
||||
cfs_opendir(struct cfs_dir *p, const char *n)
|
||||
{
|
||||
return -1;
|
||||
}
|
||||
/*---------------------------------------------------------------------------*/
|
||||
int
|
||||
cfs_readdir(struct cfs_dir *p, struct cfs_dirent *e)
|
||||
{
|
||||
return -1;
|
||||
}
|
||||
/*---------------------------------------------------------------------------*/
|
||||
void
|
||||
cfs_closedir(struct cfs_dir *p)
|
||||
{
|
||||
}
|
||||
/*---------------------------------------------------------------------------*/
|
|
@ -1,4 +1,4 @@
|
|||
basedirs := core arch/cpu arch/platform apps
|
||||
basedirs := os arch/cpu arch/platform
|
||||
manuals := $(shell find ./ -name "*.txt")
|
||||
filetypes := -iwholename "*/doc/*.txt"
|
||||
empty :=
|
||||
|
|
|
@ -44,24 +44,23 @@
|
|||
microcontroller architecture used on the platform for which Contiki
|
||||
is built): rules for the CPU architecture, located in the CPU
|
||||
architecture's subdirectory in the cpu/ directory.
|
||||
- <tt>Makefile.\$(APP)</tt> (where \$(APP) is the name of an
|
||||
application in the apps/ directory): rules for applications in the
|
||||
apps/ directories. Each application has its own makefile.
|
||||
- <tt>Makefile.\$(MODULE)</tt> (where \$(MODULE) is the name of a
|
||||
module in the Contiki directory): rules for modules in the
|
||||
Contiki directories. Each module might have its own optional makefile.
|
||||
|
||||
The Makefile in the project's directory is intentionally simple. It
|
||||
specifies where the Contiki source code resides in the system and
|
||||
includes the system-wide Makefile, <tt>Makefile.include</tt>. The
|
||||
project's makefile can also define in the <tt>APPS</tt> variable a
|
||||
list of applications from the apps/ directory that should be included
|
||||
in the Contiki system. The Makefile used in the hello-world example
|
||||
project looks like this:
|
||||
project's makefile can also define in the <tt>MODULES</tt> variable a
|
||||
list of modules that should be included in the Contiki system.
|
||||
The Makefile used in the hello-world example project looks like this:
|
||||
|
||||
\code
|
||||
CONTIKI = ../..
|
||||
all: hello-world
|
||||
include $(CONTIKI)/Makefile.include
|
||||
\endcode
|
||||
|
||||
|
||||
First, the location of the Contiki source code tree is given by
|
||||
defining the <tt>CONTIKI</tt> variable. Next, the name of the
|
||||
application is defined. Finally, the system-wide
|
||||
|
@ -71,7 +70,7 @@ include $(CONTIKI)/Makefile.include
|
|||
the core Contiki system. <tt>Makefile.include</tt> always reside in
|
||||
the root of the Contiki source tree. When <tt>make</tt> is run,
|
||||
<tt>Makefile.include</tt> includes the <tt>Makefile.\$(TARGET)</tt>
|
||||
as well as all makefiles for the applications in the <tt>APPS</tt>
|
||||
as well as all makefiles for the modules in the <tt>MODULES</tt>
|
||||
list (which is specified by the project's <tt>Makefile</tt>).
|
||||
|
||||
<tt>Makefile.\$(TARGET)</tt>, which is located in the
|
||||
|
@ -86,11 +85,10 @@ include $(CONTIKI)/Makefile.include
|
|||
used, the <tt>Makefile.\$(CPU)</tt> can either contain a conditional
|
||||
expression that allows different C compilers to be defined, or it can
|
||||
be completely overridden by the platform specific makefile
|
||||
<tt>Makefile.\$(TARGET)</tt>.
|
||||
<tt>Makefile.\$(TARGET)</tt>.
|
||||
@{
|
||||
*/
|
||||
|
||||
/**
|
||||
@}
|
||||
*/
|
||||
|
||||
|
|
|
@ -33,7 +33,7 @@ as well as instructions to run more advanced demos.
|
|||
|
||||
To run the demo, you will need at least
|
||||
\li one AVR RAVEN board, which embeds an ATmega1284P and an
|
||||
ATmega3290P micro controller (MCU) as well as an AT86RF230
|
||||
ATmega3290P micro controller (MCU) as well as an AT86RF230
|
||||
802.15.4 radio chip.
|
||||
\li one RZ USB stick, which embeds an AT90USB1287 MCU and
|
||||
an AT86RF230 802.15.4 radio chip.
|
||||
|
@ -48,7 +48,7 @@ mkII.
|
|||
<HR>
|
||||
\section software Software requirements
|
||||
To install the demo you need:
|
||||
\li Contiki 2.3 or later source code, installed in a directory. In
|
||||
\li Contiki 2.3 or later source code, installed in a directory. In
|
||||
the rest of this tutorial we assume the directory is c:/contiki
|
||||
\li Cygwin with "make" utility installed.
|
||||
\li AVR Studio 4.14 or later
|
||||
|
@ -115,13 +115,13 @@ make
|
|||
|
||||
\subsection installation_hw Installing the hardware
|
||||
To power the RAVEN, put the EXT/BAT jumper in BAT position.
|
||||
This will enable power on batteries. If you want to power
|
||||
the RAVEN externally, check instructions in
|
||||
This will enable power on batteries. If you want to power
|
||||
the RAVEN externally, check instructions in
|
||||
\ref advanced_externalboard.
|
||||
|
||||
The RZ USB Stick needs to be plugged in the PC you will run
|
||||
The RZ USB Stick needs to be plugged in the PC you will run
|
||||
the demo on. If you plan to run the demo on a Windows PC, you
|
||||
will need to install drivers once contiki is loaded on the
|
||||
will need to install drivers once contiki is loaded on the
|
||||
stick. Until then, you can exit any driver installation popup.
|
||||
|
||||
\subsection installation_loading Programming the boards
|
||||
|
@ -131,16 +131,16 @@ stick. Until then, you can exit any driver installation popup.
|
|||
\li On the RZ USB Stick, load the binary on the AT90USB1287
|
||||
|
||||
<b>Hardware connections</b><br>
|
||||
\li Connect the JTAG connectors to the JTAGICE as described in
|
||||
\li Connect the JTAG connectors to the JTAGICE as described in
|
||||
the picture below.
|
||||
|
||||
\image html tutorial-raven-jtag.jpg
|
||||
\li Connect the JTAGICE mkII to a Windows PC through USB.
|
||||
\li To program (load) each AVR, you will need to connect the
|
||||
JTAGICE JTAG connector to the JTAG pins corresponding to the
|
||||
\li To program (load) each AVR, you will need to connect the
|
||||
JTAGICE JTAG connector to the JTAG pins corresponding to the
|
||||
AVR you want to program, as shown in the picture below.
|
||||
|
||||
\image html tutorial-raven-connections.jpg
|
||||
\image html tutorial-raven-connections.jpg
|
||||
|
||||
|
||||
<b>To load the binary on each AVR in Windows</b><br>
|
||||
|
@ -177,8 +177,8 @@ Note this programmed the fuses, EEPROM, and FLASH all at once.
|
|||
Plug the RZ USB Stick in the PC. It should appear as a USB
|
||||
network interface (e.g. usb0).
|
||||
|
||||
usb0 should automatically get an IPv6 link local address, i.e.
|
||||
fe80::0012:13ff:fe14:1516/64. Check this is the case by typing
|
||||
usb0 should automatically get an IPv6 link local address, i.e.
|
||||
fe80::0012:13ff:fe14:1516/64. Check this is the case by typing
|
||||
\verbatim
|
||||
ifconfig
|
||||
\endverbatim
|
||||
|
@ -214,8 +214,8 @@ interface usb0
|
|||
{
|
||||
AdvOnLink on;
|
||||
AdvAutonomous on;
|
||||
AdvPreferredLifetime 4294967295;
|
||||
AdvValidLifetime 4294967295;
|
||||
AdvPreferredLifetime 4294967295;
|
||||
AdvValidLifetime 4294967295;
|
||||
};
|
||||
};
|
||||
\endverbatim
|
||||
|
@ -240,14 +240,14 @@ Plug the RZ USB Stick in the PC. A "new hardware installation"
|
|||
window should pop up. If it does not, go to "Control Panel"->
|
||||
"Add Hardware". Choose "Install the driver manually", then
|
||||
select the search path C:\\contiki\\cpu\\avr\\dev\\usb\\INF. Finish
|
||||
the installation.
|
||||
the installation.
|
||||
|
||||
You now need to get the "interface index" of the USB Stick
|
||||
interface (noted [interface index] in the following) and the
|
||||
Ethernet interface (noted [ethernet interface index] in the
|
||||
You now need to get the "interface index" of the USB Stick
|
||||
interface (noted [interface index] in the following) and the
|
||||
Ethernet interface (noted [ethernet interface index] in the
|
||||
following).
|
||||
|
||||
In a DOS or Cygwin shell, type
|
||||
In a DOS or Cygwin shell, type
|
||||
\verbatim
|
||||
ipv6 if
|
||||
\endverbatim
|
||||
|
@ -292,8 +292,8 @@ ipv6 rtu aaaa::/64 [interface index] publish
|
|||
\subsection running_raven Booting the RAVEN boards
|
||||
|
||||
Reboot the RAVEN board.
|
||||
The PC sends router advertisements and the RAVEN Board configures
|
||||
an IPv6 global address based on them. The PC global addresses
|
||||
The PC sends router advertisements and the RAVEN Board configures
|
||||
an IPv6 global address based on them. The PC global addresses
|
||||
were set above. Communication is ready.
|
||||
|
||||
\subsection running_ping1 Pinging the RAVEN board from the router
|
||||
|
@ -349,7 +349,7 @@ with parity 8N1, no flow control
|
|||
\li The raven board will output debug messages to the terminal
|
||||
|
||||
\note To enable specific debugging messages, edit the source
|
||||
file you are interested in (e.g. core/net/uip-nd6-io.c for
|
||||
file you are interested in (e.g. os/net/uip-nd6-io.c for
|
||||
Neighbor Discovery messages debug) and set the macro DEBUG to 1.
|
||||
Then recompile the code, load the new binary on the board and
|
||||
restart the RAVEN.
|
||||
|
@ -386,9 +386,9 @@ Read the section below to change the MAC address on one device.
|
|||
|
||||
\subsection advanced_eeprom Change a device MAC address
|
||||
|
||||
You can change the MAC address of a RAVEN board or the RZ USB
|
||||
Stick by setting the 8 first bytes of the EEPROM, following
|
||||
the convention above. You can do this three ways.
|
||||
You can change the MAC address of a RAVEN board or the RZ USB
|
||||
Stick by setting the 8 first bytes of the EEPROM, following
|
||||
the convention above. You can do this three ways.
|
||||
|
||||
The first is to set EEPROM bytes directly in an AVR Studio project, in
|
||||
Debug mode
|
||||
|
@ -402,19 +402,19 @@ the target processor.
|
|||
\li select EEPROM in the menu, then just type in the first 8 bytes
|
||||
the target MAC address
|
||||
|
||||
The second is to reprogram the whole EEPROM individually from the
|
||||
The second is to reprogram the whole EEPROM individually from the
|
||||
Flash and Fuses.
|
||||
|
||||
\li Connect the JTAG pins of the JTAGICE into the JTAG connector of
|
||||
the target processor.
|
||||
\li In AVR Studio, click on "Tools"->"Program AVR"->"Auto Connect"
|
||||
\li Go to the "Program" tab
|
||||
\li In the "EEPROM" section, click on "Read" and save the EEPROM
|
||||
\li In the "EEPROM" section, click on "Read" and save the EEPROM
|
||||
content in a file (in hex format)
|
||||
\li Edit this file with a text editor, change the value of the
|
||||
\li Edit this file with a text editor, change the value of the
|
||||
first 8 bytes, save
|
||||
\li In the "EEPROM" section, check the path to the "Input Hex file"
|
||||
is the one to the file you just modified and click on "Program".
|
||||
is the one to the file you just modified and click on "Program".
|
||||
|
||||
The third is to modify the default value in the code:
|
||||
|
||||
|
@ -474,7 +474,7 @@ with
|
|||
#define SICSLOWPAN_CONF_COMPRESSION SICSLOWPAN_COMPRESSION_IPHC
|
||||
\endcode
|
||||
|
||||
Recompile and load Contiki for both the RAVEN ATmega1284P and RZ USB
|
||||
Recompile and load Contiki for both the RAVEN ATmega1284P and RZ USB
|
||||
Stick.
|
||||
|
||||
If you capture packets being sent over the air (on the 802.15.4
|
||||
|
@ -515,7 +515,7 @@ ip -6 address add fe80::0012:13ff:fe14:1516/64 scope link dev usb0
|
|||
\endverbatim
|
||||
|
||||
<b>make version issues</b><br>
|
||||
You need to use the "make" executable from WinAVR. There
|
||||
You need to use the "make" executable from WinAVR. There
|
||||
are compilation issues with GNU make coming with Cygwin.
|
||||
|
||||
<HR>
|
||||
|
@ -527,7 +527,7 @@ are compilation issues with GNU make coming with Cygwin.
|
|||
\li User interface on Raven:\ref lcdraven
|
||||
\li Wireless libraries for Atmel Radio: \ref wireless
|
||||
\li MAC for Atmel Radio: \ref macdoc
|
||||
\li IPv6 Implementation: \ref uip6
|
||||
\li IPv6 Implementation: \ref uip6
|
||||
\li 6lowpan Implementation: \ref sicslowpan
|
||||
|
||||
\subsection annex_hardware Annex - Atmel products detailed documentation
|
||||
|
@ -560,22 +560,22 @@ http://www.atmel.com/dyn/products/tools_card.asp?tool_id=3353
|
|||
<b>Buying the hardware (part number ATAVRRZRAVEN and ATJTAGICE2)</b><br>
|
||||
\li For the U.S. you can use http://www.atmel.com/contacts/distributor_check.asp
|
||||
\li Digikey http://www.digikey.com/
|
||||
\li Spoerle http://www.spoerle.com/en/products
|
||||
\li Spoerle http://www.spoerle.com/en/products
|
||||
\li Lawicel http://www.lawicel-shop.se
|
||||
|
||||
|
||||
\subsection annex_software Software setup details
|
||||
<b>Contiki</b><br>
|
||||
Download Contiki code from http://www.sics.se/contiki and
|
||||
extract the source code. We assume the directory you extract
|
||||
extract the source code. We assume the directory you extract
|
||||
to is c:/contiki.
|
||||
|
||||
<b>Cygwin</b><br>
|
||||
\li Download Cygwin from http://www.cygwin.com
|
||||
\li Launch the setup executable
|
||||
\li Follow the instructions until you reach the Window "Cygwin
|
||||
\li Follow the instructions until you reach the Window "Cygwin
|
||||
Setup - Select Packages"
|
||||
\li In this window, expand the "Devel" item and
|
||||
\li In this window, expand the "Devel" item and
|
||||
|
||||
<b>AVR Studio</b><br>
|
||||
Download and install AVR Studio from
|
||||
|
@ -586,7 +586,7 @@ WinAVR which contains a number of AVR tools
|
|||
such as the avr-gcc compiler.
|
||||
|
||||
Download and install WinAVR latest version from
|
||||
http://winavr.sourceforge.net/
|
||||
http://winavr.sourceforge.net/
|
||||
|
||||
<b>JTAGICE mkII Drivers</b><br>
|
||||
Plug the JTAGICE mkII in a USB port of a windows PC. Follow the
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
CONTIKI = ../../../
|
||||
CONTIKI = ../../..
|
||||
|
||||
APPS += antelope unit-test
|
||||
MODULES += os/storage/antelope os/services/unit-test
|
||||
|
||||
all: shell-db
|
||||
|
||||
|
|
|
@ -1,6 +1,8 @@
|
|||
DEFINES+=PROJECT_CONF_H=\"project-conf.h\"
|
||||
CONTIKI = ../..
|
||||
|
||||
MODULES += os/services/unit-test
|
||||
|
||||
all: test-cfs test-coffee example-coffee
|
||||
|
||||
include $(CONTIKI)/Makefile.include
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
all: http-example
|
||||
CONTIKI=../..
|
||||
APPS += http-socket
|
||||
MODULES += os/net/app-layer/http-socket
|
||||
|
||||
CONTIKI_WITH_IPV6 = 1
|
||||
CONTIKI_WITH_RPL_LITE = 0
|
||||
|
|
|
@ -6,10 +6,9 @@ all: $(CONTIKI_PROJECT)
|
|||
|
||||
CFLAGS += -DPROJECT_CONF_H=\"project-conf.h\"
|
||||
|
||||
APPS += rest-engine
|
||||
APPS += er-coap
|
||||
APPS += oma-lwm2m
|
||||
APPS += ipso-objects
|
||||
MODULES += os/net/app-layer/coap
|
||||
MODULES += os/services/lwm2m
|
||||
MODULES += os/services/ipso-objects
|
||||
|
||||
CONTIKI=../..
|
||||
CONTIKI_WITH_IPV6 = 1
|
||||
|
|
|
@ -37,8 +37,8 @@
|
|||
*/
|
||||
|
||||
#include "contiki.h"
|
||||
#include "lwm2m-engine.h"
|
||||
#include "ipso-objects.h"
|
||||
#include "services/lwm2m/lwm2m-engine.h"
|
||||
#include "services/ipso-objects/ipso-objects.h"
|
||||
|
||||
#define DEBUG DEBUG_NONE
|
||||
#include "net/ip/uip-debug.h"
|
||||
|
|
|
@ -35,7 +35,7 @@
|
|||
* Niclas Finne <nfi@sics.se>
|
||||
*/
|
||||
|
||||
#include "ipso-objects.h"
|
||||
#include "services/ipso-objects/ipso-objects.h"
|
||||
#include "lib/random.h"
|
||||
|
||||
static int32_t last_value = 27000;
|
||||
|
|
|
@ -41,8 +41,8 @@
|
|||
#include "rpl.h"
|
||||
#include "rpl-dag-root.h"
|
||||
#include "net/netstack.h"
|
||||
#include "er-coap-constants.h"
|
||||
#include "er-coap-engine.h"
|
||||
#include "coap-constants.h"
|
||||
#include "coap-engine.h"
|
||||
#include "lwm2m-engine.h"
|
||||
#include "oma-tlv.h"
|
||||
#include "dev/serial-line.h"
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
all: er-example-server er-example-client
|
||||
# use target "er-plugtest-server" explicitly when requried
|
||||
all: coap-example-server coap-example-client
|
||||
# use target "plugtest-server" explicitly when required
|
||||
|
||||
CONTIKI=../../..
|
||||
|
||||
|
@ -20,9 +20,8 @@ endif
|
|||
PROJECTDIRS += $(REST_RESOURCES_DIR)
|
||||
PROJECT_SOURCEFILES += $(REST_RESOURCES_FILES)
|
||||
|
||||
# REST Engine shall use Erbium CoAP implementation
|
||||
APPS += er-coap
|
||||
APPS += rest-engine
|
||||
# Include the CoAP implementation
|
||||
MODULES += os/net/app-layer/coap
|
||||
|
||||
# optional rules to get assembly
|
||||
#CUSTOM_RULE_C_TO_OBJECTDIR_O = 1
|
|
@ -4,13 +4,13 @@ A Quick Introduction to the Erbium (Er) REST Engine
|
|||
EXAMPLE FILES
|
||||
-------------
|
||||
|
||||
- er-example-server.c: A RESTful server example showing how to use the REST
|
||||
- coap-example-server.c: A RESTful server example showing how to use the REST
|
||||
layer to develop server-side applications (at the moment only CoAP is
|
||||
implemented for the REST Engine).
|
||||
- er-example-client.c: A CoAP client that polls the /actuators/toggle resource
|
||||
- coap-example-client.c: A CoAP client that polls the /actuators/toggle resource
|
||||
every 10 seconds and cycles through 4 resources on button press (target
|
||||
address is hard-coded).
|
||||
- er-plugtest-server.c: The server used for draft compliance testing at ETSI
|
||||
- plugtest-server.c: The server used for draft compliance testing at ETSI
|
||||
IoT CoAP Plugtests. Erbium (Er) participated in Paris, France, March 2012 and
|
||||
Sophia-Antipolis, France, November 2012 (configured for minimal-net).
|
||||
|
||||
|
@ -66,7 +66,7 @@ TMOTES HOWTO
|
|||
|
||||
1. Connect two Tmote Skys (check with $ make TARGET=sky sky-motelist)
|
||||
|
||||
make TARGET=sky er-example-server.upload MOTE=2
|
||||
make TARGET=sky coap-example-server.upload MOTE=2
|
||||
make TARGET=sky login MOTE=2
|
||||
|
||||
2. Press reset button, get address, abort with Ctrl+C:
|
||||
|
@ -86,21 +86,21 @@ TMOTES HOWTO
|
|||
|
||||
### Add a client:
|
||||
|
||||
1. Change the hard-coded server address in er-example-client.c to fd00::____:____:____:____
|
||||
1. Change the hard-coded server address in coap-example-client.c to fd00::____:____:____:____
|
||||
2. Connect a third Tmote Sky
|
||||
|
||||
make TARGET=sky er-example-client.upload MOTE=3
|
||||
make TARGET=sky coap-example-client.upload MOTE=3
|
||||
|
||||
MINIMAL-NET HOWTO
|
||||
-----------------
|
||||
|
||||
With the target minimal-net you can test your CoAP applications without
|
||||
constraints, i.e., with large buffers, debug output, memory protection, etc.
|
||||
The er-plugtest-server is thought for the minimal-net platform, as it requires
|
||||
The plugtest-server is thought for the minimal-net platform, as it requires
|
||||
an 1280-byte IP buffer and 1024-byte blocks.
|
||||
|
||||
make TARGET=minimal-net er-plugtest-server
|
||||
sudo ./er-plugtest-server.minimal-net
|
||||
make TARGET=minimal-net plugtest-server
|
||||
sudo ./plugtest-server.minimal-net
|
||||
|
||||
Open new terminal
|
||||
|
||||
|
@ -127,11 +127,11 @@ DETAILS
|
|||
-------
|
||||
|
||||
Erbium implements the Proposed Standard of CoAP. Central features are commented
|
||||
in er-example-server.c. In general, apps/er-coap supports:
|
||||
in coap-example-server.c. In general, coap supports:
|
||||
|
||||
- All draft-18 header options
|
||||
- CON Retransmissions (note COAP_MAX_OPEN_TRANSACTIONS)
|
||||
- Blockwise Transfers (note REST_MAX_CHUNK_SIZE, see er-plugtest-server.c for
|
||||
- Blockwise Transfers (note REST_MAX_CHUNK_SIZE, see plugtest-server.c for
|
||||
Block1 uploads)
|
||||
- Separate Responses (no rest_set_pre_handler() required anymore, note
|
||||
coap_separate_accept(), _reject(), and _resume())
|
|
@ -41,7 +41,7 @@
|
|||
#include <string.h>
|
||||
#include "contiki.h"
|
||||
#include "contiki-net.h"
|
||||
#include "er-coap-engine.h"
|
||||
#include "coap-engine.h"
|
||||
#include "dev/button-sensor.h"
|
||||
|
||||
#define DEBUG 0
|
|
@ -41,7 +41,7 @@
|
|||
#include <string.h>
|
||||
#include "contiki.h"
|
||||
#include "contiki-net.h"
|
||||
#include "er-coap-engine.h"
|
||||
#include "coap-engine.h"
|
||||
#include "dev/button-sensor.h"
|
||||
|
||||
/*----------------------------------------------------------------------------*/
|
|
@ -41,11 +41,11 @@
|
|||
#include <string.h>
|
||||
#include "contiki.h"
|
||||
#include "contiki-net.h"
|
||||
#include "er-coap.h"
|
||||
#include "er-coap-transactions.h"
|
||||
#include "er-coap-separate.h"
|
||||
#include "coap.h"
|
||||
#include "coap-transactions.h"
|
||||
#include "coap-separate.h"
|
||||
#include "rest-engine.h"
|
||||
#include "er-plugtest.h"
|
||||
#include "plugtest.h"
|
||||
|
||||
/*
|
||||
* Resources to be activated need to be imported through the extern keyword.
|
|
@ -36,8 +36,8 @@
|
|||
* Matthias Kovatsch <kovatsch@inf.ethz.ch>
|
||||
*/
|
||||
|
||||
#ifndef __ER_PLUGTEST_H__
|
||||
#define __ER_PLUGTEST_H__
|
||||
#ifndef PLUGTEST_H_
|
||||
#define PLUGTEST_H_
|
||||
|
||||
#if !defined(CONTIKI_TARGET_NATIVE)
|
||||
#warning "Should only be compiled for native!"
|
||||
|
@ -63,4 +63,4 @@
|
|||
#define MAX_PLUGFEST_BODY 2048
|
||||
#define CHUNKS_TOTAL 2012
|
||||
|
||||
#endif /* __ER_PLUGTEST_H__ */
|
||||
#endif /* PLUGTEST_H_ */
|
|
@ -38,9 +38,9 @@
|
|||
|
||||
#include <string.h>
|
||||
#include "rest-engine.h"
|
||||
#include "er-coap-block1.h"
|
||||
#include "er-coap-separate.h"
|
||||
#include "er-coap-transactions.h"
|
||||
#include "coap-block1.h"
|
||||
#include "coap-separate.h"
|
||||
#include "coap-transactions.h"
|
||||
|
||||
static void res_post_handler(void *request, void *response, uint8_t *buffer, uint16_t preferred_size, int32_t *offset);
|
||||
SEPARATE_RESOURCE(res_b1_sep_b2, "title=\"Block1 + Separate + Block2 demo\"", NULL, res_post_handler, NULL, NULL, NULL);
|
|
@ -38,7 +38,7 @@
|
|||
|
||||
#include <string.h>
|
||||
#include "rest-engine.h"
|
||||
#include "er-coap.h"
|
||||
#include "coap.h"
|
||||
|
||||
#define DEBUG 0
|
||||
#if DEBUG
|
|
@ -38,7 +38,7 @@
|
|||
|
||||
#include <string.h>
|
||||
#include "rest-engine.h"
|
||||
#include "er-coap.h"
|
||||
#include "coap.h"
|
||||
|
||||
#define DEBUG 0
|
||||
#if DEBUG
|
|
@ -38,8 +38,8 @@
|
|||
|
||||
#include <string.h>
|
||||
#include "rest-engine.h"
|
||||
#include "er-coap.h"
|
||||
#include "er-plugtest.h"
|
||||
#include "coap.h"
|
||||
#include "plugtest.h"
|
||||
|
||||
static void res_put_handler(void *request, void *response, uint8_t *buffer, uint16_t preferred_size, int32_t *offset);
|
||||
static void res_delete_handler(void *request, void *response, uint8_t *buffer, uint16_t preferred_size, int32_t *offset);
|
|
@ -38,8 +38,8 @@
|
|||
|
||||
#include <string.h>
|
||||
#include "rest-engine.h"
|
||||
#include "er-coap.h"
|
||||
#include "er-plugtest.h"
|
||||
#include "coap.h"
|
||||
#include "plugtest.h"
|
||||
|
||||
static void res_post_handler(void *request, void *response, uint8_t *buffer, uint16_t preferred_size, int32_t *offset);
|
||||
|
|
@ -38,8 +38,8 @@
|
|||
|
||||
#include <string.h>
|
||||
#include "rest-engine.h"
|
||||
#include "er-coap.h"
|
||||
#include "er-plugtest.h"
|
||||
#include "coap.h"
|
||||
#include "plugtest.h"
|
||||
|
||||
static void res_put_handler(void *request, void *response, uint8_t *buffer, uint16_t preferred_size, int32_t *offset);
|
||||
static void res_delete_handler(void *request, void *response, uint8_t *buffer, uint16_t preferred_size, int32_t *offset);
|
|
@ -38,8 +38,8 @@
|
|||
|
||||
#include <string.h>
|
||||
#include "rest-engine.h"
|
||||
#include "er-coap.h"
|
||||
#include "er-plugtest.h"
|
||||
#include "coap.h"
|
||||
#include "plugtest.h"
|
||||
|
||||
static void res_post_handler(void *request, void *response, uint8_t *buffer, uint16_t preferred_size, int32_t *offset);
|
||||
|
|
@ -39,8 +39,8 @@
|
|||
#include <string.h>
|
||||
#include "sys/cc.h"
|
||||
#include "rest-engine.h"
|
||||
#include "er-coap.h"
|
||||
#include "er-plugtest.h"
|
||||
#include "coap.h"
|
||||
#include "plugtest.h"
|
||||
|
||||
static void res_get_handler(void *request, void *response, uint8_t *buffer, uint16_t preferred_size, int32_t *offset);
|
||||
static void res_put_handler(void *request, void *response, uint8_t *buffer, uint16_t preferred_size, int32_t *offset);
|
|
@ -38,8 +38,8 @@
|
|||
|
||||
#include <string.h>
|
||||
#include "rest-engine.h"
|
||||
#include "er-coap.h"
|
||||
#include "er-plugtest.h"
|
||||
#include "coap.h"
|
||||
#include "plugtest.h"
|
||||
|
||||
static void res_get_handler(void *request, void *response, uint8_t *buffer, uint16_t preferred_size, int32_t *offset);
|
||||
|
|
@ -38,8 +38,8 @@
|
|||
|
||||
#include <string.h>
|
||||
#include "rest-engine.h"
|
||||
#include "er-coap.h"
|
||||
#include "er-plugtest.h"
|
||||
#include "coap.h"
|
||||
#include "plugtest.h"
|
||||
|
||||
static void res_get_handler(void *request, void *response, uint8_t *buffer, uint16_t preferred_size, int32_t *offset);
|
||||
|
|
@ -38,8 +38,8 @@
|
|||
|
||||
#include <string.h>
|
||||
#include "rest-engine.h"
|
||||
#include "er-coap.h"
|
||||
#include "er-plugtest.h"
|
||||
#include "coap.h"
|
||||
#include "plugtest.h"
|
||||
|
||||
static void res_post_handler(void *request, void *response, uint8_t *buffer, uint16_t preferred_size, int32_t *offset);
|
||||
|
|
@ -38,8 +38,8 @@
|
|||
|
||||
#include <string.h>
|
||||
#include "rest-engine.h"
|
||||
#include "er-coap.h"
|
||||
#include "er-plugtest.h"
|
||||
#include "coap.h"
|
||||
#include "plugtest.h"
|
||||
|
||||
static void res_get_handler(void *request, void *response, uint8_t *buffer, uint16_t preferred_size, int32_t *offset);
|
||||
|
|
@ -38,8 +38,8 @@
|
|||
|
||||
#include <string.h>
|
||||
#include "rest-engine.h"
|
||||
#include "er-coap.h"
|
||||
#include "er-plugtest.h"
|
||||
#include "coap.h"
|
||||
#include "plugtest.h"
|
||||
|
||||
static void res_get_handler(void *request, void *response, uint8_t *buffer, uint16_t preferred_size, int32_t *offset);
|
||||
|
|
@ -38,9 +38,9 @@
|
|||
|
||||
#include <string.h>
|
||||
#include "rest-engine.h"
|
||||
#include "er-coap.h"
|
||||
#include "er-coap-observe.h"
|
||||
#include "er-plugtest.h"
|
||||
#include "coap.h"
|
||||
#include "coap-observe.h"
|
||||
#include "plugtest.h"
|
||||
|
||||
static void res_get_handler(void *request, void *response, uint8_t *buffer, uint16_t preferred_size, int32_t *offset);
|
||||
static void res_put_handler(void *request, void *response, uint8_t *buffer, uint16_t preferred_size, int32_t *offset);
|
|
@ -38,8 +38,8 @@
|
|||
|
||||
#include <string.h>
|
||||
#include "rest-engine.h"
|
||||
#include "er-coap.h"
|
||||
#include "er-plugtest.h"
|
||||
#include "coap.h"
|
||||
#include "plugtest.h"
|
||||
|
||||
static void res_get_handler(void *request, void *response, uint8_t *buffer, uint16_t preferred_size, int32_t *offset);
|
||||
|
|
@ -38,8 +38,8 @@
|
|||
|
||||
#include <string.h>
|
||||
#include "rest-engine.h"
|
||||
#include "er-coap.h"
|
||||
#include "er-plugtest.h"
|
||||
#include "coap.h"
|
||||
#include "plugtest.h"
|
||||
|
||||
static void res_get_handler(void *request, void *response, uint8_t *buffer, uint16_t preferred_size, int32_t *offset);
|
||||
|
|
@ -38,10 +38,10 @@
|
|||
|
||||
#include <string.h>
|
||||
#include "rest-engine.h"
|
||||
#include "er-coap.h"
|
||||
#include "er-coap-transactions.h"
|
||||
#include "er-coap-separate.h"
|
||||
#include "er-plugtest.h"
|
||||
#include "coap.h"
|
||||
#include "coap-transactions.h"
|
||||
#include "coap-separate.h"
|
||||
#include "plugtest.h"
|
||||
|
||||
static void res_get_handler(void *request, void *response, uint8_t *buffer, uint16_t preferred_size, int32_t *offset);
|
||||
static void res_resume_handler(void);
|
|
@ -38,8 +38,8 @@
|
|||
|
||||
#include <string.h>
|
||||
#include "rest-engine.h"
|
||||
#include "er-coap.h"
|
||||
#include "er-plugtest.h"
|
||||
#include "coap.h"
|
||||
#include "plugtest.h"
|
||||
|
||||
static void res_get_handler(void *request, void *response, uint8_t *buffer, uint16_t preferred_size, int32_t *offset);
|
||||
static void res_post_handler(void *request, void *response, uint8_t *buffer, uint16_t preferred_size, int32_t *offset);
|
|
@ -38,8 +38,8 @@
|
|||
|
||||
#include <string.h>
|
||||
#include "rest-engine.h"
|
||||
#include "er-coap.h"
|
||||
#include "er-plugtest.h"
|
||||
#include "coap.h"
|
||||
#include "plugtest.h"
|
||||
|
||||
static void res_get_handler(void *request, void *response, uint8_t *buffer, uint16_t preferred_size, int32_t *offset);
|
||||
static void res_put_handler(void *request, void *response, uint8_t *buffer, uint16_t preferred_size, int32_t *offset);
|
|
@ -38,7 +38,7 @@
|
|||
|
||||
#include <string.h>
|
||||
#include "rest-engine.h"
|
||||
#include "er-coap.h"
|
||||
#include "coap.h"
|
||||
|
||||
static void res_get_handler(void *request, void *response, uint8_t *buffer, uint16_t preferred_size, int32_t *offset);
|
||||
static void res_periodic_handler(void);
|
|
@ -38,8 +38,8 @@
|
|||
|
||||
#include <string.h>
|
||||
#include "rest-engine.h"
|
||||
#include "er-coap-separate.h"
|
||||
#include "er-coap-transactions.h"
|
||||
#include "coap-separate.h"
|
||||
#include "coap-transactions.h"
|
||||
|
||||
static void res_get_handler(void *request, void *response, uint8_t *buffer, uint16_t preferred_size, int32_t *offset);
|
||||
static void res_resume_handler(void);
|
|
@ -1,4 +1,4 @@
|
|||
examples/ipv6/er-rest-example<?xml version="1.0" encoding="UTF-8"?>
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<simconf>
|
||||
<project EXPORT="discard">[APPS_DIR]/mrm</project>
|
||||
<project EXPORT="discard">[APPS_DIR]/mspsim</project>
|
||||
|
@ -48,9 +48,9 @@ examples/ipv6/er-rest-example<?xml version="1.0" encoding="UTF-8"?>
|
|||
org.contikios.cooja.mspmote.SkyMoteType
|
||||
<identifier>server</identifier>
|
||||
<description>Erbium Server</description>
|
||||
<source EXPORT="discard">[CONTIKI_DIR]/examples/ipv6/er-rest-example/er-example-server.c</source>
|
||||
<commands EXPORT="discard">make er-example-server.sky TARGET=sky</commands>
|
||||
<firmware EXPORT="copy">[CONTIKI_DIR]/examples/ipv6/er-rest-example/er-example-server.sky</firmware>
|
||||
<source EXPORT="discard">[CONTIKI_DIR]/examples/ipv6/coap-example/coap-example-server.c</source>
|
||||
<commands EXPORT="discard">make coap-example-server.sky TARGET=sky</commands>
|
||||
<firmware EXPORT="copy">[CONTIKI_DIR]/examples/ipv6/coap-example/coap-example-server.sky</firmware>
|
||||
<moteinterface>org.contikios.cooja.interfaces.Position</moteinterface>
|
||||
<moteinterface>org.contikios.cooja.interfaces.RimeAddress</moteinterface>
|
||||
<moteinterface>org.contikios.cooja.interfaces.IPAddress</moteinterface>
|
||||
|
@ -71,9 +71,9 @@ examples/ipv6/er-rest-example<?xml version="1.0" encoding="UTF-8"?>
|
|||
org.contikios.cooja.mspmote.SkyMoteType
|
||||
<identifier>client</identifier>
|
||||
<description>Erbium Client</description>
|
||||
<source EXPORT="discard">[CONTIKI_DIR]/examples/ipv6/er-rest-example/er-example-client.c</source>
|
||||
<commands EXPORT="discard">make er-example-client.sky TARGET=sky</commands>
|
||||
<firmware EXPORT="copy">[CONTIKI_DIR]/examples/ipv6/er-rest-example/er-example-client.sky</firmware>
|
||||
<source EXPORT="discard">[CONTIKI_DIR]/examples/ipv6/coap-example/coap-example-client.c</source>
|
||||
<commands EXPORT="discard">make coap-example-client.sky TARGET=sky</commands>
|
||||
<firmware EXPORT="copy">[CONTIKI_DIR]/examples/ipv6/coap-example/coap-example-client.sky</firmware>
|
||||
<moteinterface>org.contikios.cooja.interfaces.Position</moteinterface>
|
||||
<moteinterface>org.contikios.cooja.interfaces.RimeAddress</moteinterface>
|
||||
<moteinterface>org.contikios.cooja.interfaces.IPAddress</moteinterface>
|
|
@ -48,9 +48,9 @@
|
|||
org.contikios.cooja.mspmote.SkyMoteType
|
||||
<identifier>server</identifier>
|
||||
<description>Erbium Server</description>
|
||||
<source EXPORT="discard">[CONTIKI_DIR]/examples/ipv6/er-rest-example/er-example-server.c</source>
|
||||
<commands EXPORT="discard">make er-example-server.sky TARGET=sky</commands>
|
||||
<firmware EXPORT="copy">[CONTIKI_DIR]/examples/ipv6/er-rest-example/er-example-server.sky</firmware>
|
||||
<source EXPORT="discard">[CONTIKI_DIR]/examples/ipv6/coap-example/coap-example-server.c</source>
|
||||
<commands EXPORT="discard">make coap-example-server.sky TARGET=sky</commands>
|
||||
<firmware EXPORT="copy">[CONTIKI_DIR]/examples/ipv6/coap-example/coap-example-server.sky</firmware>
|
||||
<moteinterface>org.contikios.cooja.interfaces.Position</moteinterface>
|
||||
<moteinterface>org.contikios.cooja.interfaces.RimeAddress</moteinterface>
|
||||
<moteinterface>org.contikios.cooja.interfaces.IPAddress</moteinterface>
|
||||
|
@ -71,9 +71,9 @@
|
|||
org.contikios.cooja.mspmote.SkyMoteType
|
||||
<identifier>client</identifier>
|
||||
<description>Erbium Client</description>
|
||||
<source EXPORT="discard">[CONTIKI_DIR]/examples/ipv6/er-rest-example/er-example-observe-client.c</source>
|
||||
<commands EXPORT="discard">make er-example-observe-client.sky TARGET=sky</commands>
|
||||
<firmware EXPORT="copy">[CONTIKI_DIR]/examples/ipv6/er-rest-example/er-example-observe-client.sky</firmware>
|
||||
<source EXPORT="discard">[CONTIKI_DIR]/examples/ipv6/coap-example/coap-example-observe-client.c</source>
|
||||
<commands EXPORT="discard">make coap-example-observe-client.sky TARGET=sky</commands>
|
||||
<firmware EXPORT="copy">[CONTIKI_DIR]/examples/ipv6/coap-example/coap-example-observe-client.sky</firmware>
|
||||
<moteinterface>org.contikios.cooja.interfaces.Position</moteinterface>
|
||||
<moteinterface>org.contikios.cooja.interfaces.RimeAddress</moteinterface>
|
||||
<moteinterface>org.contikios.cooja.interfaces.IPAddress</moteinterface>
|
|
@ -48,9 +48,9 @@
|
|||
org.contikios.cooja.mspmote.SkyMoteType
|
||||
<identifier>server</identifier>
|
||||
<description>Erbium Server</description>
|
||||
<source EXPORT="discard">[CONTIKI_DIR]/examples/ipv6/er-rest-example/er-example-server.c</source>
|
||||
<commands EXPORT="discard">make er-example-server.sky TARGET=sky</commands>
|
||||
<firmware EXPORT="copy">[CONTIKI_DIR]/examples/ipv6/er-rest-example/er-example-server.sky</firmware>
|
||||
<source EXPORT="discard">[CONTIKI_DIR]/examples/ipv6/coap-example/coap-example-server.c</source>
|
||||
<commands EXPORT="discard">make coap-example-server.sky TARGET=sky</commands>
|
||||
<firmware EXPORT="copy">[CONTIKI_DIR]/examples/ipv6/coap-example/coap-example-server.sky</firmware>
|
||||
<moteinterface>org.contikios.cooja.interfaces.Position</moteinterface>
|
||||
<moteinterface>org.contikios.cooja.interfaces.RimeAddress</moteinterface>
|
||||
<moteinterface>org.contikios.cooja.interfaces.IPAddress</moteinterface>
|
||||
|
@ -71,9 +71,9 @@
|
|||
org.contikios.cooja.mspmote.SkyMoteType
|
||||
<identifier>client</identifier>
|
||||
<description>Erbium Client</description>
|
||||
<source EXPORT="discard">[CONTIKI_DIR]/examples/ipv6/er-rest-example/er-example-client.c</source>
|
||||
<commands EXPORT="discard">make er-example-client.sky TARGET=sky</commands>
|
||||
<firmware EXPORT="copy">[CONTIKI_DIR]/examples/ipv6/er-rest-example/er-example-client.sky</firmware>
|
||||
<source EXPORT="discard">[CONTIKI_DIR]/examples/ipv6/coap-example/coap-example-client.c</source>
|
||||
<commands EXPORT="discard">make coap-example-client.sky TARGET=sky</commands>
|
||||
<firmware EXPORT="copy">[CONTIKI_DIR]/examples/ipv6/coap-example/coap-example-client.sky</firmware>
|
||||
<moteinterface>org.contikios.cooja.interfaces.Position</moteinterface>
|
||||
<moteinterface>org.contikios.cooja.interfaces.RimeAddress</moteinterface>
|
||||
<moteinterface>org.contikios.cooja.interfaces.IPAddress</moteinterface>
|
|
@ -48,9 +48,9 @@
|
|||
org.contikios.cooja.mspmote.SkyMoteType
|
||||
<identifier>server</identifier>
|
||||
<description>Erbium Server</description>
|
||||
<source EXPORT="discard">[CONTIKI_DIR]/examples/ipv6/er-rest-example/er-example-server.c</source>
|
||||
<commands EXPORT="discard">make er-example-server.sky TARGET=sky</commands>
|
||||
<firmware EXPORT="copy">[CONTIKI_DIR]/examples/ipv6/er-rest-example/er-example-server.sky</firmware>
|
||||
<source EXPORT="discard">[CONTIKI_DIR]/examples/ipv6/coap-example/coap-example-server.c</source>
|
||||
<commands EXPORT="discard">make coap-example-server.sky TARGET=sky</commands>
|
||||
<firmware EXPORT="copy">[CONTIKI_DIR]/examples/ipv6/coap-example/coap-example-server.sky</firmware>
|
||||
<moteinterface>org.contikios.cooja.interfaces.Position</moteinterface>
|
||||
<moteinterface>org.contikios.cooja.interfaces.RimeAddress</moteinterface>
|
||||
<moteinterface>org.contikios.cooja.interfaces.IPAddress</moteinterface>
|
|
@ -11,7 +11,7 @@ ifdef WITH_UDP
|
|||
PROJECT_SOURCEFILES += json-ws-udp.c
|
||||
endif
|
||||
|
||||
APPS += httpd-ws json
|
||||
MODULES += os/lib/json os/net/app-layer/httpd-ws
|
||||
|
||||
CFLAGS += -DPROJECT_CONF_H=\"project-conf.h\"
|
||||
|
||||
|
|
|
@ -5,7 +5,7 @@ all: $(CONTIKI_PROJECT)
|
|||
|
||||
CONTIKI = ../../..
|
||||
|
||||
MODULES += core/net/ipv6/multicast
|
||||
MODULES += os/net/ipv6/multicast
|
||||
|
||||
CONTIKI_WITH_IPV6 = 1
|
||||
CONTIKI_WITH_RPL_LITE = 1
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
CONTIKI_PROJECT=border-router
|
||||
all: $(CONTIKI_PROJECT)
|
||||
APPS = slip-cmd
|
||||
MODULES += os/services/slip-cmd
|
||||
|
||||
CONTIKI=../../..
|
||||
|
||||
|
@ -13,7 +13,7 @@ ifeq ($(WITH_WEBSERVER),1)
|
|||
CFLAGS += -DWEBSERVER=1
|
||||
PROJECT_SOURCEFILES += httpd-simple.c
|
||||
else ifneq ($(WITH_WEBSERVER), 0)
|
||||
APPS += $(WITH_WEBSERVER)
|
||||
MODULES += $(WITH_WEBSERVER)
|
||||
CFLAGS += -DWEBSERVER=2
|
||||
endif
|
||||
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
CONTIKI_PROJECT=border-router
|
||||
all: $(CONTIKI_PROJECT)
|
||||
all: $(CONTIKI_PROJECT)
|
||||
|
||||
CONTIKI=../../..
|
||||
|
||||
|
@ -8,9 +8,7 @@ PROJECT_SOURCEFILES += slip-bridge.c
|
|||
|
||||
#Simple built-in webserver is the default.
|
||||
#Override with make WITH_WEBSERVER=0 for no webserver.
|
||||
#WITH_WEBSERVER=webserver-name will use /apps/webserver-name if it can be
|
||||
#found in the /apps, /arch/platform/$(TARGET)/apps/, or current directory (in that order).
|
||||
# WITH_WEBSERVER=webserver for /apps/webserver
|
||||
#WITH_WEBSERVER=module-path will use the module if it can be found
|
||||
#make clean before changing webservers!
|
||||
|
||||
#Note /apps/webserver contains a 2500 byte style sheet which is a severe test
|
||||
|
@ -23,7 +21,7 @@ CFLAGS += -DUIP_CONF_TCP=1
|
|||
CFLAGS += -DWEBSERVER=1
|
||||
PROJECT_SOURCEFILES += httpd-simple.c
|
||||
else ifneq ($(WITH_WEBSERVER), 0)
|
||||
APPS += $(WITH_WEBSERVER)
|
||||
MODULES += $(WITH_WEBSERVER)
|
||||
CFLAGS += -DUIP_CONF_TCP=1
|
||||
CFLAGS += -DWEBSERVER=2
|
||||
endif
|
||||
|
|
|
@ -6,7 +6,7 @@ CFLAGS += -DPROJECT_CONF_H=\"project-conf.h\"
|
|||
WITH_TSCH ?= 0
|
||||
|
||||
ifeq ($(WITH_TSCH),1)
|
||||
MODULES += core/net/mac/tsch
|
||||
MODULES += os/net/mac/tsch
|
||||
endif
|
||||
CFLAGS += -DWITH_TSCH=$(WITH_TSCH)
|
||||
|
||||
|
|
|
@ -9,8 +9,7 @@ MAKE_WITH_ORCHESTRA ?= 0 # force Orchestra from command line
|
|||
MAKE_WITH_SECURITY ?= 0 # force Security from command line
|
||||
MAKE_WITH_PERIODIC_ROUTES_PRINT ?= 0 # print #routes periodically, used for regression tests
|
||||
|
||||
APPS += orchestra shell
|
||||
MODULES += core/net/mac/tsch
|
||||
MODULES += os/net/mac/tsch os/services/shell os/services/orchestra
|
||||
|
||||
ifeq ($(MAKE_WITH_ORCHESTRA),1)
|
||||
CFLAGS += -DWITH_ORCHESTRA=1
|
||||
|
|
|
@ -125,7 +125,7 @@
|
|||
|
||||
#if WITH_ORCHESTRA
|
||||
|
||||
/* See apps/orchestra/README.md for more Orchestra configuration options */
|
||||
/* See os/services//orchestra/README.md for more Orchestra configuration options */
|
||||
#define TSCH_SCHEDULE_CONF_WITH_6TISCH_MINIMAL 0 /* No 6TiSCH minimal schedule */
|
||||
#define TSCH_CONF_WITH_LINK_SELECTOR 1 /* Orchestra requires per-packet link selection */
|
||||
/* Orchestra callbacks */
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
CONTIKI_PROJECT=slip-radio
|
||||
all: $(CONTIKI_PROJECT)
|
||||
APPS = slip-cmd
|
||||
MODULES += os/services/slip-cmd
|
||||
|
||||
ifeq ($(TARGET),)
|
||||
-include Makefile.target
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
Logging
|
||||
===========
|
||||
|
||||
This example shows how to configure the logging system. See core/net/sys/log.h
|
||||
and core/net/sys/log-conf.h more information on logging. Edit project-conf.h
|
||||
This example shows how to configure the logging system. See os/net/sys/log.h
|
||||
and os/net/sys/log-conf.h more information on logging. Edit project-conf.h
|
||||
for configure debug levels for the different modules.
|
||||
|
|
|
@ -30,9 +30,9 @@
|
|||
#ifndef PROJECT_CONF_H_
|
||||
#define PROJECT_CONF_H_
|
||||
|
||||
/* Set maximum debug level on all modules. See core/sys/log-conf.h for
|
||||
/* Set maximum debug level on all modules. See os/sys/log-conf.h for
|
||||
* a list of supported modules. The different log levels are defined in
|
||||
* core/sys/log.h:
|
||||
* os/sys/log.h:
|
||||
* LOG_LEVEL_NONE No log
|
||||
* LOG_LEVEL_ERR Errors
|
||||
* LOG_LEVEL_WARN Warnings
|
||||
|
|
|
@ -4,7 +4,7 @@ all: mqtt-demo
|
|||
|
||||
CONTIKI_WITH_IPV6 = 1
|
||||
|
||||
APPS += mqtt
|
||||
MODULES += os/net/app-layer/mqtt
|
||||
|
||||
CONTIKI = ../../../..
|
||||
include $(CONTIKI)/Makefile.include
|
||||
|
|
|
@ -16,9 +16,8 @@ PROJECT_SOURCEFILES += httpd-simple.c
|
|||
CONTIKI_WITH_IPV6 = 1
|
||||
|
||||
# REST Engine shall use Erbium CoAP implementation
|
||||
APPS += er-coap
|
||||
APPS += rest-engine
|
||||
APPS += mqtt
|
||||
MODULES += os/net/app-layer/mqtt
|
||||
MODULES += os/net/app-layer/coap
|
||||
|
||||
CONTIKI=../../../..
|
||||
include $(CONTIKI)/Makefile.include
|
||||
|
|
|
@ -37,7 +37,7 @@
|
|||
/*---------------------------------------------------------------------------*/
|
||||
#include "contiki.h"
|
||||
#include "rest-engine.h"
|
||||
#include "er-coap.h"
|
||||
#include "coap.h"
|
||||
#include "rf-core/rf-ble.h"
|
||||
|
||||
#include <string.h>
|
||||
|
|
|
@ -38,7 +38,7 @@
|
|||
/*---------------------------------------------------------------------------*/
|
||||
#include "contiki.h"
|
||||
#include "rest-engine.h"
|
||||
#include "er-coap.h"
|
||||
#include "coap.h"
|
||||
#include "sys/clock.h"
|
||||
#include "coap-server.h"
|
||||
#include "cc26xx-web-demo.h"
|
||||
|
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue