43 #include <avr/pgmspace.h>
47 #include "dev/rs232.h"
53 #include "dev/ds2401.h"
63 #include "net/uip-fw-drv.h"
68 {
UIP_FW_NETIF(172,16,0,0, 255,255,0,0, uip_over_mesh_send)};
70 static uint8_t is_gateway;
74 #define UIP_OVER_MESH_CHANNEL 8
83 memset(&addr, 0,
sizeof(rimeaddr_t));
85 memcpy(addr.u8, ds2401_id,
sizeof(addr.u8));
88 for(i = 0; i <
sizeof(rimeaddr_t); ++i) {
89 addr.u8[i] = ds2401_id[7 - i];
92 addr.u8[0] = node_id & 0xff;
93 addr.u8[1] = node_id >> 8;
97 printf_P(PSTR(
"Rime started with address "));
98 for(i = 0; i <
sizeof(addr.u8) - 1; i++) {
99 printf_P(PSTR(
"%d."), addr.u8[i]);
101 printf_P(PSTR(
"%d\n"), addr.u8[i]);
111 printf_P(PSTR(
"%d.%d: making myself the IP network gateway.\n\n"),
113 printf_P(PSTR(
"IPv4 address of the gateway: %d.%d.%d.%d\n\n"),
116 uip_over_mesh_make_announced_gateway();
127 NETSTACK_RADIO.init();
134 memset(longaddr, 0,
sizeof(longaddr));
136 printf_P(PSTR(
"MAC %02x:%02x:%02x:%02x:%02x:%02x:%02x:%02x\n"),
137 longaddr[0], longaddr[1], longaddr[2], longaddr[3],
138 longaddr[4], longaddr[5], longaddr[6], longaddr[7]);
140 rf230_set_pan_addr(IEEE802154_PANID, shortaddr, longaddr);
142 rf230_set_channel(RF_CHANNEL);
155 NETSTACK_NETWORK.init();
157 printf_P(PSTR(
"%s %s, channel check rate %d Hz, radio channel %d\n"),
158 NETSTACK_MAC.name, NETSTACK_RDC.name,
159 CLOCK_SECOND / (NETSTACK_RDC.channel_check_interval() == 0 ? 1:
160 NETSTACK_RDC.channel_check_interval()),
165 printf_P(PSTR(
"Tentative link-local IPv6 address "));
169 lladdr = uip_ds6_get_link_local(-1);
170 for(i = 0; i < 7; ++i) {
171 printf_P(PSTR(
"%02x%02x:"), lladdr->ipaddr.u8[i * 2],
172 lladdr->ipaddr.u8[i * 2 + 1]);
174 printf_P(PSTR(
"%02x%02x\n"), lladdr->ipaddr.u8[14], lladdr->ipaddr.u8[15]);
177 if(!UIP_CONF_IPV6_RPL) {
183 printf_P(PSTR(
"Tentative global IPv6 address "));
184 for(i = 0; i < 7; ++i) {
185 printf_P(PSTR(
"%02x%02x:"),
186 ipaddr.u8[i * 2], ipaddr.u8[i * 2 + 1]);
188 printf_P(PSTR(
"%02x%02x\n"),
189 ipaddr.u8[7 * 2], ipaddr.u8[7 * 2 + 1]);
196 NETSTACK_NETWORK.init();
198 printf_P(PSTR(
"%s %s, channel check rate %d Hz, radio channel %d\n"),
199 NETSTACK_MAC.name, NETSTACK_RDC.name,
200 CLOCK_SECOND / (NETSTACK_RDC.channel_check_interval() == 0? 1:
201 NETSTACK_RDC.channel_check_interval()),
216 slip_set_input_callback(set_gateway);
230 uip_over_mesh_set_net(&hostaddr, &netmask);
234 uip_over_mesh_set_gateway_netif(&slipif);
237 uip_over_mesh_init(UIP_OVER_MESH_CHANNEL);
238 printf_P(PSTR(
"uIP started with IP address %d.%d.%d.%d\n"),