Merge branch 'master' of git://contiki.git.sourceforge.net/gitroot/contiki/contiki into master_cleanup

Makefile.z1 is broken into .common and .z1 to share it with Z1 Starter Platform

Conflicts:
	.gitignore
	platform/z1/Makefile.z1
This commit is contained in:
Enric M. Calvo 2011-03-25 17:46:38 +01:00
commit 1716d837fc
241 changed files with 6193 additions and 3413 deletions

0
examples/ipso-ipv6-raven/Makefile Executable file → Normal file
View file

0
examples/ipso-ipv6-raven/Makefile.ipso Executable file → Normal file
View file

0
examples/ipso-ipv6-raven/ipso.c Executable file → Normal file
View file

View file

@ -5,10 +5,17 @@ CONTIKI=../../..
WITH_UIP6=1
UIP_CONF_IPV6=1
APPS += webserver
#Override inclusion of internal webserver with make WITH_WEBSERVER=0
WITH_WEBSERVER=1
ifeq ($(WITH_WEBSERVER), 0)
CFLAGS += -DPROJECT_CONF_H=\"project-conf.h\"
PROJECT_SOURCEFILES += slip-bridge.c
else
APPS += webserver
CFLAGS += -DPROJECT_CONF_H=\"project-conf.h\" -DWEBSERVER
PROJECT_SOURCEFILES += slip-bridge.c httpd-simple.c
endif
include $(CONTIKI)/Makefile.include

View file

@ -45,8 +45,13 @@
#include "net/netstack.h"
#include "dev/button-sensor.h"
#include "dev/slip.h"
/* For internal webserver Makefile must set APPS += webserver and PROJECT_SOURCEFILES += httpd-simple.c */
#if WEBSERVER
#include "webserver-nogui.h"
#include "httpd-simple.h"
#endif
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
@ -65,6 +70,8 @@ static uint8_t prefix_set;
PROCESS(border_router_process, "Border router process");
AUTOSTART_PROCESSES(&border_router_process);
#if WEBSERVER
/*---------------------------------------------------------------------------*/
/* Only one single web request at time */
static const char *TOP = "<html><head><title>ContikiRPL</title></head><body>\n";
@ -151,6 +158,9 @@ httpd_simple_get_script(const char *name)
{
return generate_routes;
}
#endif /* WEBSERVER */
/*---------------------------------------------------------------------------*/
static void
print_local_addresses(void)
@ -158,14 +168,14 @@ print_local_addresses(void)
int i;
uint8_t state;
PRINTF("Server IPv6 addresses:\n");
PRINTA("Server IPv6 addresses:\n");
for(i = 0; i < UIP_DS6_ADDR_NB; i++) {
state = uip_ds6_if.addr_list[i].state;
if(uip_ds6_if.addr_list[i].isused &&
(state == ADDR_TENTATIVE || state == ADDR_PREFERRED)) {
blen = 0;
ipaddr_add(&uip_ds6_if.addr_list[i].ipaddr);
PRINTF(" %s\n", buf);
PRINTA(" ");
uip_debug_ipaddr_print(&uip_ds6_if.addr_list[i].ipaddr);
PRINTA("\n");
}
}
}
@ -174,7 +184,7 @@ void
request_prefix(void)
{
/* mess up uip_buf with a dirty request... */
uip_buf[0] = '!';
uip_buf[0] = '?';
uip_buf[1] = 'P';
uip_len = 2;
slip_send();
@ -202,7 +212,10 @@ PROCESS_THREAD(border_router_process, ev, data)
PROCESS_PAUSE();
#if WEBSERVER
process_start(&webserver_nogui_process, NULL);
#endif
SENSORS_ACTIVATE(button_sensor);
PRINTF("RPL-Border router started\n");
@ -220,7 +233,9 @@ PROCESS_THREAD(border_router_process, ev, data)
PRINTF("created a new RPL dag\n");
}
#if DEBUG || 1
print_local_addresses();
#endif
/* The border router runs with a 100% duty cycle in order to ensure high
packet reception rates. */

0
examples/ipv6/rpl-udp/rpl-udp.csc Executable file → Normal file
View file

View file

