Contiki 3.x
contiki-z1-main.c
1 /*
2  * Copyright (c) 2006, Swedish Institute of Computer Science
3  * All rights reserved.
4  *
5  * Redistribution and use in source and binary forms, with or without
6  * modification, are permitted provided that the following conditions
7  * are met:
8  * 1. Redistributions of source code must retain the above copyright
9  * notice, this list of conditions and the following disclaimer.
10  * 2. Redistributions in binary form must reproduce the above copyright
11  * notice, this list of conditions and the following disclaimer in the
12  * documentation and/or other materials provided with the distribution.
13  * 3. Neither the name of the Institute nor the names of its contributors
14  * may be used to endorse or promote products derived from this software
15  * without specific prior written permission.
16  *
17  * THIS SOFTWARE IS PROVIDED BY THE INSTITUTE AND CONTRIBUTORS ``AS IS'' AND
18  * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
19  * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
20  * ARE DISCLAIMED. IN NO EVENT SHALL THE INSTITUTE OR CONTRIBUTORS BE LIABLE
21  * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
22  * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
23  * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
24  * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
25  * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
26  * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
27  * SUCH DAMAGE.
28  *
29  */
30 
31 #include <stdio.h>
32 #include <string.h>
33 #include <stdarg.h>
34 
35 #include "contiki.h"
36 #include "cc2420.h"
37 #include "dev/leds.h"
38 #include "dev/serial-line.h"
39 #include "dev/slip.h"
40 #include "dev/uart0.h"
41 #include "dev/watchdog.h"
42 #include "dev/xmem.h"
43 #include "lib/random.h"
44 #include "net/netstack.h"
45 #include "net/mac/frame802154.h"
46 #include "dev/button-sensor.h"
47 #include "dev/adxl345.h"
48 #include "sys/clock.h"
49 
50 #include "dev/reset-sensor.h"
51 #if NETSTACK_CONF_WITH_IPV6
52 #include "net/ipv6/uip-ds6.h"
53 #endif /* NETSTACK_CONF_WITH_IPV6 */
54 
55 #include "net/rime/rime.h"
56 
57 #include "sys/node-id.h"
58 #include "cfs-coffee-arch.h"
59 #include "cfs/cfs-coffee.h"
60 #include "sys/autostart.h"
61 
62 #include "dev/battery-sensor.h"
63 #include "dev/button-sensor.h"
64 #include "dev/sht11/sht11-sensor.h"
65 
66 SENSORS(&button_sensor);
67 
68 extern unsigned char node_mac[8];
69 
70 #if DCOSYNCH_CONF_ENABLED
71 static struct timer mgt_timer;
72 #endif
73 
74 #ifndef NETSTACK_CONF_WITH_IPV4
75 #define NETSTACK_CONF_WITH_IPV4 0
76 #endif
77 
78 #if NETSTACK_CONF_WITH_IPV4
79 #include "net/ip/uip.h"
80 #include "net/ipv4/uip-fw.h"
81 #include "net/uip-fw-drv.h"
82 #include "net/ipv4/uip-over-mesh.h"
83 static struct uip_fw_netif slipif =
84 { UIP_FW_NETIF(192, 168, 1, 2, 255, 255, 255, 255, slip_send) };
85 static struct uip_fw_netif meshif =
86 { UIP_FW_NETIF(172, 16, 0, 0, 255, 255, 0, 0, uip_over_mesh_send) };
87 
88 #endif /* NETSTACK_CONF_WITH_IPV4 */
89 
90 #define UIP_OVER_MESH_CHANNEL 8
91 #if NETSTACK_CONF_WITH_IPV4
92 static uint8_t is_gateway;
93 #endif /* NETSTACK_CONF_WITH_IPV4 */
94 
95 #ifdef EXPERIMENT_SETUP
96 #include "experiment-setup.h"
97 #endif
98 
99 #define DEBUG 1
100 #if DEBUG
101 #include <stdio.h>
102 #define PRINTF(...) printf(__VA_ARGS__)
103 #else
104 #define PRINTF(...)
105 #endif
106 
107 void init_platform(void);
108 
109 /*---------------------------------------------------------------------------*/
110 #if 0
111 int
112 force_float_inclusion()
113 {
114  extern int __fixsfsi;
115  extern int __floatsisf;
116  extern int __mulsf3;
117  extern int __subsf3;
118 
119  return __fixsfsi + __floatsisf + __mulsf3 + __subsf3;
120 }
121 #endif
122 /*---------------------------------------------------------------------------*/
123 void
124 uip_log(char *msg)
125 {
126  puts(msg);
127 }
128 /*---------------------------------------------------------------------------*/
129 #if 0
130 void
131 force_inclusion(int d1, int d2)
132 {
133  snprintf(NULL, 0, "%d", d1 % d2);
134 }
135 #endif
136 /*---------------------------------------------------------------------------*/
137 static void
138 set_rime_addr(void)
139 {
140  linkaddr_t addr;
141  //int i;
142 
143  memset(&addr, 0, sizeof(linkaddr_t));
144 #if NETSTACK_CONF_WITH_IPV6
145  memcpy(addr.u8, node_mac, sizeof(addr.u8));
146 #else
147  if(node_id == 0) {
148  for(i = 0; i < sizeof(linkaddr_t); ++i) {
149  addr.u8[i] = node_mac[7 - i];
150  }
151  } else {
152  addr.u8[0] = node_id & 0xff;
153  addr.u8[1] = node_id >> 8;
154  }
155 #endif
156  linkaddr_set_node_addr(&addr);
157  /*printf("Rime started with address ");
158  for(i = 0; i < sizeof(addr.u8) - 1; i++) {
159  printf("%d.", addr.u8[i]);
160  }
161  printf("%d\n", addr.u8[i]);*/
162 }
163 /*---------------------------------------------------------------------------*/
164 static void
165 print_processes(struct process *const processes[])
166 {
167  /* const struct process * const * p = processes;*/
168  printf("Starting");
169  while(*processes != NULL) {
170  //printf(" '%s'", (*processes)->name);
171  processes++;
172  }
173  putchar('\n');
174 }
175 /*--------------------------------------------------------------------------*/
176 #if NETSTACK_CONF_WITH_IPV4
177 static void
178 set_gateway(void)
179 {
180  if(!is_gateway) {
181  leds_on(LEDS_RED);
182  printf("%d.%d: making myself the IP network gateway.\n\n",
184  printf("IPv4 address of the gateway: %d.%d.%d.%d\n\n",
185  uip_ipaddr_to_quad(&uip_hostaddr));
186  uip_over_mesh_set_gateway(&linkaddr_node_addr);
187  uip_over_mesh_make_announced_gateway();
188  is_gateway = 1;
189  }
190 }
191 #endif /* NETSTACK_CONF_WITH_IPV4 */
192 /*---------------------------------------------------------------------------*/
193 int
194 main(int argc, char **argv)
195 {
196  /*
197  * Initalize hardware.
198  */
199  msp430_cpu_init();
200  clock_init();
201  leds_init();
202  leds_on(LEDS_RED);
203 
204  clock_wait(100);
205 
206  uart0_init(BAUD2UBR(115200)); /* Must come before first printf */
207 #if NETSTACK_CONF_WITH_IPV4
208  slip_arch_init(BAUD2UBR(115200));
209 #endif /* NETSTACK_CONF_WITH_IPV4 */
210 
211  xmem_init();
212 
213  rtimer_init();
214  /*
215  * Hardware initialization done!
216  */
217 
218  /* Restore node id if such has been stored in external mem */
219  node_id_restore();
220 
221  /* If no MAC address was burned, we use the node id or the Z1 product ID */
222  if(!(node_mac[0] | node_mac[1] | node_mac[2] | node_mac[3] |
223  node_mac[4] | node_mac[5] | node_mac[6] | node_mac[7])) {
224 
225 #ifdef SERIALNUM
226  if(!node_id) {
227  PRINTF("Node id is not set, using Z1 product ID\n");
228  node_id = SERIALNUM;
229  }
230 #endif
231  node_mac[0] = 0xc1; /* Hardcoded for Z1 */
232  node_mac[1] = 0x0c; /* Hardcoded for Revision C */
233  node_mac[2] = 0x00; /* Hardcoded to arbitrary even number so that
234  the 802.15.4 MAC address is compatible with
235  an Ethernet MAC address - byte 0 (byte 2 in
236  the DS ID) */
237  node_mac[3] = 0x00; /* Hardcoded */
238  node_mac[4] = 0x00; /* Hardcoded */
239  node_mac[5] = 0x00; /* Hardcoded */
240  node_mac[6] = node_id >> 8;
241  node_mac[7] = node_id & 0xff;
242  }
243 
244  /* Overwrite node MAC if desired at compile time */
245 #ifdef MACID
246 #warning "***** CHANGING DEFAULT MAC *****"
247  node_mac[0] = 0xc1; /* Hardcoded for Z1 */
248  node_mac[1] = 0x0c; /* Hardcoded for Revision C */
249  node_mac[2] = 0x00; /* Hardcoded to arbitrary even number so that
250  the 802.15.4 MAC address is compatible with
251  an Ethernet MAC address - byte 0 (byte 2 in
252  the DS ID) */
253  node_mac[3] = 0x00; /* Hardcoded */
254  node_mac[4] = 0x00; /* Hardcoded */
255  node_mac[5] = 0x00; /* Hardcoded */
256  node_mac[6] = MACID >> 8;
257  node_mac[7] = MACID & 0xff;
258 #endif
259 
260 #ifdef IEEE_802154_MAC_ADDRESS
261  /* for setting "hardcoded" IEEE 802.15.4 MAC addresses */
262  {
263  uint8_t ieee[] = IEEE_802154_MAC_ADDRESS;
264  memcpy(node_mac, ieee, sizeof(uip_lladdr.addr));
265  node_mac[7] = node_id & 0xff;
266  }
267 #endif /* IEEE_802154_MAC_ADDRESS */
268 
269  /*
270  * Initialize Contiki and our processes.
271  */
272  process_init();
273  process_start(&etimer_process, NULL);
274 
275  ctimer_init();
276 
277  init_platform();
278 
279  set_rime_addr();
280 
281  cc2420_init();
282 #ifndef FESHIE_NO_ACC
283  accm_init();
284 #endif // FESHIE_NO_ACC
285  {
286  uint8_t longaddr[8];
287  uint16_t shortaddr;
288 
289  shortaddr = (linkaddr_node_addr.u8[0] << 8) +
290  linkaddr_node_addr.u8[1];
291  memset(longaddr, 0, sizeof(longaddr));
292  linkaddr_copy((linkaddr_t *)&longaddr, &linkaddr_node_addr);
293  //printf("MAC %02x:%02x:%02x:%02x:%02x:%02x:%02x:%02x ",
294  // longaddr[0], longaddr[1], longaddr[2], longaddr[3],
295  // longaddr[4], longaddr[5], longaddr[6], longaddr[7]);
296 
297  cc2420_set_pan_addr(IEEE802154_PANID, shortaddr, longaddr);
298  }
299 
300  leds_off(LEDS_ALL);
301 
302 #ifdef SERIALNUM
303  PRINTF("Ref ID: %u\n", SERIALNUM);
304 #endif
305  PRINTF(CONTIKI_VERSION_STRING " started. ");
306 
307  if(node_id) {
308  PRINTF("Node id is set to %u.\n", node_id);
309  } else {
310  PRINTF("Node id not set\n");
311  }
312 
313 #if NETSTACK_CONF_WITH_IPV6
314  memcpy(&uip_lladdr.addr, node_mac, sizeof(uip_lladdr.addr));
315  /* Setup nullmac-like MAC for 802.15.4 */
316 /* sicslowpan_init(sicslowmac_init(&cc2420_driver)); */
317 /* printf(" %s channel %u\n", sicslowmac_driver.name, CC2420_CONF_CHANNEL); */
318 
319  /* Setup X-MAC for 802.15.4 */
320  queuebuf_init();
321 
322  NETSTACK_RDC.init();
323  NETSTACK_MAC.init();
324  NETSTACK_NETWORK.init();
325 
326  /*printf("%s %s, channel check rate %lu Hz, radio channel %u\n",
327  NETSTACK_MAC.name, NETSTACK_RDC.name,
328  CLOCK_SECOND / (NETSTACK_RDC.channel_check_interval() == 0 ? 1 :
329  NETSTACK_RDC.channel_check_interval()),
330  CC2420_CONF_CHANNEL);
331  */
332 
333  process_start(&tcpip_process, NULL);
334 
335  printf("Tentative link-local IPv6 address ");
336  {
337  uip_ds6_addr_t *lladdr;
338  int i;
339  lladdr = uip_ds6_get_link_local(-1);
340  for(i = 0; i < 7; ++i) {
341  printf("%02x%02x:", lladdr->ipaddr.u8[i * 2],
342  lladdr->ipaddr.u8[i * 2 + 1]);
343  }
344  printf("%02x%02x\n", lladdr->ipaddr.u8[14], lladdr->ipaddr.u8[15]);
345  }
346 
347  if(!UIP_CONF_IPV6_RPL) {
348  uip_ipaddr_t ipaddr;
349  int i;
350  uip_ip6addr(&ipaddr, 0xaaaa, 0, 0, 0, 0, 0, 0, 0);
351  uip_ds6_set_addr_iid(&ipaddr, &uip_lladdr);
352  uip_ds6_addr_add(&ipaddr, 0, ADDR_TENTATIVE);
353  printf("Tentative global IPv6 address ");
354  for(i = 0; i < 7; ++i) {
355  printf("%02x%02x:",
356  ipaddr.u8[i * 2], ipaddr.u8[i * 2 + 1]);
357  }
358  printf("%02x%02x\n",
359  ipaddr.u8[7 * 2], ipaddr.u8[7 * 2 + 1]);
360  }
361 
362 #else /* NETSTACK_CONF_WITH_IPV6 */
363 
364  NETSTACK_RDC.init();
365  NETSTACK_MAC.init();
366  NETSTACK_NETWORK.init();
367 
368  printf("%s %s, channel check rate %lu Hz, radio channel %u\n",
369  NETSTACK_MAC.name, NETSTACK_RDC.name,
370  CLOCK_SECOND / (NETSTACK_RDC.channel_check_interval() == 0 ? 1 :
371  NETSTACK_RDC.channel_check_interval()),
372  CC2420_CONF_CHANNEL);
373 #endif /* NETSTACK_CONF_WITH_IPV6 */
374 
375 #if !NETSTACK_CONF_WITH_IPV4 && !NETSTACK_CONF_WITH_IPV6
376  uart0_set_input(serial_line_input_byte);
377  serial_line_init();
378 #endif
379 
380  leds_off(LEDS_GREEN);
381 
382 #if TIMESYNCH_CONF_ENABLED
383  timesynch_init();
385 #endif /* TIMESYNCH_CONF_ENABLED */
386 
387 #if NETSTACK_CONF_WITH_IPV4
388  process_start(&tcpip_process, NULL);
389  process_start(&uip_fw_process, NULL); /* Start IP output */
390  process_start(&slip_process, NULL);
391 
392  slip_set_input_callback(set_gateway);
393 
394  {
395  uip_ipaddr_t hostaddr, netmask;
396 
397  uip_init();
398 
399  uip_ipaddr(&hostaddr, 172, 16,
401  uip_ipaddr(&netmask, 255, 255, 0, 0);
402  uip_ipaddr_copy(&meshif.ipaddr, &hostaddr);
403 
404  uip_sethostaddr(&hostaddr);
405  uip_setnetmask(&netmask);
406  uip_over_mesh_set_net(&hostaddr, &netmask);
407  /* uip_fw_register(&slipif);*/
408  uip_over_mesh_set_gateway_netif(&slipif);
409  uip_fw_default(&meshif);
410  uip_over_mesh_init(UIP_OVER_MESH_CHANNEL);
411  printf("uIP started with IP address %d.%d.%d.%d\n",
412  uip_ipaddr_to_quad(&hostaddr));
413  }
414 #endif /* NETSTACK_CONF_WITH_IPV4 */
415 
416  energest_init();
417  ENERGEST_ON(ENERGEST_TYPE_CPU);
418 
419  //update reset counter
420  reset_sensor.configure(SENSORS_ACTIVE,1); //update reet counter
421  printf("Reset Count %d \n",reset_sensor.value(0)); //print rurrent reset count
422 
423  print_processes(autostart_processes);
424  autostart_start(autostart_processes);
425 
426  /*
427  * This is the scheduler loop.
428  */
429 #if DCOSYNCH_CONF_ENABLED
430  timer_set(&mgt_timer, DCOSYNCH_PERIOD * CLOCK_SECOND);
431 #endif
432  watchdog_start();
433  /* watchdog_stop();*/
434  while(1) {
435  int r;
436  do {
437  /* Reset watchdog. */
439  r = process_run();
440  } while(r > 0);
441 
442  /*
443  * Idle processing.
444  */
445  int s = splhigh(); /* Disable interrupts. */
446  /* uart0_active is for avoiding LPM3 when still sending or receiving */
447  if(process_nevents() != 0 || uart0_active()) {
448  splx(s); /* Re-enable interrupts. */
449  } else {
450  static unsigned long irq_energest = 0;
451 
452 #if DCOSYNCH_CONF_ENABLED
453  /* before going down to sleep possibly do some management */
454  if(timer_expired(&mgt_timer)) {
455  timer_reset(&mgt_timer);
456  msp430_sync_dco();
457  }
458 #endif
459 
460  /* Re-enable interrupts and go to sleep atomically. */
461  ENERGEST_OFF(ENERGEST_TYPE_CPU);
462  ENERGEST_ON(ENERGEST_TYPE_LPM);
463  /* We only want to measure the processing done in IRQs when we
464  are asleep, so we discard the processing time done when we
465  were awake. */
466  energest_type_set(ENERGEST_TYPE_IRQ, irq_energest);
467  watchdog_stop();
468  _BIS_SR(GIE | SCG0 | SCG1 | CPUOFF); /* LPM3 sleep. This
469  statement will block
470  until the CPU is
471  woken up by an
472  interrupt that sets
473  the wake up flag. */
474 
475  /* We get the current processing time for interrupts that was
476  done during the LPM and store it for next time around. */
477  dint();
478  irq_energest = energest_type_time(ENERGEST_TYPE_IRQ);
479  eint();
480  watchdog_start();
481  ENERGEST_OFF(ENERGEST_TYPE_LPM);
482  ENERGEST_ON(ENERGEST_TYPE_CPU);
483  }
484  }
485 
486  return 0;
487 }
488 /*---------------------------------------------------------------------------*/
489 
490 void
491 clock_delay_usec(uint16_t usec)
492 {
493  clock_delay(usec / 100);
494 }
495 
496 #if LOG_CONF_ENABLED
497 void
498 log_message(char *m1, char *m2)
499 {
500  printf("%s%s\n", m1, m2);
501 }
502 #endif /* LOG_CONF_ENABLED */
503 
void uip_log(char *msg)
Print out a uIP log message.
#define uip_sethostaddr(addr)
Set the IP address of this host.
Definition: uip.h:192
static uip_ipaddr_t ipaddr
Pointer to prefix information option in uip_buf.
Definition: uip-nd6.c:129
void uart0_init(unsigned long ubr)
Initalize the RS232 port.
Definition: uart0.c:143
void timer_reset(struct timer *t)
Reset the timer with the same interval.
Definition: timer.c:85
#define uip_ipaddr(addr, addr0, addr1, addr2, addr3)
Construct an IP address from four bytes.
Definition: uip.h:956
void timesynch_set_authority_level(int level)
Set the authority level of the current time.
static uip_ds6_addr_t * addr
Pointer to a router list entry.
Definition: uip-nd6.c:124
uint8_t slip_send(void)
Send an IP packet from the uIP buffer with SLIP.
Definition: slip.c:193
Header file for IPv6-related data structures.
void timer_set(struct timer *t, clock_time_t interval)
Set a timer.
Definition: timer.c:64
uip_ipaddr_t ipaddr
The IP address of this interface.
Definition: uip-fw.h:57
A timer.
Definition: timer.h:86
void watchdog_stop(void)
Stops the WDT such that it won't timeout and cause MCU reset.
Definition: watchdog.c:58
Header file for tunnelling uIP over Rime mesh
void clock_init(void)
Initialize the clock library.
Definition: clock.c:76
#define uip_ipaddr_copy(dest, src)
Copy an IP address from one place to another.
Definition: uip.h:1027
int process_run(void)
Run the system once - call poll handlers and process one event.
Definition: process.c:302
Unicast address structure.
Definition: uip-ds6.h:202
void slip_arch_init(unsigned long ubr)
Initalize the RS232 port and the SLIP driver.
Definition: slip-arch.c:56
void slip_set_input_callback(void(*c)(void))
Set a function to be called when there is activity on the SLIP interface; used for detecting if a nod...
Definition: slip.c:143
SENSORS & button_sensor
Copyright (c) 2014, Analog Devices, Inc.
uip_ipaddr_t netmask
The netmask of the interface.
Definition: uip-fw.h:58
Header file for the Rime stack
#define uip_setnetmask(addr)
Set the netmask.
Definition: uip.h:236
#define NULL
The null pointer.
#define uip_ipaddr_to_quad(a)
Convert an IP address to four bytes separated by commas.
Definition: uip.h:928
Coffee architecture-dependent header for the Zolertia Z1 platform.
802.15.4 frame creation and parsing functions
uIP packet forwarding header file.
void linkaddr_set_node_addr(linkaddr_t *t)
Set the address of the current node.
Definition: linkaddr.c:72
#define UIP_FW_NETIF(ip1, ip2, ip3, ip4, nm1, nm2, nm3, nm4, outputfunc)
Instantiating macro for a uIP network interface.
Definition: uip-fw.h:80
void watchdog_periodic(void)
Writes the WDT clear sequence.
Definition: watchdog.c:64
#define ADDR_TENTATIVE
Possible states for the an address (RFC 4862)
Definition: uip-ds6.h:153
#define CLOCK_SECOND
A second, measured in system clock time.
Definition: clock.h:82
#define uip_ip6addr(addr, addr0, addr1, addr2, addr3, addr4, addr5, addr6, addr7)
Construct an IPv6 address from eight 16-bit words.
Definition: uip.h:970
Header file for the uIP TCP/IP stack.
void clock_delay(unsigned int delay)
Obsolete delay function but we implement it here since some code still uses it.
Definition: clock.c:60
void process_start(struct process *p, process_data_t data)
Start a process.
Definition: process.c:99
Header for the Coffee file system.
uip_ds6_addr_t * uip_ds6_addr_add(uip_ipaddr_t *ipaddr, unsigned long vlifetime, uint8_t type)
Add a unicast address to the interface.
Definition: uip-ds6.c:326
Header file for module for automatically starting and exiting a list of processes.
void clock_wait(clock_time_t t)
Wait for a given number of ticks.
Definition: clock.c:162
void timesynch_init(void)
Initialize the timesynch module.
void rtimer_init(void)
Initialize the real-time scheduler.
Definition: rtimer.c:61
Generic serial I/O process header filer.
CCIF uip_lladdr_t uip_lladdr
Host L2 address.
Definition: uip.c:118
void uip_init(void)
uIP initialization function.
Definition: uip.c:363
int process_nevents(void)
Number of events waiting to be processed.
Definition: process.c:316
void process_init(void)
Initialize the process module.
Definition: process.c:208
void ctimer_init(void)
Initialize the callback timer library.
Definition: ctimer.c:91
void linkaddr_copy(linkaddr_t *dest, const linkaddr_t *src)
Copy a Rime address.
Definition: linkaddr.c:60
linkaddr_t linkaddr_node_addr
The Rime address of the node.
Definition: linkaddr.c:48
int serial_line_input_byte(unsigned char c)
Get one byte of input from the serial driver.
Definition: serial-line.c:60
void watchdog_start(void)
Starts the WDT in watchdog mode if enabled by user configuration, maximum interval.
Definition: watchdog.c:49
void clock_delay_usec(uint16_t usec)
Delay a given number of microseconds.
Include file for the Contiki low-layer network stack (NETSTACK)
void uip_ds6_set_addr_iid(uip_ipaddr_t *ipaddr, uip_lladdr_t *lladdr)
set the last 64 bits of an IP address based on the MAC address
Definition: uip-ds6.c:542
void uip_fw_default(struct uip_fw_netif *netif)
Register a default network interface.
Definition: uip-fw.c:515
int timer_expired(struct timer *t)
Check if a timer has expired.
Definition: timer.c:122
Representation of a uIP network interface.
Definition: uip-fw.h:54