updated uAODV process for new uIP

This commit is contained in:
fros4943 2006-08-21 15:32:29 +00:00
parent facdd73eda
commit f9ca17629a
2 changed files with 7 additions and 4 deletions

View file

@ -1,3 +1,5 @@
se.sics.cooja.GUI.PLUGINS = + VisUAODV UAODVControl se.sics.cooja.GUI.PLUGINS = + VisUAODV UAODVControl
se.sics.cooja.contikimote.ContikiMoteType.C_SOURCES = + uaodv-example.c ## Not needed since update 2006-08-21.
## Processfiles are thrown to compilation explicitly.
#se.sics.cooja.contikimote.ContikiMoteType.C_SOURCES = + uaodv-example.c

View file

@ -26,9 +26,10 @@
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE. * SUCH DAMAGE.
* *
* $Id: uaodv-example.c,v 1.1 2006/08/21 12:13:12 fros4943 Exp $ * $Id: uaodv-example.c,v 1.2 2006/08/21 15:32:29 fros4943 Exp $
*/ */
#include <stdio.h>
#include "contiki-net.h" #include "contiki-net.h"
#include "net/uaodv.h" #include "net/uaodv.h"
#include "net/uaodv-rt.h" #include "net/uaodv-rt.h"
@ -60,9 +61,9 @@ PROCESS_THREAD(uaodv_example_process, ev, data)
while(1) { while(1) {
PROCESS_WAIT_EVENT(); PROCESS_WAIT_EVENT();
if(ev == sensors_event && data == &button_sensor && button_sensor.value(0)) { if(ev == sensors_event && data == &button_sensor && button_sensor.value(0)) {
uip_ipaddr(addr, 10,10,0,1); uip_ipaddr(&addr, 10,10,0,1);
log_message("Sending RREQ to (static) 10.10.0.1\n", ""); log_message("Sending RREQ to (static) 10.10.0.1\n", "");
uaodv_request_route_to(addr); uaodv_request_route_to(&addr);
} else if(ev == serial_event_message) { } else if(ev == serial_event_message) {
sscanf(data, "SENDTO>%d.%d.%d.%d", &ipA, &ipB, &ipC, &ipD); sscanf(data, "SENDTO>%d.%d.%d.%d", &ipA, &ipB, &ipC, &ipD);
sprintf(buf, "Sending RREQ to %d.%d.%d.%d .. \n", ipA, ipB, ipC, ipD); sprintf(buf, "Sending RREQ to %d.%d.%d.%d .. \n", ipA, ipB, ipC, ipD);