@ -114,9 +114,27 @@ set_global_address(void)
uip_ds6_set_addr_iid(&ipaddr, &uip_lladdr);
uip_ds6_addr_add(&ipaddr, 0, ADDR_AUTOCONF);
/* set server address */
uip_ip6addr(&server_ipaddr, 0xaaaa, 0, 0, 0, 0, 0, 0, 1);
/* The choice of server address determines its 6LoPAN header compression.
* (Our address will be compressed Mode 3 since it is derived from our link-local address)
* Obviously the choice made here must also be selected in udp-server.c.
*
* For correct Wireshark decoding using a sniffer, add the /64 prefix to the 6LowPAN protocol preferences,
* e.g. set Context 0 to aaaa::. At present Wireshark copies Context/128 and then overwrites it.
* (Setting Context 0 to aaaa::1111:2222:3333:4444 will report a 16 bit compressed address of aaaa::1111:22ff:fe33:xxxx)
*
* Note the IPCMV6 checksum verification depends on the correct uncompressed addresses.
*/
#if 0
/* Mode 1 - 64 bits inline */
uip_ip6addr(&server_ipaddr, 0xaaaa, 0, 0, 0, 0, 0, 0, 1);
#elif 1
/* Mode 2 - 16 bits inline */
uip_ip6addr(&server_ipaddr, 0xaaaa, 0, 0, 0, 0, 0x00ff, 0xfe00, 1);
#else
/* Mode 3 - derived from server link-local (MAC) address */
uip_ip6addr(&server_ipaddr, 0xaaaa, 0, 0, 0, 0x0250, 0xc2ff, 0xfea8, 0xcd1a); //redbee-econotag
#endif
}
/*---------------------------------------------------------------------------*/
PROCESS_THREAD(udp_client_process, ev, data)

View file

@ -108,8 +108,27 @@ PROCESS_THREAD(udp_server_process, ev, data)
PRINTF("UDP server started\n");
#if UIP_CONF_ROUTER
uip_ip6addr(&ipaddr, 0xaaaa, 0, 0, 0, 0, 0, 0, 1);
/* uip_ds6_set_addr_iid(&ipaddr, &uip_lladdr); */
/* The choice of server address determines its 6LoPAN header compression.
* Obviously the choice made here must also be selected in udp-client.c.
*
* For correct Wireshark decoding using a sniffer, add the /64 prefix to the 6LowPAN protocol preferences,
* e.g. set Context 0 to aaaa::. At present Wireshark copies Context/128 and then overwrites it.
* (Setting Context 0 to aaaa::1111:2222:3333:4444 will report a 16 bit compressed address of aaaa::1111:22ff:fe33:xxxx)
* Note Wireshark's IPCMV6 checksum verification depends on the correct uncompressed addresses.
*/
#if 0
/* Mode 1 - 64 bits inline */
uip_ip6addr(&ipaddr, 0xaaaa, 0, 0, 0, 0, 0, 0, 1);
#elif 1
/* Mode 2 - 16 bits inline */
uip_ip6addr(&ipaddr, 0xaaaa, 0, 0, 0, 0, 0x00ff, 0xfe00, 1);
#else
/* Mode 3 - derived from link local (MAC) address */
uip_ip6addr(&ipaddr, 0xaaaa, 0, 0, 0, 0, 0, 0, 0);
uip_ds6_set_addr_iid(&ipaddr, &uip_lladdr);
#endif
uip_ds6_addr_add(&ipaddr, 0, ADDR_MANUAL);
root_if = uip_ds6_addr_lookup(&ipaddr);
if(root_if != NULL) {

View file

@ -46,13 +46,13 @@
#include <stdio.h>
/* The address of the server to register the services for this node */
#define SERVER "aaaa::1"
#define SERVER "[aaaa::1]"
/* This command registers two services (/0 and /1) to turn the leds on or off */
#define REGISTER_COMMAND "/r?p=0&d=Turn%20off%20leds&p=1&d=Turn%20on%20leds"
/* The address of the other node to control */
#define OTHER_NODE "aaaa::212:7403:3:303"
#define OTHER_NODE "[aaaa::1]"
/* The commands to send to the other node */
#define SET_LEDS_ON "/1"

View file

@ -1,4 +1,4 @@
all: rest-server-example
all: rest-server-example coap-client-example
ifndef TARGET
TARGET=sky

View file

@ -1,5 +1,6 @@
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include "contiki.h"
#include "contiki-net.h"
#include "rest.h"

View file

@ -26,22 +26,26 @@
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
* $Id: project-conf.h,v 1.1 2010/10/28 13:11:08 doganyazar Exp $
*
*/
#ifndef __PROJECT_RPL_WEB_CONF_H__
#define __PROJECT_RPL_WEB_CONF_H__
#undef QUEUEBUF_CONF_NUM
#ifndef QUEUEBUF_CONF_NUM
#define QUEUEBUF_CONF_NUM 6
#endif
#undef UIP_CONF_BUFFER_SIZE
#ifndef UIP_CONF_BUFFER_SIZE
#define UIP_CONF_BUFFER_SIZE 140
#endif
#undef UIP_CONF_RECEIVE_WINDOW
#ifndef UIP_CONF_RECEIVE_WINDOW
#define UIP_CONF_RECEIVE_WINDOW 60
#endif
#undef WEBSERVER_CONF_CFS_CONNS
#ifndef WEBSERVER_CONF_CFS_CONNS
#define WEBSERVER_CONF_CFS_CONNS 2
#endif
#endif /* __PROJECT_RPL_WEB_CONF_H__ */

0
examples/sky/test-coffee.c Executable file → Normal file
View file