PROCESS_THREAD(rimeroute_process, ev, data) { static struct route_discovery_conn route_discovery_conn; rimeaddr_t *dest; PROCESS_BEGIN(); rimeroute_event = process_alloc_event(); route_discovery_open(&route_discovery_conn, CLOCK_SECOND * 10, ROUTE_DISCOVERY_CHANNEL, &route_discovery_callbacks); while(1) { PROCESS_WAIT_EVENT_UNTIL(ev == rimeroute_event); dest = data; PRINTF("discovering route to %d.%d\n", dest->u8[0], dest->u8[1]); route_discovery_discover(&route_discovery_conn, dest, PACKET_TIMEOUT); } route_discovery_close(&route_discovery_conn); PROCESS_END(); }
/*---------------------------------------------------------------------------*/ void mesh_close(struct mesh_conn *c) { multihop_close(&c->multihop); route_discovery_close(&c->route_discovery_conn); }