On Mon, Oct 18, 2010 at 10:15 AM, Urs Hunkeler <urs.hunke...@epfl.ch> wrote:
....
> On the relay nodes you just need to increment the hop count for each
> message. You can intercept messages before they are forwarded. To do
> this you'll have to implement the Intercept interface. The code could
> look something likes this:
>
> event bool forward(message_t* msg, void* payload, uint8_t len) {
>   MyMsg* data = (MyMsg*)payload; // cast to your own data structure
>   data->hopCount++; // increase the hop count of the message
>   return true; // tell the underlying system to forward the message
> }

If you use CTP, you can read the value of the THL field for hopcount.

- om_p

_______________________________________________
Tinyos-help mailing list
Tinyos-help@millennium.berkeley.edu
https://www.millennium.berkeley.edu/cgi-bin/mailman/listinfo/tinyos-help

Reply via email to