[Tinyos-help] Questions concerning the TestNetwork app

Pedro Almeida pedralm at gmail.com
Mon Apr 16 20:49:01 PDT 2007


Hello;

I've been trying to understand how this app works (
http://www.tinyos.net/tinyos-2.x/apps/tests/TestNetwork/), because I need to
do something similar, but some things are still very confusing for me.
Given it has some time now and had
been regularly updated, perhaps some of you can help me figure it out,
as I'm still new to the concepts.
I haven't loaded it into the micas, since I want to understand the code
first.

I'm mostly confused about:

- what triggers the event

event void DisseminationPeriod.changed() {
const uint16_t* newVal = call DisseminationPeriod.get();
call Timer.stop();
call Timer.startPeriodic(*newVal);
}

according to (http://www.tinyos.net/tinyos-2.x/doc/html/nesdoc/micaz/), it's
signalled when the variable is changed, but where and how?

- where is the logging being produced to? the types shown are such as

NET_C_DBG_1 = 0x40, //:any :uint16_t a (from

but I dont understand what this value actually addresses.

- why is that when sending a message periodically (task sendMessage(),
triggered by
Timer) , it's used the address-free Send instead of the AMSend? Will
the message get routed to the root via shortest path anyway or will it
be just flooded to the network?

- i dont clearly understand the implementation of CTP, even
after reading the CTP 123
TEP. i believe it's done some sort of automatically once the "wiring"
is done, but i dont clearly "see it".


- the AMSend at the uartEchoTask task is set broadcast (0xffff). Shouldnt it
be 0 for the messages to go to the root node? Or is this related to the CTP
somehow?

- and finally, the usage of the Pool throughout the program. I read that

command t *get()
Allocate an element from the pool.

and

command error_t put(t *newVal)
Deallocate an object, putting it back into the pool.

But I dont understand how it's used in the Receive.receive and
UARTSend.sendDone. I really dont know how to ask, other than a clear
explanation of these two procedures (the .receive
and the .sendDone) and how they use the Pool, like why after sendDone
the message gets put into the Pool, for example.


Sorry for all the questions, but i'm really inexperienced
around TinyOS, i've read some tutorials and TEP's, but seeing some
examples really helps in understanding.

Thank you in advance for all the help you can provide.

Pedro Almeida
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mail.millennium.berkeley.edu/pipermail/tinyos-help/attachments/20070417/068ea5c4/attachment.htm


More information about the Tinyos-help mailing list