Introduction
Running an example consists of five stages. These steps are common for most of the applications.
- tx1.cc file is edited to assign each node their application. Note that NesCT provides a multi-application simulation environment. Therefore, every node may run different application.
- NesCT is run over each TinyOS application to create their corresponding OMNeT++ source codes.
- A makefile for your platform is generated
- the application is linked and the executable file is created in the directory.
- You run the simulation
Note that, if you receive compliation errors, do not forget to check
wiki
pages for help.
Node Application Assignment
Updating txc1.cc consists of two phases. First, you need to add
application
specific include statements to the top of the file and then add the
object
instantiation and method calls to the initialize function.
NesCT example package already comes configured with Surge application as
an
example. You need to replace these calls with yours. If you have a look
at
txc1.cc, you'll see
#include "gen/cSurge_TinyOSModule.h"
#include "gen/cSurge_Main.h"
and at void Txc1::initialize() method you'll see
cSurge_Main *m = new cSurge_Main(this,main,"Main",getIndex());
m->StdControl_init();
m->StdControl_start();
Now, suppose you want to try the Blink example. from
http://nesct.sourceforge.net/blink.html
Node configuration listing shows:
#include "gen/cBlink_TinyOSModule.h"
#include "gen/cBlink_Main.h"
cBlink_Main *m = new cBlink_Main(this,main,"Main",getIndex());
m->StdControl_init();
m->StdControl_start();
What you need to do is to replace
#include "gen/cSurge_TinyOSModule.h"
#include "gen/cSurge_Main.h"
with
#include "gen/cBlink_TinyOSModule.h"
#include "gen/cBlink_Main.h"
and
cSurge_Main *m = new cSurge_Main(this,main,"Main",getIndex());
m->StdControl_init();
m->StdControl_start();
with
cBlink_Main *m = new cBlink_Main(this,main,"Main",getIndex());
m->StdControl_init();
m->StdControl_start();
Browse the example links on the right.