46 #include "dev/button-sensor.h"
49 #include "net/ipv6/uip-ds6.h"
54 #include "contiki-uart.h"
56 #include "slip-arch.h"
65 #define SERIAL_ID { 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08 }
68 static uint8_t serial_id[] = SERIAL_ID;
69 static uint16_t node_id = 0x0102;
78 memset(&addr, 0,
sizeof(linkaddr_t));
80 memcpy(addr.u8, serial_id,
sizeof(addr.u8));
83 for(i = 0; i <
sizeof(linkaddr_t); ++i) {
84 addr.u8[i] = serial_id[7 - i];
87 addr.u8[0] = node_id & 0xff;
88 addr.u8[1] = node_id >> 8;
92 printf(
"Rime started with address ");
93 for(i = 0; i <
sizeof(addr.u8) - 1; i++) {
94 printf(
"%d.", addr.u8[i]);
96 printf(
"%d" NEWLINE, addr.u8[i]);
106 register unsigned long int i;
107 for(i = 0x000FFFFFUL; i; --i) {
112 main(
int argc,
char **argv)
114 bool flip_flop =
false;
151 #define BIT(n) (1 << (n))
162 #if UIP_CONF_IPV6_RPL
163 printf(CONTIKI_VERSION_STRING
" started with IPV6, RPL" NEWLINE);
165 printf(CONTIKI_VERSION_STRING
" started with IPV6" NEWLINE);
168 printf(CONTIKI_VERSION_STRING
" started" NEWLINE);
184 printf(
"MAC %s RDC %s NETWORK %s" NEWLINE, NETSTACK_MAC.name, NETSTACK_RDC.name, NETSTACK_NETWORK.name);
190 printf(
"Tentative link-local IPv6 address ");
194 lladdr = uip_ds6_get_link_local(-1);
195 for(i = 0; i < 7; ++i) {
196 printf(
"%02x%02x:", lladdr->ipaddr.u8[i * 2],
197 lladdr->ipaddr.u8[i * 2 + 1]);
200 lladdr->state = ADDR_AUTOCONF;
202 printf(
"%02x%02x" NEWLINE, lladdr->ipaddr.u8[14], lladdr->ipaddr.u8[15]);
210 autostart_start(autostart_processes);
215 if(NETSTACK_RADIO.pending_packet()) {
221 NETSTACK_RDC.input();
225 while(uart0_can_getchar()) {
229 if(uart0_input_handler) {
230 uart0_input_handler(c);
239 HEARTBEAT_LED1 = flip_flop;
240 flip_flop = !flip_flop;
241 HEARTBEAT_LED2 = flip_flop;
248 log_message(
char *m1,
char *m2)
250 printf(
"%s%s" NEWLINE, m1, m2);
256 printf(
"%s" NEWLINE, m);