Hi all,

as suggested in the mailing list, I retrieved the received RSSI value from the message structure and showed it in my application.

the value is captured and stored into a struct of the basestation node and forward to my application through a nx_uint16_t type variable.

fwdSensData->rssi = call CC2420Packet.getRssi(msg);

and, in the message java class generated by TinyOS, it has message like below to get back this RSSI

    /**
     * Return the offset (in bits) of the field 'rssi'
     */
    public static int offsetBits_rssi() {
        return 16;
    }

    /**
     * Return the value (as a int) of the field 'rssi'
     */
    public int get_rssi() {
        return (int)getUIntBEElement(offsetBits_rssi(), 16);
    }

however, when I output this reading from my application as
System.out.println("Mote "+Integer.toString(moteID)+" has RSSI ="+Integer.toBinaryString(rssi)+" and Temperature= "+df.format(tempDegreeC));

I got the following readings:
Mote 7 has RSSI =110 and Temperature= 24.3
Mote 7 has RSSI =110 and Temperature= 24.31
Mote 7 has RSSI =110 and Temperature= 24.31
Mote 7 has RSSI =110 and Temperature= 24.31
Mote 7 has RSSI =110 and Temperature= 24.31
Mote 7 has RSSI =110 and Temperature= 24.31
Mote 7 has RSSI =110 and Temperature= 24.31
Mote 7 has RSSI =100 and Temperature= 24.3
Mote 7 has RSSI =100 and Temperature= 24.31
Mote 7 has RSSI =100 and Temperature= 24.3
Mote 7 has RSSI =100 and Temperature= 24.31
Mote 7 has RSSI =11 and Temperature= 24.3
Mote 7 has RSSI =100 and Temperature= 24.32
Mote 7 has RSSI =100 and Temperature= 24.31
Mote 7 has RSSI =11 and Temperature= 24.32
Mote 7 has RSSI =101 and Temperature= 24.31
Mote 7 has RSSI =101 and Temperature= 24.32
Mote 7 has RSSI =11 and Temperature= 24.32
Mote 7 has RSSI =100 and Temperature= 24.32
Mote 7 has RSSI =100 and Temperature= 24.32
Mote 7 has RSSI =100 and Temperature= 24.31
Mote 7 has RSSI =100 and Temperature= 24.3
Mote 7 has RSSI =100 and Temperature= 24.31
Mote 7 has RSSI =101 and Temperature= 24.32
Mote 7 has RSSI =100 and Temperature= 24.3
Mote 7 has RSSI =100 and Temperature= 24.3
Mote 7 has RSSI =101 and Temperature= 24.28
Mote 7 has RSSI =101 and Temperature= 24.28
Mote 7 has RSSI =100 and Temperature= 24.3
Mote 7 has RSSI =100 and Temperature= 24.29
Mote 7 has RSSI =101 and Temperature= 24.29
Mote 7 has RSSI =100 and Temperature= 24.28
Mote 7 has RSSI =101 and Temperature= 24.3
Mote 7 has RSSI =11 and Temperature= 24.29
Mote 7 has RSSI =100 and Temperature= 24.3
Mote 7 has RSSI =10 and Temperature= 24.29
Mote 7 has RSSI =100 and Temperature= 24.3
Mote 7 has RSSI =11 and Temperature= 24.3
Mote 7 has RSSI =10 and Temperature= 24.3
Mote 7 has RSSI =11 and Temperature= 24.31
Mote 7 has RSSI =10 and Temperature= 24.31
Mote 7 has RSSI =10 and Temperature= 24.31
Mote 7 has RSSI =11 and Temperature= 24.32
Mote 7 has RSSI =11 and Temperature= 24.33
Mote 7 has RSSI =11 and Temperature= 24.32
Mote 7 has RSSI =100 and Temperature= 24.32
Mote 7 has RSSI =110 and Temperature= 24.32
Mote 7 has RSSI =100 and Temperature= 24.32
Mote 7 has RSSI =10 and Temperature= 24.31
Mote 7 has RSSI =100 and Temperature= 24.32
Mote 7 has RSSI =11 and Temperature= 24.32
Mote 7 has RSSI =100 and Temperature= 24.32
Mote 7 has RSSI =101 and Temperature= 24.32
Mote 7 has RSSI =101 and Temperature= 24.32
Mote 7 has RSSI =11 and Temperature= 24.3
Mote 7 has RSSI =10 and Temperature= 24.3
Mote 7 has RSSI =10 and Temperature= 24.3
Mote 7 has RSSI =10 and Temperature= 24.29
Mote 7 has RSSI =10 and Temperature= 24.29
Mote 7 has RSSI =1 and Temperature= 24.29
Mote 7 has RSSI =10 and Temperature= 24.28
Mote 7 has RSSI =10 and Temperature= 24.29
Mote 7 has RSSI =10 and Temperature= 24.29
Mote 7 has RSSI =10 and Temperature= 24.3
Mote 7 has RSSI =10 and Temperature= 24.32
Mote 7 has RSSI =10 and Temperature= 24.31


as suggested by some people that I need to do a two's complement on this binary value and add a -45 to get the input power (dBm). I knew something is wrong with my conversion, so can anyone figure me out how I should approach to the right RSSI value from these received packets?


--
regards;

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

Reply via email to