53 #define PRINTF(...) printf(__VA_ARGS__)
62 #define UIP_OVER_MESH_CHANNEL 8
67 #warning Using user defined node id
70 static unsigned char id[8] = { 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, NODE_ID };
80 memcpy(addr.u8,
id,
sizeof(addr.u8));
83 PRINTF(
"Rime started with address ");
84 PRINTF(
"%d", addr.u8[0]);
85 for(i = 1; i <
sizeof(addr.u8); i++) {
86 PRINTF(
".%d", addr.u8[i]);
95 id[0] = (((
SIM->UIDL) >> (8 * 0)) & 0xFF) | 0x02;
96 id[1] = ((
SIM->UIDL) >> (8 * 1)) & 0xFF;
97 id[2] = ((
SIM->UIDL) >> (8 * 2)) & 0xFF;
98 id[3] = ((
SIM->UIDL) >> (8 * 3)) & 0xFF;
99 id[4] = ((
SIM->UIDML) >> (8 * 0)) & 0xFF;
100 id[5] = ((
SIM->UIDML) >> (8 * 1)) & 0xFF;
101 id[6] = ((
SIM->UIDML) >> (8 * 2)) & 0xFF;
102 id[7] = ((
SIM->UIDML) >> (8 * 3)) & 0xFF;
110 NETSTACK_RADIO.init();
117 memset(longaddr, 0,
sizeof(longaddr));
121 rf230_set_channel(RF_CHANNEL);
128 NETSTACK_NETWORK.init();
130 PRINTF(
"%s %s, channel check rate %d Hz, radio channel %d\n",
131 NETSTACK_MAC.name, NETSTACK_RDC.name,
132 CLOCK_SECOND / (NETSTACK_RDC.channel_check_interval() == 0 ? 1 :
133 NETSTACK_RDC.channel_check_interval()),
138 PRINTF(
"Tentative link-local IPv6 address ");
142 lladdr = uip_ds6_get_link_local(-1);
143 for(i = 0; i < 7; ++i) {
144 PRINTF(
"%04x:", lladdr->ipaddr.u8[i * 2] * 256 +
145 lladdr->ipaddr.u8[i * 2 + 1]);
147 PRINTF(
"%04x\n", lladdr->ipaddr.u8[14] * 256 + lladdr->ipaddr.u8[15]);
150 if(!UIP_CONF_IPV6_RPL) {
156 PRINTF(
"Tentative global IPv6 address ");
157 for(i = 0; i < 7; ++i) {
159 ipaddr.u8[i * 2] * 256 + ipaddr.u8[i * 2 + 1]);
162 ipaddr.u8[7 * 2] * 256 + ipaddr.u8[7 * 2 + 1]);
#define IEEE802154_CONF_PANID
Default PAN ID: TI.
linkaddr_t linkaddr_node_addr
The Rime address of the node.
CCIF uip_lladdr_t uip_lladdr
Host L2 address.
802.15.4 frame creation and parsing functions
Unicast address structure.
uip_ipaddr_t ipaddr
The IP address of this interface.
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
Network interface and stateless autoconfiguration (RFC 4862)
#define NULL
The null pointer.
#define SIM
Peripheral SIM base pointer.
K60 hardware register header wrapper.
void linkaddr_copy(linkaddr_t *dest, const linkaddr_t *src)
Copy a Rime address.
Header file for the Rime queue buffer management
void process_start(struct process *p, process_data_t data)
Start a process.
#define ADDR_TENTATIVE
Possible states for the an address (RFC 4862)
void linkaddr_set_node_addr(linkaddr_t *t)
Set the address of the current node.
#define uip_ip6addr(addr, addr0, addr1, addr2, addr3, addr4, addr5, addr6, addr7)
Construct an IPv6 address from eight 16-bit words.
int(* off)(void)
Turn the radio off.
Include file for the Contiki low-layer network stack (NETSTACK)
#define CLOCK_SECOND
A second, measured in system clock time.