Advertising Tx Power only in scan response

I need to add tx power to my BLE advertising, but I need to ensure it is in the Scan Response only not the main AD PDU.

Also, I change the Tx power by code using the function sd_ble_gap_tx_power_set(), and I need the scan response to update accordingly.

I saw this ticket which indicates it isn't correct to manipulate the advertising service:

"when i change tx_power value in code, it has no effect on rssi value."

"I believe you should use ble_gap_tx_power_set function to change the power level."

So,

1.How can I force Tx Power to srdata?

2. Does sd_ble_gap_tx_power_set() update advertising? If not, how do I update it?

Thanks,

  • Hello,

    If you want to update the content of the advertisment or scan request packet you need use ble_advertising_advdata_update(), where you for instance before calling the ble_advertising_advdata_update() change the p_tx_power_level field in p_srdata.

    Also, if you are interested in actually changing the output power during advertising you can use the sd_ble_gap_tx_power_set().

    Kenneth

Related