The way now current tx power value check

I am the user who is using nrf52832.

A 1:Nble connection was successful using the multi-central example.
I set the tx power of the device using sd_ble_gap_tx_power_set().
But I wonder if tx power is set correctly.

Many searches have shown that p_gap_evt->params.adv_report.tx_power and p_gap_evt->params.adv_report.rsi can determine the tx_power and rsi of the peripheral.

But tx power is 127.
(Mac address and rssi are output normally.)

Is there any other way to check the tx power of the connected peripheral and the tx power of the central?

static void ble_evt_handler(ble_evt_t const * p_ble_evt, void * p_context)
{
    ret_code_t err_code;

    // For readability.
    ble_gap_evt_t const * p_gap_evt = &p_ble_evt->evt.gap_evt;
    switch (p_ble_evt->header.evt_id)
    {
        ...
        
        case BLE_GAP_EVT_ADV_REPORT:
            printf("ble_evt_handler ID = %d MAC = ", p_gap_evt->conn_handle);
            printf("%02X",p_gap_evt->params.connected.peer_addr.addr[5]);
            printf(":%02X",p_gap_evt->params.connected.peer_addr.addr[4]),
            printf(":%02X",p_gap_evt->params.connected.peer_addr.addr[3]),
            printf(":%02X",p_gap_evt->params.connected.peer_addr.addr[2]),
            printf(":%02X",p_gap_evt->params.connected.peer_addr.addr[1]),
            printf(":%02X",p_gap_evt->params.connected.peer_addr.addr[0]),   
            printf(",tx_power %d",p_gap_evt->params.adv_report.tx_power); 
            printf(",rssi %d\n\r",p_gap_evt->params.adv_report.rssi);            
        break;
        
        ...
    }

}

Parents
  • Hi JSY, 

    p_gap_evt->params.adv_report.tx_power and .rssi only give you the tx_power included in the advertising packet and the rssi level when you receive the advertising packet not when in connection. You can see that if you advertise with higher output power, you will have larger rssi (but in negative value).

    On the local device you can call  sd_ble_gap_tx_power_get() to get the current TX_power. 

    If you want to verify the txpower to see that if you in fact have higher output power when in connection, you can use a sniffer to scan and follow the connection. The sniffer would be able to show the different in RSSI when in connection with different txpower that you set in the application.

      

Reply
  • Hi JSY, 

    p_gap_evt->params.adv_report.tx_power and .rssi only give you the tx_power included in the advertising packet and the rssi level when you receive the advertising packet not when in connection. You can see that if you advertise with higher output power, you will have larger rssi (but in negative value).

    On the local device you can call  sd_ble_gap_tx_power_get() to get the current TX_power. 

    If you want to verify the txpower to see that if you in fact have higher output power when in connection, you can use a sniffer to scan and follow the connection. The sniffer would be able to show the different in RSSI when in connection with different txpower that you set in the application.

      

Children
No Data
Related