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? 

Parents Reply
  • Hello,

    Apologies, I see now that I missed that part, please disregard my previous comment and instead see this one:

    A connection will inherit the TX power level configured for the advertising, so you can just configure your peripheral's TX power for the advertisement, and then it will keep this same level for any connections established from this advertisement.

    Best regards,
    Karl

Children
No Data
Related