I'm finding that the signal strength of the radio is too low in my nRF52840 custom BLE project. I would like to increase the radio power from the default 0dB as our RSSI values are quite low, but I'm getting lots of errors. I've inserted the code I have been using below. S140 Soft device with SDK 17.2.0
//adjust the radio power to 4DB during the connection, advertising, and scanning
err_code = sd_ble_gap_tx_power_set(BLE_GAP_TX_POWER_ROLE_ADV , BLE_CONN_HANDLE_INVALID, 4);
APP_ERROR_CHECK(err_code);
err_code = sd_ble_gap_tx_power_set(BLE_GAP_TX_POWER_ROLE_SCAN_INIT , BLE_CONN_HANDLE_INVALID, 4);
APP_ERROR_CHECK(err_code);
err_code = sd_ble_gap_tx_power_set(BLE_GAP_TX_POWER_ROLE_CONN , BLE_CONN_HANDLE_INVALID, 4);
APP_ERROR_CHECK(err_code);
What am I doing wrong? Extensive searching hasn't provided a ton of documentation, so all I've had to go off of is other Dev zone threads and the documentation in ble_gap.h at the start of the sd_ble_gap_tx_power_set() function documentation.