Nothing I've said is changed because of TOSSIM.  TOSSIM simulates many
different nodes and they are different nodes.

So the control cells are still not shared.


On Fri, Jun 18, 2010 at 7:09 PM, Pedro Nunes <[email protected]> wrote:

> Hello, Eric.
>
> First of all, sorry for the misunderstanding -- I forgot to mention I was
> working with TOSSIM.
>
> I've been trying to find the piece of code responsible for instantiating
> the several motes used within a simulation. I was convinced that although we
> had N motes running on the simulator, they would all share the same modules
> and configurations and therefore the same data fields (which would be messy,
> I know). On the other hand, I knew from the start that that wasn't the
> correct behavior of WSN's and it was hard for me to believe that the
> simulator would really work that way.
>
> So my question is: how does TOSSIM handle the instantiation of N motes? And
> where does it do it?
>
> Kind regards,
> Pedro Nunes
>
> On Sat, Jun 19, 2010 at 2:59 AM, Eric Decker <[email protected]> wrote:
>
>>
>>
>> On Fri, Jun 18, 2010 at 4:37 AM, Pedro Nunes <[email protected]> wrote:
>>
>>> Hi all.
>>>
>>> I have a non-generic module with an uint8_t array inside.
>>> That module has a command like this:
>>>
>>> command SomeModule.setValue(int something) {
>>>     array[sim_node()] = something;
>>> }
>>>
>>> I was expecting that this array would be "global" for all motes and they
>>> would share it
>>>
>>
>> I don't understand why you think "array" would be global within a mote let
>> alone across motes.
>>
>> There is no nesc construct for declaring an object that is global across
>> multiple entities.  nesc is a language extension built on top of C that
>> forces compartmentalization for systems design.  It is only symantically
>> relevant to a module.  There are no constructs in nesc for sharing global
>> objects across motes or for that matter across modules.  The whole intent of
>> nesc is to provide a structure that forces very well defined interfaces
>> between components of a system.
>>
>>
>>> (although this is not what WSN's are supposed to do) -- but as far as I
>>> know about nesC, this was the expected behavior.
>>>
>>
>> not sure why you are concluding that.
>>
>>
>> module globals are unique to a module.  A module global is something like:
>>
>> module exampleP {}
>> implementation {
>>     uint32_t blah;
>>
>>
>>     ...
>>
>>     command SomeModule.setValue(uint32_t something) {
>>         blah = something;
>>     }
>> }
>>
>> blah is global only to the module exampleP.  It is not global to the mote
>> nor across the network.
>>
>>
>> Hopefully that clears things up.
>>
>> eric
>>
>>
>>
>>> Instead, I got each mote having its own array without sharing its content
>>> with any other mote.
>>>
>>> Could anyone please enlight me with a logical explanation on why is this
>>> happening?
>>>
>>> Regards,
>>> Pedro Nunes
>>>
>>> _______________________________________________
>>> Tinyos-help mailing list
>>> [email protected]
>>> https://www.millennium.berkeley.edu/cgi-bin/mailman/listinfo/tinyos-help
>>>
>>
>>
>>
>> --
>> Eric B. Decker
>> Senior (over 50 :-) Researcher
>>
>>
>>
>


-- 
Eric B. Decker
Senior (over 50 :-) Researcher
_______________________________________________
Tinyos-help mailing list
[email protected]
https://www.millennium.berkeley.edu/cgi-bin/mailman/listinfo/tinyos-help

Reply via email to