Skip to content

Commit

Permalink
Removed default reliance on uIP
Browse files Browse the repository at this point in the history
  • Loading branch information
adamdunkels committed Mar 28, 2007
1 parent 210574c commit d1b791f
Showing 1 changed file with 9 additions and 25 deletions.
34 changes: 9 additions & 25 deletions platform/esb/contiki-esb-default-init-net.c
Original file line number Diff line number Diff line change
Expand Up @@ -28,39 +28,23 @@
*
* This file is part of the Contiki operating system.
*
* @(#)$Id: contiki-esb-default-init-net.c,v 1.4 2007/03/15 21:53:15 adamdunkels Exp $
* @(#)$Id: contiki-esb-default-init-net.c,v 1.5 2007/03/28 20:34:33 adamdunkels Exp $
*/

#include "contiki-esb.h"

static struct uip_fw_netif tr1001if =
{UIP_FW_NETIF(0,0,0,0, 0,0,0,0, tr1001_uip_send)};

static struct uip_fw_netif slipif =
{UIP_FW_NETIF(172,16,0,0, 255,255,255,0, slip_send)};

#define NODE_ID (node_id & 0xFF)
#include "net/rime.h"

void
init_net(void)
{
uip_ipaddr_t hostaddr;
rimeaddr_t rimeaddr;

rime_init();
rimeaddr.u8[0] = node_id >> 8;
rimeaddr.u8[1] = node_id & 0xff;
rimeaddr_set_node_addr(&rimeaddr);

uip_init();
uip_fw_init();

rs232_set_input(slip_input_byte);
rs232_set_input(serial_input_byte);

process_start(&tr1001_uip_process, NULL);
process_start(&slip_process, NULL);
process_start(&uip_fw_process, NULL);
process_start(&tcpip_process, NULL);

if (NODE_ID > 0) {
/* node id is set, construct an ip address based on the node id */
uip_ipaddr(&hostaddr, 172, 16, 1, NODE_ID);
uip_sethostaddr(&hostaddr);
}
uip_fw_register(&slipif);
uip_fw_default(&tr1001if);
}

0 comments on commit d1b791f

Please sign in to comment.