James: Unfortunately there is no HCI command to set the power at the controller. We are going to be adding a vendor specific command to do this (this is what others do). What you describe, however, would indeed work. Well, I am referring to the call to ble_phy_txpwr_set(). Note that calling ble_phy_txpwr_set() while a transmission is in progress might be interesting… :-) Actually, it will be fine, but that API is expected to be called by the Link Layer and the Link Layer knows when the device is transmitting…
BTW, I havent looked at the code to see what ctxt->chr_access.data is, but if that is an int all you need to do is this: int txpwr; txpwr = ctxt->chr_access.data ble_phy_txpwr_set(txpwr); Will PS Note that if you try to set the power too low or too high, the PHY api just rails the power to either the max or min... > On May 19, 2016, at 10:11 AM, James Howarth <[email protected]> wrote: > > Hi, > > Is there a special procedure for changing power level of the BLE radio on > an nRF52 PDK? > > Can I just do something like the following in my callback: > > static int txpwer_to_set[1] ; > memcpy(txpwer_to_set, ctxt->chr_access.data, > sizeof txpwer_to_set); > > ble_phy_txpwr_set(*txpwer_to_set); > > Cheers > James
