summaryrefslogtreecommitdiff
path: root/contrib/contiki-2.6.patch
blob: 8bc4ecd881d5f833e52c87ada222cc6b449ed410 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
diff -Nur contiki-2.6.orig/apps/serial-shell/serial-shell.c contiki-2.6/apps/serial-shell/serial-shell.c
--- contiki-2.6.orig/apps/serial-shell/serial-shell.c	2012-07-17 12:11:02.000000000 +0200
+++ contiki-2.6/apps/serial-shell/serial-shell.c	2013-07-09 04:10:49.815163583 +0200
@@ -81,7 +81,7 @@
 void
 shell_prompt(char *str)
 {
-  printf("%d.%d: %s\r\n", rimeaddr_node_addr.u8[0], rimeaddr_node_addr.u8[1],
+  printf("%d.%d: %s", rimeaddr_node_addr.u8[0], rimeaddr_node_addr.u8[1],
 	 str);
 }
 /*---------------------------------------------------------------------------*/
diff -Nur contiki-2.6.orig/core/net/uip-nd6.c contiki-2.6/core/net/uip-nd6.c
--- contiki-2.6.orig/core/net/uip-nd6.c	2012-07-17 12:11:04.000000000 +0200
+++ contiki-2.6/core/net/uip-nd6.c	2013-06-25 01:45:38.193233756 +0200
@@ -120,8 +120,8 @@
 #if !UIP_CONF_ROUTER            // TBD see if we move it to ra_input
 static uip_nd6_opt_prefix_info *nd6_opt_prefix_info; /**  Pointer to prefix information option in uip_buf */
 static uip_ipaddr_t ipaddr;
-static uip_ds6_prefix_t *prefix; /**  Pointer to a prefix list entry */
 #endif
+static uip_ds6_prefix_t *prefix; /**  Pointer to a prefix list entry */
 static uip_ds6_nbr_t *nbr; /**  Pointer to a nbr cache entry*/
 static uip_ds6_defrt_t *defrt; /**  Pointer to a router list entry */
 static uip_ds6_addr_t *addr; /**  Pointer to an interface address */
@@ -582,7 +582,7 @@
 #endif /*UIP_CONF_IPV6_CHECKS */
     switch (UIP_ND6_OPT_HDR_BUF->type) {
     case UIP_ND6_OPT_SLLAO:
-      nd6_opt_llao = UIP_ND6_OPT_HDR_BUF;
+      nd6_opt_llao = (uint8_t *) UIP_ND6_OPT_HDR_BUF;
       break;
     default:
       PRINTF("ND option not supported in RS\n");
@@ -601,7 +601,7 @@
       if((nbr = uip_ds6_nbr_lookup(&UIP_IP_BUF->srcipaddr)) == NULL) {
         /* we need to add the neighbor */
         uip_ds6_nbr_add(&UIP_IP_BUF->srcipaddr,
-                        &nd6_opt_llao[UIP_ND6_OPT_DATA_OFFSET], 0, NBR_STALE);
+                        (uip_lladdr_t *)&nd6_opt_llao[UIP_ND6_OPT_DATA_OFFSET], 0, NBR_STALE);
       } else {
         /* If LL address changed, set neighbor state to stale */
         if(memcmp(&nd6_opt_llao[UIP_ND6_OPT_DATA_OFFSET],
diff -Nur contiki-2.6.orig/platform/avr-zigbit/contiki-avr-zigbit-main.c contiki-2.6/platform/avr-zigbit/contiki-avr-zigbit-main.c
--- contiki-2.6.orig/platform/avr-zigbit/contiki-avr-zigbit-main.c	2012-07-17 12:11:08.000000000 +0200
+++ contiki-2.6/platform/avr-zigbit/contiki-avr-zigbit-main.c	2013-07-09 04:38:35.415422849 +0200
@@ -41,8 +41,8 @@
 #include "loader/symbols-def.h"
 #include "loader/symtab.h"
 
-#define ANNOUNCE_BOOT 0    //adds about 600 bytes to program size
-#define DEBUG 0
+#define ANNOUNCE_BOOT 1    //adds about 600 bytes to program size
+#define DEBUG 1
 #if DEBUG
 #define PRINTF(FORMAT,args...) printf_P(PSTR(FORMAT),##args)
 #define PRINTSHORT(FORMAT,args...) printf_P(PSTR(FORMAT),##args)
@@ -90,17 +90,34 @@
 uint8_t mac_address[8] EEMEM = {0x02, 0x11, 0x22, 0xff, 0xfe, 0x33, 0x44, 0x55};
 
 
+#if UIP_CONF_ROUTER
+
+#ifndef UIP_ROUTER_MODULE
+#ifdef UIP_CONF_ROUTER_MODULE
+#define UIP_ROUTER_MODULE UIP_CONF_ROUTER_MODULE
+#else /* UIP_CONF_ROUTER_MODULE */
+#define UIP_ROUTER_MODULE rimeroute
+#endif /* UIP_CONF_ROUTER_MODULE */
+#endif /* UIP_ROUTER_MODULE */
+
+extern const struct uip_router UIP_ROUTER_MODULE;
+
+#endif /* UIP_CONF_ROUTER */
+
+
 void
 init_lowlevel(void)
 {
-
   /* Second rs232 port for debugging */
-  rs232_init(RS232_PORT_1, USART_BAUD_115200,
+  rs232_init(RS232_PORT_1, USART_BAUD_57600,
              USART_PARITY_NONE | USART_STOP_BITS_1 | USART_DATA_BITS_8);
 
   /* Redirect stdout to second port */
   rs232_redirect_stdout(RS232_PORT_1);
-  
+  rs232_set_input(RS232_PORT_1, serial_line_input_byte);
+
+  printf_P(PSTR("\n******** CONTIKI@AVR-Zigbit low level Initalization *********\n"));
+
   /* Clock */
   clock_init();
  
@@ -159,8 +176,6 @@
 #if ANNOUNCE_BOOT
   printf_P(PSTR("Routing Enabled\n"));
 #endif
-  rime_init(rime_udp_init(NULL));
-  uip_router_register(&rimeroute);
 #endif
 
   process_start(&tcpip_process, NULL);
@@ -182,13 +197,15 @@
   /* Initialize hardware */
   init_lowlevel();
 
+  printf_P(PSTR("\n********BOOTING CONTIKI*********\n"));
+
   /* Register initial processes */
 //  procinit_init();
 
   /* Autostart processes */
   autostart_start(autostart_processes);
 
-  printf_P(PSTR("\n********BOOTING CONTIKI*********\n"));
+  serial_line_init();
 
   printf_P(PSTR("System online.\n"));