How to transmit peripheral device's rssi within the peripheral_hr_coded example?

Hello I am using central_hr_coded and peripheral _hr_coded nrf connect sdk examples to connect via bluetooth. My central device is the nrf52840DK and the peripheral is the nrf52840 dongle. currently when I run this code I see the following output after the device has connected:

"Heart Rate Measurement notification received:

Heart Rate Measurement Value Format: 8 - bit

Sensor Contact detected: 1

Sensor Contact supported: 1

Energy Expended present: 0

RR-Intervals present: 0

Heart Rate Measurement Value: 121 bpm"


This repeats over and over with the heart rate value increasing. I want to instead have the peripheral device send the rssi value for the connection in place of that increasing value, what changes do I need to make to that example to make that happen?

Thank you!

Parents
  • Hello,

    Do you mean for the peripheral to report the RSSI of the packets received from the central back to the central through its notification, or would you simply like to see the RSSI of the most recent packet received on either side of the link?

    In either case you can use the sd_ble_gap_rssi_start and sd_ble_gap_rssi_get functions to achieve this.
    In the former case you will just need to take the returned value from the _get call and route it to your characteristics with notifications enabled, to have it sent to the central. I would however recommend using a custom service for this, instead of the heartbeat one.

    Best regards,
    Karl

Reply
  • Hello,

    Do you mean for the peripheral to report the RSSI of the packets received from the central back to the central through its notification, or would you simply like to see the RSSI of the most recent packet received on either side of the link?

    In either case you can use the sd_ble_gap_rssi_start and sd_ble_gap_rssi_get functions to achieve this.
    In the former case you will just need to take the returned value from the _get call and route it to your characteristics with notifications enabled, to have it sent to the central. I would however recommend using a custom service for this, instead of the heartbeat one.

    Best regards,
    Karl

Children
No Data
Related