Example Application: TinyAODV
This package provides an implementation of a reduced AODV
routing protocol. It supports many RFC features, but
takes into account the reduced capabilities of Wireless Sensor
Network platforms operating over TinyOS.
NST-AODV follows in part the main functionality described on
HSN TinyAODV implementation. For that reason some of the
modules
have a similar structure as the one used in the implementation
mentioned before.
#include "gen/cRelay_TinyOSModule.h" #include "gen/cRelay_Main.h" #include "gen/cTOSBase_TinyOSModule.h" #include "gen/cTOSBase_Main.h" #include "gen/cVersio0Tx_TinyOSModule.h" #include "gen/cVersio0Tx_Main.h" #include "gen/cVersio0Rx_TinyOSModule.h" #include "gen/cVersio0Rx_Main.h" |
Use line.ned residing in ned directory for this demo. You need four nodes in a line. Copy this file over tictoc1.ned in main directory.
NesCT is going to build all the classes in gen directory.
Replace "cp" with "copy" and slash (/) with backslash (\) for
windows operating system at the following instructions.
[root@sinan tictoc]# cd components/
[root@sinan components]# cp TOSBase.nc ../Application.nc
[root@sinan components]# cd ..
[root@sinan tictoc]# ./nesct.exe Application.nc
[root@sinan tictoc]# cd components/
[root@sinan components]# cp Versio0Rx.nc ../Application.nc
[root@sinan components]# cd ..
[root@sinan tictoc]# ./nesct.exe Application.nc
[root@sinan components]# cp Versio0Tx.nc ../Application.nc
[root@sinan components]# cd ..
[root@sinan tictoc]# ./nesct.exe Application.nc
[root@sinan components]# cp Relay.nc ../Application.nc
[root@sinan components]# cd ..
[root@sinan tictoc]# ./nesct.exe Application.nc
done.
Type makemake.bat/makemake.sh to create new Makefile for Win32/Linux.Type "make" to build the binary.
[root@sinan tictoc]# make
g++ -c -g -fpermissive -fPIC -DWITH_NETBUILDER -w
-DTOSNODES=1000 -DLINUX -DPLATFORM_OMNETPP -I./include
-I/root/projects/tinyos-1.x/tos/interfaces -I./include_tos
-I/opt/omnetpp-3.2/include simstart.cc
g++ tictoc1_n.o debug.o simstart.o tinyos.o tinyosmain.o
tossim.o txc1.o -g -L/opt/omnetpp-3.2/lib -lenvir -lcmdenv
-lsim_std -lnedxml -lxml2 -ldl -lstdc++ -lpthread -o tictoc
echo>.tstamp
Let's enable all debug options for demonstration purposes. Use "export" keyword for linux and "set" keyword for windows to change environment variable. You should see an output similar to this in TK window.
[root@sinan tictoc]# export DBG=all
[root@sinan tictoc]# ./tictoc