update to new version

This commit is contained in:
harald42 2016-02-25 13:25:24 +01:00
parent 7d8254bd81
commit 9bb1f01905
3 changed files with 8 additions and 7 deletions

View file

@ -3,9 +3,6 @@ all: $(CONTIKI_PROJECT)
CONTIKI=../../.. CONTIKI=../../..
UIP_CONF_IPV6=1
CFLAGS+= -DUIP_CONF_IPV6_RPL
#linker optimizations #linker optimizations
SMALL=1 SMALL=1
@ -26,10 +23,12 @@ PROJECT_SOURCEFILES += slip-bridge.c
WITH_WEBSERVER=1 WITH_WEBSERVER=1
ifeq ($(WITH_WEBSERVER),1) ifeq ($(WITH_WEBSERVER),1)
CFLAGS += -DUIP_CONF_TCP=1
CFLAGS += -DWEBSERVER=1 CFLAGS += -DWEBSERVER=1
PROJECT_SOURCEFILES += httpd-simple.c PROJECT_SOURCEFILES += httpd-simple.c
else ifneq ($(WITH_WEBSERVER), 0) else ifneq ($(WITH_WEBSERVER), 0)
APPS += $(WITH_WEBSERVER) APPS += $(WITH_WEBSERVER)
CFLAGS += -DUIP_CONF_TCP=1
CFLAGS += -DWEBSERVER=2 CFLAGS += -DWEBSERVER=2
endif endif
@ -37,6 +36,7 @@ ifeq ($(PREFIX),)
PREFIX = aaaa::1/64 PREFIX = aaaa::1/64
endif endif
CONTIKI_WITH_IPV6 = 1
include $(CONTIKI)/Makefile.include include $(CONTIKI)/Makefile.include
$(CONTIKI)/tools/tunslip6: $(CONTIKI)/tools/tunslip6.c $(CONTIKI)/tools/tunslip6: $(CONTIKI)/tools/tunslip6.c

View file

@ -312,7 +312,7 @@ request_prefix(void)
uip_buf[1] = 'P'; uip_buf[1] = 'P';
uip_len = 2; uip_len = 2;
slip_send(); slip_send();
uip_len = 0; uip_clear_buf();
} }
/*---------------------------------------------------------------------------*/ /*---------------------------------------------------------------------------*/
void void

View file

@ -59,7 +59,7 @@ slip_input_callback(void)
// PRINTF("SIN: %u\n", uip_len); // PRINTF("SIN: %u\n", uip_len);
if(uip_buf[0] == '!') { if(uip_buf[0] == '!') {
PRINTF("Got configuration message of type %c\n", uip_buf[1]); PRINTF("Got configuration message of type %c\n", uip_buf[1]);
uip_len = 0; uip_clear_buf();
if(uip_buf[1] == 'P') { if(uip_buf[1] == 'P') {
uip_ipaddr_t prefix; uip_ipaddr_t prefix;
/* Here we set a prefix !!! */ /* Here we set a prefix !!! */
@ -85,7 +85,7 @@ slip_input_callback(void)
slip_send(); slip_send();
} }
uip_len = 0; uip_clear_buf();
} }
/* Save the last sender received over SLIP to avoid bouncing the /* Save the last sender received over SLIP to avoid bouncing the
packet back if no route is found */ packet back if no route is found */
@ -100,7 +100,7 @@ init(void)
slip_set_input_callback(slip_input_callback); slip_set_input_callback(slip_input_callback);
} }
/*---------------------------------------------------------------------------*/ /*---------------------------------------------------------------------------*/
static void static int
output(void) output(void)
{ {
if(uip_ipaddr_cmp(&last_sender, &UIP_IP_BUF->srcipaddr)) { if(uip_ipaddr_cmp(&last_sender, &UIP_IP_BUF->srcipaddr)) {
@ -115,6 +115,7 @@ output(void)
// PRINTF("SUT: %u\n", uip_len); // PRINTF("SUT: %u\n", uip_len);
slip_send(); slip_send();
} }
return 0;
} }
/*---------------------------------------------------------------------------*/ /*---------------------------------------------------------------------------*/