BLE Central HR - How to read RSSI of the connected device

Hello,

I'm using Nordic Central HR example. I'm wondering how to read RSSI of a BLE device connected to the NRF5340, I have tried multiple version found on this forum, but it looks like none of them are supported on NRF5340 with SKD v3.1.1. If you could point me to some example for my MCU that would be great.

Thank you.

  • Hi,

    On the nRF5340, to read RSSI while connected, you must use HCI commands from Zephyr. Here are some steps I would suggest:

    1) Keep the connection pointer. In the central HR example, this should be: static struct bt_conn*default_conn;

    2) Then after you are connected, you can get the controller's connection handle from a work item or main loop.

    3) Use the standard Zephyr HCI API to send an HCI "Read RSSI" command. So, you ask the controller for RSSI.

    4) Use a work item to call it

    5) You can schedule the work instead of reading RSSI directly in your connected() callback. 

    Let me know if you have any further questions. 

    Best Regards,

    Samruddhi

Related