3 Replies Latest reply on Sep 12, 2018 5:05 AM by SheetalJ_96

    blecm_ReadRSSI()

    Juar_2150386

      Hi,

       

      I'm working with a 20736 and can't find answer about blecm_ReadRSSI() returned value

       

      int blecm_ReadRSSI(void)

       

      To calculate the RSSI level, I take the first byte and I convert to a decimal signed valu. for example:

      if blecm_ReadRSSI() returns 0x000000B4, it's a -76dBm signal

       

      Is always true that the RSSI information's is in the first byte?

      So the signal level is always between [-128; 0] dBm ans never lower than -128 dBm? Or I need to take the second byte ?

       

      Do you have explaination about returned valu of this function.

       

       

      Thanks

        • 1. Re: blecm_ReadRSSI()
          SheetalJ_96

          Hi,

           

          The function int blecm_ReadRSSI(void) returns a signed integer value. You can directly print the RSSI value using this function.

          For example,

                         int rssi_val;

                         rssi_val = blecm_ReadRSSI();

                         ble_trace1("RSSI = %d", rssi_val);

           

          Note that 127 is an error code, i.e. if you receive 127, then print error.

          • 2. Re: blecm_ReadRSSI()
            Juar_2150386

            I ask this question because I use RSSI filter:

             

            For exemple, If I fix rssiLevelLimit to -50 dBm. this valu is a INT8 (-50dBm = 0xCE)

            UINT8 valrssiRx = (blecm_ReadRSSI() & 0x000000ff);

            I check if ( valrssiRx >rssiLevelLimit && valrssiRx >= 0x80).      // valrssiRx <0 and not far of the limit

            If true I accept notification (for example)

             

            In my application, the valu rssiLevelLimit can be change by the user and I would like to now if blecm_ReadRSSI() return valu beetween [0;127].  If is the case I nedd to change my condition to accept positive valu.

            I undestand that 127 is an error code.

            Is it possible to have reception <-128 dBm ? In this case I need to use INT16 in my application.

             

            I hope I have been understandable

             

            • 3. Re: blecm_ReadRSSI()
              SheetalJ_96

              Hi Juar_2150386,

               

              In practical scenario, you can get RSSI between -90 to 0. Device cannot detect the signal beyond these values.

              However you can give a try and check for the positive values.

              1 of 1 people found this helpful