This post is older than 2 years and might not be relevant anymore
More Info: Consider searching for newer posts

See RSSI values for all 3 advertising channels like on nRF Sniffer

When I use the nRF Sniffer on a 52840 or 52832 with Wireshark I can see the RSSI values for each advertising message for all 3 channels (37, 38, 39).
So for each advertising message I have all 3 RSSI values.

Now when I program a scanner on the 52840 DK with the S140 soft device, I get only 1 RSSI value for each advertising message.

How can I get all three RSSI values for each single advertising message received?

Parents
  • Try this in ble_evt_handler():

    static void ble_evt_handler(ble_evt_t const * p_ble_evt, void * p_context)
    {
        blahblah
        ble_gap_evt_t const * p_gap_evt = &p_ble_evt->evt.gap_evt;
        static int8_t   rssi_value = 0;
        switch (p_ble_evt->header.evt_id)
        {
        blahblah
           case BLE_GAP_EVT_RSSI_CHANGED:
                rssi_value =  p_gap_evt->params.rssi_changed.rssi;
                int16_t channel_rssi =  p_gap_evt->params.rssi_changed.ch_index;
                NRF_LOG_INFO("RSSI changed, new: %d, channel: %d",rssi_value, channel_rssi);
                NRF_LOG_INFO(";%d;%d;%d",rssi_value, channel_rssi, p_gap_evt->params.adv_report.tx_power);
                break;
        }
    

    I use this (although my own processing not NRF_LOG) and it works well. channel_rssi is the channel id; I just log all values when received in an array index by channel_rssi.

Reply
  • Try this in ble_evt_handler():

    static void ble_evt_handler(ble_evt_t const * p_ble_evt, void * p_context)
    {
        blahblah
        ble_gap_evt_t const * p_gap_evt = &p_ble_evt->evt.gap_evt;
        static int8_t   rssi_value = 0;
        switch (p_ble_evt->header.evt_id)
        {
        blahblah
           case BLE_GAP_EVT_RSSI_CHANGED:
                rssi_value =  p_gap_evt->params.rssi_changed.rssi;
                int16_t channel_rssi =  p_gap_evt->params.rssi_changed.ch_index;
                NRF_LOG_INFO("RSSI changed, new: %d, channel: %d",rssi_value, channel_rssi);
                NRF_LOG_INFO(";%d;%d;%d",rssi_value, channel_rssi, p_gap_evt->params.adv_report.tx_power);
                break;
        }
    

    I use this (although my own processing not NRF_LOG) and it works well. channel_rssi is the channel id; I just log all values when received in an array index by channel_rssi.

Children
Related