This post is older than 2 years and might not be relevant anymore
More Info: Consider searching for newer posts

Bluetooth Mesh TX power on nRF52

I'm playing around with the light and switch examples with the Bluetooth mesh SDK on nRF52832 devices. I'm trying to find out what the maximum distance would be given changes in TX output power. However, every time I make a call to the sd_ble_gap_tx_power_set function it returns an error.

I'm guessing this has something to do with the mesh SDK? Does the mesh SDK support changes in TX power?

Parents
  • Hi jpreston,

    The mesh stack operates within a SoftDevice timeslot and implements its own advertiser and scanner. To modify the TX output power of the device, I believe you only have to call the void radio_tx_power_set(radio_tx_power_t tx_power) function in mesh/include/core/radio.h. You could also set the default at compile time in mesh/src/core/radio.c in radio_init().

    Edit for v0.10.0+

    In the v0.10.0 a new bearer layer appeared and changed this around a bit. There is a concept of an "advertiser instance": advertiser_t in mesh/bearer/include/advertiser.h. This means that the stack can instantiate and use any number of advertisers concurrently. Each advertiser owns a broadcast_t structure, which owns the lower level radio configurations like which access address, what advertising channels and what radio_config_t to use.

    To answer your question directly. To change the TX power of the mesh itself, you would really have to change the values used in the individual advertiser_t instances. However, all advertisers used in the mesh are set up with default parameters by the set_default_broadcast_configuration() in advertiser.c:268. In that function you can change the default TX power among other things.

    Best,
    Thomas

Reply
  • Hi jpreston,

    The mesh stack operates within a SoftDevice timeslot and implements its own advertiser and scanner. To modify the TX output power of the device, I believe you only have to call the void radio_tx_power_set(radio_tx_power_t tx_power) function in mesh/include/core/radio.h. You could also set the default at compile time in mesh/src/core/radio.c in radio_init().

    Edit for v0.10.0+

    In the v0.10.0 a new bearer layer appeared and changed this around a bit. There is a concept of an "advertiser instance": advertiser_t in mesh/bearer/include/advertiser.h. This means that the stack can instantiate and use any number of advertisers concurrently. Each advertiser owns a broadcast_t structure, which owns the lower level radio configurations like which access address, what advertising channels and what radio_config_t to use.

    To answer your question directly. To change the TX power of the mesh itself, you would really have to change the values used in the individual advertiser_t instances. However, all advertisers used in the mesh are set up with default parameters by the set_default_broadcast_configuration() in advertiser.c:268. In that function you can change the default TX power among other things.

    Best,
    Thomas

Children
Related