On Mar 7, 2006, at 7:49 PM, Avinash Sridharan wrote:

Hi All,
I have variables defined in an implementation section of the module (that is these variables are present for the whole scope of the implementation. How does TOSSIM handle these variables ? I do not have any timers in my code and it seems TOSSIM resets these variables. This code works well in a real scenario since I have tested them on micaz, but wanted to simulated a larger network on TOSSIM hence trying to simulate it on TOSSIM.


I don't understand what you're asking. If you define variables outside of a component (e.g., in C), then TOSSIM does not handle them properly. It basically works by making a module variable:

module X {...}
implementation {
  uint8_t x;
  ...
}

into an array:

X$x[TOSSIM_MAX_NODES]

then when you're node 43 you access element 43 of the array.

TOSSIM also has an "init" call for returning all variables to the boot state. This is so you can reboot motes in simulation. Normally the boot sequence does this for you.

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

Reply via email to