49 #include "dev/button-sensor.h"
61 SENSORS(&button_sensor);
64 #define SERIAL_ID { 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08 }
67 uint8_t serial_id[] = SERIAL_ID;
68 uint16_t node_id = 0x0102;
77 memset(&addr, 0,
sizeof(linkaddr_t));
79 memcpy(addr.u8, serial_id,
sizeof(addr.u8));
82 for(i = 0; i <
sizeof(linkaddr_t); ++i) {
83 addr.u8[i] = serial_id[7 - i];
86 addr.u8[0] = node_id & 0xff;
87 addr.u8[1] = node_id >> 8;
91 printf(
"Rime started with address ");
92 for(i = 0; i <
sizeof(addr.u8) - 1; i++) {
93 printf(
"%d.", addr.u8[i]);
95 printf(
"%d\n", addr.u8[i]);
102 NETSTACK_RADIO.set_value(RADIO_PARAM_CHANNEL, RF_CHANNEL);
103 NETSTACK_RADIO.get_value(RADIO_PARAM_CHANNEL, &chan);
104 printf(
"RF channel set to %d Hz\n", chan);
107 int contiki_argc = 0;
111 main(
int argc,
char **argv)
119 #if UIP_CONF_IPV6_RPL
120 printf(CONTIKI_VERSION_STRING
" started with IPV6, RPL\n");
122 printf(CONTIKI_VERSION_STRING
" started with IPV6\n");
125 printf(CONTIKI_VERSION_STRING
" started\n");
142 printf(
"MAC %s RDC %s NETWORK %s\n",
143 NETSTACK_MAC.name, NETSTACK_RDC.name, NETSTACK_NETWORK.name);
149 printf(
"Tentative link-local IPv6 address ");
153 lladdr = uip_ds6_get_link_local(-1);
154 for(i = 0; i < 8; i++) {
155 printf(
"%02x%02x%c", lladdr->ipaddr.u8[i * 2],
156 lladdr->ipaddr.u8[i * 2 + 1],
157 i == 7 ?
'\n' :
':');
160 lladdr->state = ADDR_AUTOCONF;
169 autostart_start(autostart_processes);
181 log_message(
char *m1,
char *m2)
183 printf(
"%s%s\n", m1, m2);
193 _xassert(
const char *file,
int line)
195 printf(
"%s:%u: failed assertion\n", file, line);
CCIF uip_lladdr_t uip_lladdr
Host L2 address.
Unicast address structure.
Header file for the uIP TCP/IP stack.
void rtimer_init(void)
Initialize the real-time scheduler.
void uart_init(const unsigned int uart_num, uint32_t module_clk_hz, const uint32_t baud)
Initialize UART.
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 process_init(void)
Initialize the process module.
Header file for the Rime stack
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 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.
void linkaddr_set_node_addr(linkaddr_t *t)
Set the address of the current node.
void watchdog_init(void)
Copyright (c) 2014, Analog Devices, Inc.
Include file for the Contiki low-layer network stack (NETSTACK)