sandeepmistry/arduino-BLEPeripheral

.setTxPower() doesnot work for NRF51822

TamojitSaha opened this issue · 2 comments

Originally posted by @sandeepmistry in #186 (comment)

I am using nrf51822 board!

bool BLEPeripheral::setTxPower(int txPower) {

I also checked the following for the function definition...

bool nRF51822::setTxPower(int txPower) {
if (txPower <= -40) {
txPower = -40;
} else if (txPower <= -30) {
txPower = -30;
} else if (txPower <= -20) {
txPower = -20;
} else if (txPower <= -16) {
txPower = -16;
} else if (txPower <= -12) {
txPower = -12;
} else if (txPower <= -8) {
txPower = -8;
} else if (txPower <= -4) {
txPower = -4;
} else if (txPower <= 0) {
txPower = 0;
} else {
txPower = 4;
}
return (sd_ble_gap_tx_power_set(txPower) == NRF_SUCCESS);
}

I do not see any change in the RSSI value if I change the TX Power! Is this normal?
Where I am going wrong?
Please clarify.

It works after certain changes. Check #240