Contiki 3.x
platform_prints.c
1 /* Temp place to put informational printing that happens a lot in platform code */
2 /* XXX TODO Factor this out to some place, almost all of the platforms use it */
3 
4 #include "contiki.h"
5 #include "net/netstack.h"
6 #include "net/ipv6/uip-ds6.h"
7 
8 void
9 print_processes(struct process * const processes[])
10 {
11  /* const struct process * const * p = processes;*/
12  printf("Starting");
13  while(*processes != NULL) {
14  printf(" '%s'", (*processes)->name);
15  processes++;
16  }
17  printf("\n");
18 }
19 
20 void
21 print_netstack(void) {
22  printf("%s %s, channel check rate %lu Hz, radio channel %u\n",
23  NETSTACK_MAC.name, NETSTACK_RDC.name,
24  CLOCK_SECOND / (NETSTACK_RDC.channel_check_interval() == 0 ? 1:
25  NETSTACK_RDC.channel_check_interval()),
26  RF_CHANNEL);
27 }
28 
29 void print_lladdrs(void) {
30  int i, a;
31  printf("Tentative link-local IPv6 address ");
32 
33  for(a = 0; a < UIP_DS6_ADDR_NB; a++) {
34  if (uip_ds6_if.addr_list[a].isused) {
35  for(i = 0; i < 7; ++i) {
36  printf("%02x%02x:",
37  uip_ds6_if.addr_list[a].ipaddr.u8[i * 2],
38  uip_ds6_if.addr_list[a].ipaddr.u8[i * 2 + 1]);
39  }
40  printf("%02x%02x\n",
41  uip_ds6_if.addr_list[a].ipaddr.u8[14],
42  uip_ds6_if.addr_list[a].ipaddr.u8[15]);
43  }
44  }
45 }
Network interface and stateless autoconfiguration (RFC 4862)
#define NULL
The null pointer.
Include file for the Contiki low-layer network stack (NETSTACK)
#define CLOCK_SECOND
A second, measured in system clock time.
Definition: clock.h:82