On Aug 15, 2010, at 6:23 PM, Sergio Campamá wrote:

> Thank you Philip, hadn't occurred to me to use gdb. I'll try to produce 
> better questions after I study TOSSIM some more. I've managed to follow some 
> function calls but the link between NesC and C, as in sim_mote.h, are a 
> little more difficult to understand.

Ah -- yeah, there's a bunch of layers of indirection in order to simplify SWIG 
support. The problem is we basically need python to be able to call nesC.

The top-level interface to the simulator is C++; SWIG takes these objects and 
generates python bindings for them, which allows you to control TOSSIM from 
python.

The C++ objects call C functions.

These C functions are implemented in nesC files, and can therefore call nesC 
components through commands/events as needed.

For example, Tossim.i has the Mote class, with the function bootAtTime(). So 
you can call this from python. Calling it invokes the C function 
sim_mote_set_start_time(). This C function is implemented in SimMoteP.nc. It's 
convenient to have functionality like this implemented in components because 
then compiling for TOSSIM automatically scales the functionality up to many 
motes (i.e., when you access a component variable, it indexes into an array 
based on what the current node is).

Phil
_______________________________________________
Tinyos-help mailing list
[email protected]
https://www.millennium.berkeley.edu/cgi-bin/mailman/listinfo/tinyos-help

Reply via email to