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

tx_power_set mesh_sdk_2.0.1 s140

Hello

Ive implemented and modified the light_switch_example and now I want to change the tx_power(sd_ble_gap_tx_power_set(uint8_t role, uint16_t handle, int8_t tx_power));)

but the new softdevice requires 2 extra parameters..What should I set here?

Im changing the tx power right after mesh_init(). What conn_handle should I use here? and do I need to call tx_power_set again when devices are connected?(provisioners perspective, if that matters)

Parents
  • Hi Mike, 

    the Bluetooth Mesh stack is running in a Timeslot, where the SoftDevice is disabled so that the Mesh stack has full control of the radio peripheral. At teh beginning of a timeslot the Mesh stack will configure and use the Radio according to its configuration. At the end of the timeslot, the SoftDevice is re-enabled and it configures the Radio according to its configuration. 

    Hence, modifying the TX output power with a SoftDevice API call will have no effect on TX Output power used by the Mesh stack. 

    You will have to use the Mesh stack API to modify the output power, specifically modify the default configuration set in set_default_broadcast_configuration() in advertiser.c in the light_switch example

    static inline void set_default_broadcast_configuration(broadcast_t * p_broadcast)
    {
        p_broadcast->params.access_address = BEARER_ACCESS_ADDR_DEFAULT;
        p_broadcast->params.radio_config.payload_maxlen = RADIO_CONFIG_ADV_MAX_PAYLOAD_SIZE;
        p_broadcast->params.radio_config.radio_mode = RADIO_MODE_BLE_1MBIT;
        p_broadcast->params.radio_config.tx_power = RADIO_POWER_NRF_0DBM;
    }

     

Reply Children
Related