6 Replies Latest reply on Mar 11, 2018 11:02 PM by user_3000656

    CyBle_GetRssi() != scanReport->rssi ?

      Hi,

      How do I get the RSSI of a peered device? Say I'm connected to a peripheral and want to know the RSSI from the Central.

       

      Also whats wrong with this function CyBle_GetRssi(), I'm trying to output an RSSI but gives a postive value and a dBm value lower than -85 e.g. -120, when the documentation say it will only output a dBm range of -5 to -85 dBm, and this is true though for using scanReport->rssi.

      Im printing it using:

       

      printf("RSSI: %d", CyBle_GetRssi());

        • 1. Re: CyBle_GetRssi() != scanReport->rssi ?

          According to the documentation associated with the function, it reads the RSSI of the last successfully received packet; Thus, if there is no successfully received packet, it may be returning -120 as an error/uninitialized?

           

          The RSSI from the scanReport is the direct access to the value, so using that should be fine in lieu of the function not working correctly.

          Listed under the BLE_StackGap.h file at line 1049, it says:

          /** Rssi of the responding device.

               * Range: -127 <= N <= +20

               * Units: dBm

               * N = 127 -> RSSI not available

               */

              int8                        rssi;

          Thus, it may be listing the incorrect values when you call the function due to not being available while not connected/scanning devices? There is most likely a requirement such as being connected, actively scanning, or calling it when you receive an advertisement packet...

          1 of 1 people found this helpful
          • 2. Re: CyBle_GetRssi() != scanReport->rssi ?

            When I'm connected to a peer device, is it the one I'm getting the RSSI on? Using the scanReport->rssi?

            • 3. Re: CyBle_GetRssi() != scanReport->rssi ?

              The RSSI value will be associated with the currently connected device, so yes.

              2 of 2 people found this helpful
              • 4. Re: CyBle_GetRssi() != scanReport->rssi ?

                By Using the CyBle_GetRssi(), Is there a way to determine if packet received is not an error packet.

                • 5. Re: CyBle_GetRssi() != scanReport->rssi ?

                  Based on the RSSI alone? No. The RSSI is merely a "signal strength" value, that is associated (roughly due to wireless interference) with distance and antenna power/gain. It's like a "volume level", but for wireless packets received to tell you how "loud" the wireless signal was. This doesn't correlate with the type of packet as far as I know.

                   

                  You should be able to handle the HCI errors and the Link Layer errors through the API associated with the BLE module. (Right-click on the BLE module in topdesign.cysch and select "Open API Documentation", and look for HCI and Link Layer interactions)

                  I don't know for sure if you will be able to interact with the error packets for the lowest level communications over BLE, but you should be able to get pretty close from what I've seen.

                  1 of 1 people found this helpful
                  • 6. Re: CyBle_GetRssi() != scanReport->rssi ?

                    Thank you for the replies!