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

how to get and send the RSSI value over ble

Hi, 

I am working nRF52832 and sdk 16 version. I want to get the RSSI  value of my peripheral device nRF52832 and send it to central (phone) over ble ? how to do that ? 

Best Regards 

pspavi

Parents Reply Children
  • yes I did , but i am not getting the RSSI stable value , it is varying  ..please let me know how to rectify 

      switch (p_ble_evt->header.evt_id)
        {
            case BLE_GAP_EVT_CONNECTED:
                NRF_LOG_INFO("Connected");
                err_code = bsp_indication_set(BSP_INDICATE_CONNECTED);
                APP_ERROR_CHECK(err_code);
                m_conn_handle = p_ble_evt->evt.gap_evt.conn_handle;
                err_code = nrf_ble_qwr_conn_handle_assign(&m_qwr, m_conn_handle);
                APP_ERROR_CHECK(err_code);
    
                uint32_t err_code;  
    m_conn_handle  = p_ble_evt->evt.gap_evt.conn_handle;  
    err_code = sd_ble_gap_rssi_start(m_conn_handle, 10, 0);  
    APP_ERROR_CHECK(err_code);  
    
    
                break;
     case BLE_GAP_EVT_RSSI_CHANGED:
             
           rssi = p_ble_evt->evt.gap_evt.params.rssi_changed.rssi;
        
    NRF_LOG_INFO("rssi:%d",rssi);
    

  • Measured RSSI will vary quite a bit when tested in uncontrolled environments, so the variation you see is probably as expected. To limit this variation you could try calculate an average RSSI from multiple samples.

Related