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

OpenThread set txpower, defaults

Hi,

I successful developed a application using nrf / zephyr SDK and install the applications
on the nrf52840dk and dongle.
Now I want to adjust the power using 

CONFIG_BT_CTLR_TX_PWR_PLUS_3=y

But when I check the power setting in the netshell / shell with

ot txpower

I always receive 0dbm.

set the power - ot txpower 3 works.

Where is my missing link?

Chris

Parents Reply
  • Hi Marjeris

    Thanks for the hint.

    I implement it in the callback registered for otThreadStateChanged where I have the context pointer and
    can retrieve the instance.

    static void update_txpower(struct openthread_context *context)
    {
      int8_t power;
      if (otPlatRadioGetTransmitPower(context->instance,&power)==OT_ERROR_NONE)
      {
          if (power!=3) {
              power=3;
              if (otPlatRadioSetTransmitPower(context->instance,power)!=OT_ERROR_NONE)
                  LOG_ERR("Radio SetTransmitPower failed");
          }
      }
      else {
        LOG_ERR("Radio GetTransmitPower failed");
      }
    }

Children
No Data
Related