Hi Giuseppe, Thanks a lot for your explanation. I am so clear now about the flags.
Thanks again. Yusnaidi ---------------------------------------------------------------------- > > Message: 1 > Date: Fri, 7 May 2010 11:32:35 +0200 > From: Giuseppe Cardone <[email protected]> > Subject: Re: [Tinyos-help] 'flags' field in the Link Estimator header > To: Yusnaidi Md Yusof <[email protected]> > Cc: [email protected] > Message-ID: > <[email protected]> > Content-Type: text/plain; charset=UTF-8 > > Hi, > > FF FF 00 00 0D 22 70 02 0A 00 00 00 00 00 00 02 43 00 01 43 > > 02 0A is the linkest_header_t . The second byte, 0A, is a counter and > you can ignore it. The flags byte is 02. > The higher nibble (4 bits) of this byte are reserved, the lower nibble > is the number of link quality estimates in the footer. Thus, there are > 2 link quality entries. "2" is the number of entries in the footer, it > is not its size in bytes. . The link estimator footer is: > > typedef nx_struct linkest_footer { > neighbor_stat_entry_t neighborList[1]; > } linkest_footer_t; > > Here the author of the link estimator uses [1] as size of the array as > placeholder, but the array can be longer - and indeed it is in this > case. The footer is composed of 2 neighbor_stat_entry_t: > > // for outgoing link estimator message > // so that we can compute bi-directional quality > typedef nx_struct neighbor_stat_entry { > nx_am_addr_t ll_addr; > nx_uint8_t inquality; > } neighbor_stat_entry_t; > > In this example, the neighbor_stat_entry_t are 00 02 43 and 00 01 43. > The former represents the link quality for the node whose address is > 00 02, the latter for the node whose address is 00 01. > > Regards. > > -- > Giuseppe Cardone > > > > On Thu, May 6, 2010 at 12:33 PM, Yusnaidi Md Yusof <[email protected]> > wrote: > > Hi All, > > > > I not really understand what does the 'uint8_t flags' field means in the > > /tos/lib/net/4bitle/LinkEstimator.h file? > > > > In the file, the 'flags' is quoted as: "flags to describe the state of > this > > entry". > > > > Based on my understanding, the 'flags' indicates the 'number of elements > in > > the link estimator footer' which is the linkest_footer_t. > > > > If I have a CTP routing data sample such as like this (the sample data > taken > > from the MViz program): > > > > FF FF 00 00 0D 22 70 02 0A 00 00 00 00 00 00 02 43 00 01 43 > > > > therefore, the field '02' (which I highlighted),refers to the 'flags' > field > > of the linkest_header_t. Thus, the last 6 bytes of the stream (00 02 43 > 00 > > 01 43) would reflect this 'flags'. > > If I converted the hexa '02', that would be 2 decimal, which I conclude > > there will be two number of elements in the link estimator footer, but > what > > I see here there are 6 bytes of them altogether?? > > > > I am sure I missed a correct understanding here about the flags > > field...Please someone correct me... > > > > thanks in advance... > > > > Yusnaidi > > >
_______________________________________________ Tinyos-help mailing list [email protected] https://www.millennium.berkeley.edu/cgi-bin/mailman/listinfo/tinyos-help
