How to set the default BLE TX power at runtime?

We have some devices that run the same firmware, but need different default BLE tx power settings.

There is a KConfig value to set the default, but in our case it is different for different hardware that the same firmware runs on.  So we cannot use that.

There is API to set the tx power before advertising and after connecting.  We are currently using that.  However, this seems to have one shortcoming.  The TX power for a connection can only be set after the connection is made.  So the TX power will not be at the default level before that connection is established and the set tx power level call is made.  This leaves an initial window where the device may not connect properly due to the TX power being at the default.

How can the default BLE TX power level be set before a connection is made? 

Related