This post is older than 2 years and might not be relevant anymore
More Info: Consider searching for newer posts
This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

How to change transmitting power ?

Hello, I am using pca10028 dk. I want to know how can I change the transmitting power of ble? My application needs that user should be able to change the transmitting power through app. So how should I proceed? I am using sdk 12.2.2 and I am referring code ble_app_gls.

Screen shots are Screenshot_20170301-115100.png

Screenshot_20170301-115123.png

Screenshot_20170301-115113.png

Screenshot_20170301-115602.png

Screenshot_20170301-115358.png

Thanks, Shailav

  • Hello, I have changed the power with api int8_t tx_power_level = -30; advdata.p_tx_power_level = &tx_power_level;

    Now I am trying to check the power at -30 dbm and 4 dbm. I am using nrf connect app and I am checking rssi level but I am surprised to see that there is not much change. I am attaching screen shots above in question. Any thoughts? Thanks

  • Your BLE code needs to include the tps (service) which is provided as part of the SDK

    Your phone app needs to be able to write to the service characteristic in the tps service

    Your screenshots seem to merely show the RSSI (received signal strength) by you phone. I'm not sure if the nRF phone App has a UI for the Transmit Power service (TPS), you may need to write this yourself.

  • Hello, I am still looking for answer. I can change the power by adding api in code but my question is how should I allow user to change power from app according to his requirement?

  • If you take a look at the Tx power service at BLE SIG, you can see that by default only read is supported, this is also how it's implemented in the SDK. So in order to set the Tx-power from the app, you will have to set the write permission on the Tx-power characteristic, and implement the desired behavior in ble_tps.c. Set-up the characteristic to support write in the function tx_power_level_char_add(), add the case BLE_GATTS_EVT_WRITE in ble_tps_on_ble_evt(), where you call the function on_write(p_tps, p_ble_evt). Implement the desired behavior in your on_write() function(e.g. set the tx power with sd_ble_gap_tx_power_set()).

Related