46 #include "dev/button-sensor.h"
54 #include "contiki-uart.h"
56 #include "slip-arch.h"
62 SENSORS(&button_sensor);
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);
CCIF uip_lladdr_t uip_lladdr
Host L2 address.
Unicast address structure.
Header file for the uIP TCP/IP stack.
void uart0_init(unsigned long ubr)
Initalize the RS232 port.
Network interface and stateless autoconfiguration (RFC 4862)
#define NULL
The null pointer.
void uip_log(char *msg)
Print out a uIP log message.
void clock_init(void)
Initialize the clock library.
int main(void)
This is main...
void packetbuf_set_datalen(uint16_t len)
Set the length of the data in the packetbuf.
void process_init(void)
Initialize the process module.
Header file for the Rime stack
#define BIT(x)
Useful to reference a single bit of a byte.
Generic serial I/O process header filer.
void watchdog_periodic(void)
Writes the WDT clear sequence.
void ctimer_init(void)
Initialize the callback timer library.
void etimer_request_poll(void)
Make the event timer aware that the clock has changed.
void packetbuf_clear(void)
Clear and reset the packetbuf.
void process_start(struct process *p, process_data_t data)
Start a process.
int process_run(void)
Run the system once - call poll handlers and process one event.
#define PACKETBUF_SIZE
The size of the packetbuf, in bytes.
void linkaddr_set_node_addr(linkaddr_t *t)
Set the address of the current node.
void * packetbuf_dataptr(void)
Get a pointer to the data in the packetbuf.
Include file for the Contiki low-layer network stack (NETSTACK)