On Tue, Jul 15, 2008 at 8:07 PM, Varun Jain <[EMAIL PROTECTED]> wrote: > Hi, I am writing an application similar to TestNetwork where I want to know > the hopcount (number of hops it takes to reach to the root). I am trying to > read the "THL" value as that would give the number of hops a packet has > taken from a source to reach the root. The first part of the message that > is received from Collection has a ctp_data_header_t and next is the > TestNetwork Message. In TestNetwork application, we can get the Etx value by > calling CtpInfo.getEtx. Is there any interface which I can access to get the > THL value and how can I do it? Or can I just send this value in the > TestNetworkMsg structure by putting it into the hopcount (currently it is > set to 0).
You can use CtpPacket interface instead of CollectionPacket interface. CtpPacket interface has a command called getThl(msg). You will need to adjust the wiring accordingly in TestNetworkAppC.nc. > Secondly at compile time, I want to construct two packets, one > TestNetworkMsg.java (I am already able to do this) and secondly the > Ctp_data_header Msg.java but how can I achieve the second task as the packet > being sent to the serial port has two structures in it, the first part being > the ctp_data_header and second part being the TestNetworkMsg structure. You can look at tn-injector.c to see how it sets serial header fields as well as application header fields. You can probably use a similar technique in Java. - om_p _______________________________________________ Tinyos-help mailing list [email protected] https://www.millennium.berkeley.edu/cgi-bin/mailman/listinfo/tinyos-help
