On Tue, Nov 20, 2012 at 3:00 PM, Nahr Elk <[email protected]> wrote:

> Dear TinyOS users,
>
> I am using TinyOS since 5 years, nonetheless I am still facing problems
> and difficulties to understand its implemented code. Today I am puzzled
> with this snapshot of code:
>
>   async command cc2420_metadata_t *CC2420PacketBody.getMetadata(
> message_t* msg ) {
>     return (cc2420_metadata_t*)msg->metadata;
>   }
>
> My question is How msg has become filled with data?????
>

Your question is pretty orthogonal to what you have presented about.....

What the code you've presented above is doing is getting access to
associated meta data that is part of the message_t structure.

The above code simple grabs a pointer to the metadata that is part of the
message_t structure and says look at it as cc2420 message data.



You question about how does data get filled doesn't really have anything to
do with the above.   {retorical on} Are you asking  how does the metadata
get filled in?   Or are you asking how the packet data get filled in?
 (data portion of message_t).  {/retorical}


If you really want to understand how things work, I would recommend getting
a low level debugger and watch the code work as data comes in and goes out
of the system.

Here is what I use...   I'm building motes that use the msp430f5438a cpu
(but I've done the same thing with telosbs with the msp430f1611 cpus).   I
hook the platform up to the TI JTAG debugging pod and then I debug at the
source level using msp430-gdb etc.

When I need to understand how for example data gets filled in from a packet
I look at how it work starting with the driver.   I think watch it do its
thing as whole packets are handed up the stack.   etc.


>
> All the bests,
> Nahr Elk
> Independent Researcher
>
> _______________________________________________
> Tinyos-help mailing list
> [email protected]
> https://www.millennium.berkeley.edu/cgi-bin/mailman/listinfo/tinyos-help
>



-- 
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