Correlation between sd_ble_gap_tx_power_set() and RSSI

I am a user developing using nrf52832. I have a question about TX POWER.
TX POWER can be set to -40, -20, -16, -12, -8, -4, 0, 3, 4 by using sd_ble_gap_tx_power_set().
I tried to check the rssi according to the TX POWER value. So, I succeeded in setting tx power using sd_ble_gap_tx_power_set() in the central and peripheral application examples.
As a result, it was confirmed that the central tx power affects the peripheral rssi. On the other hand, the tx power of the peripheral had no effect on the rssi and seemed to affect the initial BLE connection distance.

Are the results I checked correct?
Is there an article explaining the relationship between the peripheral's tx power and rssi?

Parents
  • I am using nordic15_2SDK and s132_nrf52_6.1.1_softdevice.

    This is my code.

    Central code(Based on the Multilink example):

    #define TX_POWER        (4)
    
    int main(void)
    {
        uint32_t err_code;	
        bool erase_bonds;
        
        log_init();
        timer_init();    
        leds_init();
        buttons_init(&erase_bonds);
        uart_init();    
        saadc_init();
        power_management_init();
        ble_stack_init();    
        sd_ble_gap_tx_power_set(BLE_GAP_TX_POWER_ROLE_SCAN_INIT, 0, TX_POWER); // HERE!!
        
        int link_counter = ble_conn_state_central_conn_count();
        if(link_counter >= NRF_SDH_BLE_CENTRAL_LINK_COUNT)
        {
           link_counter = NRF_SDH_BLE_CENTRAL_LINK_COUNT-1;
        }
        
        for(int i=0; i< link_counter; i++)
        {
            sd_ble_gap_tx_power_set(BLE_GAP_TX_POWER_ROLE_CONN, i, TX_POWER);
        }
    	db_discovery_init();
    	nus_c_init();
        scan_init();		
    	ble_conn_state_init();
        err_code = sd_power_dcdc_mode_set(NRF_POWER_DCDC_ENABLE);
        scan_start();      
    }

    Peripheral code(Based on the ble_app_uart example):

    #define TX_POWER    4 //HERE!!
    
    static void ble_evt_handler(ble_evt_t const * p_ble_evt, void * p_context)
    {
        uint32_t err_code;   
    
        switch (p_ble_evt->header.evt_id)
        {
            ...
            case BLE_GAP_EVT_CONNECTED:			
                
                m_conn_handle = p_ble_evt->evt.gap_evt.conn_handle;
                err_code = nrf_ble_qwr_conn_handle_assign(&m_qwr, m_conn_handle);
                sd_ble_gap_rssi_start(m_conn_handle,1,1);
    #ifdef DEBUG   
                printf("\r\n BLE Connected \r\n");
    #endif		
                break;
    
            case BLE_GAP_EVT_DISCONNECTED:
    #ifdef DEBUG   
                printf("\r\nDisconnected \r\n");
    #endif
                sd_ble_gap_rssi_stop(m_conn_handle);
                m_conn_handle = BLE_CONN_HANDLE_INVALID; 
                break;  
                
            case BLE_GAP_EVT_RSSI_CHANGED:                
                g_rssi = p_ble_evt->evt.gap_evt.params.rssi_changed.rssi;
    #ifdef DEBUG
                printf("\r\nRSSI : %d", g_rssi);
    #endif
                break;
            
            ...
        }
    }
    
    int main(void)
    {
        uint32_t err_code;
        bool     erase_bonds;
    
        err_code = app_timer_init();
    
        uart_init();
        log_init();
    
        saadc_init();
    
        power_management_init();
        ble_stack_init();
        gap_params_init();    
    
    
        fds_file_init();
    
        gatt_init();
        services_init();
        advertising_init();
        conn_params_init();
    
        timer_init();  	
            
        err_code = sd_ble_gap_tx_power_set(BLE_GAP_TX_POWER_ROLE_ADV, m_advertising.adv_handle, TX_POWER); 
        err_code = sd_ble_gap_tx_power_set(BLE_GAP_TX_POWER_ROLE_CONN, m_advertising.adv_handle, TX_POWER);
        advertising_start();
    
        for (;;)
        {       
            idle_state_handle();  
        }
    }

    Is there something wrong with my code??
    I have confirmed that the RSSI value is different when the Central tx power is changed. I do not know the effect on the RSSI value for the peripheral tx power. It's just that the initial BLE connection distance is different.

  • Hi, and sorry for the delay.

    On the other hand, the tx power of the peripheral had no effect on the rssi and seemed to affect the initial BLE connection distance.

    I am not sure I understand correctly. What changes did you make, and what consequences are you expecting to see?

    eggmoneyna said:
    I do not know the effect on the RSSI value for the peripheral tx power. It's just that the initial BLE connection distance is different.

    Could you please explain exactly what is different?

Reply
  • Hi, and sorry for the delay.

    On the other hand, the tx power of the peripheral had no effect on the rssi and seemed to affect the initial BLE connection distance.

    I am not sure I understand correctly. What changes did you make, and what consequences are you expecting to see?

    eggmoneyna said:
    I do not know the effect on the RSSI value for the peripheral tx power. It's just that the initial BLE connection distance is different.

    Could you please explain exactly what is different?

Children
No Data
Related