On Fri, Jun 18, 2010 at 4:37 AM, Pedro Nunes <pmrnu...@gmail.com> 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
> Tinyos-help@millennium.berkeley.edu
> https://www.millennium.berkeley.edu/cgi-bin/mailman/listinfo/tinyos-help
>



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

Reply via email to