Professional Documents
Culture Documents
• Main.exe [noOfNodes]
• Export dbg=USR1
Running
• Main [options] num_nodes
-gui For tinyViz
-a=<model> ADC model (generic,random)
-b=<sec> boot time
-l=<scale> Scales Realtime
-r=<model> simple/lossy
-rf=<file> files for loss(Default lossy.nss)
-s=<num> no of nodes to boot
-t=<sec> virtual seconds
num_nodes number of nodes to simulate
TinyViz
• TinyViz: GUI tool for TOSSIM
• Plugin Model (You can write your own plugin)
• Plugins:
– Neighborhood graph
– Radio links
– Sent radio packets
– Calamari
– Directed Graph
NesC
• nesC (pronounced "NES-see") is an extension to
the C programming language designed to embody
the structuring concepts and execution model of
TinyOS.
– Components
– Interfaces
– Modules
– Configuration
– Commands
– Events
Components
• A nesC application consists of one or more
components linked together to form an
executable.
• A component provides and uses interfaces.
• These interfaces are the only point of access
to the component and are bi-directional.
Interfaces
Main.StdControl ->dllM;
Main.StdControl ->Comm;
StdControl = dllM;
Send = dllM;
Receive = dllM;
}
dllM.nc
includes dll;
module dllM {
provides {
interface StdControl;
interface Send;
interface Receive;
}
uses {
interface ReceiveMsg;
interface SendMsg;
}
}
implementation {
struct TOS_Msg data;
interface Receive
{
event result_t receive(char * data);
}
dllM.nc
command result_t Send.send(char* buff, uint32_t addr) {
int i=0;
Msg * message = (Msg *)data.data;
message->val = "hello";
while(i<10)
{
i++;
dbg(DBG_USR1, "Sending Message \n");
if(TOS_LOCAL_ADDRESS != 1)
call SendMsg.send(1,sizeof(Msg),&data);
}
return SUCCESS;
}
Main.StdControl ->dll;
Main.StdControl ->appM;
• Compiling
• Running
• TinyViz
Questions