Yes, that is the hexadecimal **representation** (the value, of course, is the same). There is no conversion. Take this, for instance:
if (255 = 0xFF) print("true"); // this will print "true", both 255 (decimal, base 10) and 0xFF (hex, base 16) represent the same value. You only need to worry about 'converting' when going from a raw value (e.g. what is stored in an `int' variable) to some other kind of representation, such as a string, and vice-versa. Inside the actual nesC code, it is in its "raw value". You should verify what puts the values into the messages to determine if you should use it as a signed or unsigned integer and weather or not it is a raw reading or a value in dBm. dBm values for a typical mote (assume 1mW max power output and no gain) should be between 0 and -95. The actual range you will see for dBm values will be smaller and tend towards the middle/lower side of the range. See http://en.wikipedia.org/wiki/DBm for what a dB/dBm is and how to convert it to a linear power (dB is a logarithmic scale, like the Richter). HTH, Paul On Wed, Jun 4, 2008 at 10:40 PM, Saugat Joshi <[EMAIL PROTECTED]> wrote: > Hey Paul thanks for the reply. > I get values like D2,C5 etc(i believe its hex) in the RSSI field.I don't know > what type is it...so i was thinking to convert it to decimal or something, > which is again not a easy job to do. I have formula like RSSI =30/d^2 to > calculate the distance but nothing is mentioned about the unit....probably > just need to get the distance as positive. > My problem is what shld I do with the RSSI valus to get the distance...and > can this calculation be implemented in some tmote sensor and then be > forwarded to Basestation? if so how > > With Regards > Saugat > _______________________________________________ Tinyos-help mailing list Tinyos-help@millennium.berkeley.edu https://www.millennium.berkeley.edu/cgi-bin/mailman/listinfo/tinyos-help