Power change mesh_opt_core_tx_power_set

Hello everybody,
i'm trying to test the power change  mesh_opt_core_tx_power_set() made two projects attached in the archive, but the power does not change the current consumption has not changed.

int main(void)
{
nrf_power_dcdcen_set(1);

initialize();
start();
mesh_opt_core_tx_power_set(CORE_TX_ROLE_RELAY, RADIO_POWER_NRF_POS8DBM);

for (;;)
{
(void)sd_app_evt_wait();
}
}

please tell me what is wrong?

sensor power test.zip

Parents
  • Hi,

    I do not immediately see anything wrong, no.

    Building the project, however, I do get the following warning:

    1> (...)nrf5_SDK_for_Mesh_v5.0.0_src\examples\sensor power test\server -40dbm\src\main.c:624:5: warning: implicit declaration of function 'mesh_opt_core_tx_power_set' [-Wimplicit-function-declaration]

    Adding the following include along the existing includes in main.c makes the warning go away:

    #include "mesh_opt_core.h"

    I do not know if that was what caused the behavior that you see, but it may be worth the try.

    It is also a good idea to always check the return value of API calls, for instance put the call inside an ERROR_CHECK() as is done for other calls for instance in the start() function. I recommend this, since then you will get logging in case of error.

    Please also note that you set the power for CORE_TX_ROLE_RELAY, which controls TX power for relayed messages. Messages originating from the node is not affected by this setting. Only relayed messages are affected. For setting TX power for messages originating from the device, you must set CORE_TX_ROLE_ORIGINATOR.

    Regards,
    Terje

Reply Children
No Data
Related