set tx power with tx power service on zephyr

hello Nordic

i am using nrf52840, with zephyr 

i wish to use the nrfConnect Tx power service to read and to SET my Tx power

but in ncs in zephyr/subsys/bluetooth/services/tps.c i see implementation only for "read_tx_power_level"

does it mean that the serice does not support set of the tx power or that the use of setting via the service is done somewhere else, if so can you direct me to where ?

hope to read from you soon

best regards

Ziv 

  • Hi,

    0xFC0E is the opcode of BT_HCI_OP_VS_WRITE_TX_POWER_LEVEL. As you can see from the HCI VS API, this is defined as ((0x000E) | ((0x3F) << 10)) = 0xFC0E. As far as I can see, status code 0x42 means BT_HCI_ERR_UNKNOWN_ADV_IDENTIFIER

    I tested you code and configs together with the peripheral_lbs example in NCS v1.8.0, and the TX power seems to be changed correctly with the latest addition (actually only "CONFIG_BT_LL_SW_SPLIT=y" is need in my test). Verified that the RSSI is significantly lower with TX output power set to -40 through set_tx_power().

    It looks like you are using an older version, can you try with NCS v1.8.0?

    Best regards,
    Jørgen

  • When you start using SDK V18, I've learned that you need to create the advertising packet before you are allowed to change the power.

  • hi

    seems that moving to ncs 1.8 forces me to update to zephyr-sdk-0.13.2 (from 0.12.4) 

    is it really a must or am i missing something ?

    also, seems that when moving to the new zephyr sdk i have a problem with the dfu (based on the smp service), i use the nrfConnect for the dfu and it seems like its done ok but then after reset the version remains the old version. any ideas on why is that, maybe i need to change some configs ? 

    do i also need to update the MCUBoot or/and the bootloader version for this to work ?

    hope to read from you soon

    best regards

    Ziv

  • Hi,

    ziv123 said:

    seems that moving to ncs 1.8 forces me to update to zephyr-sdk-0.13.2 (from 0.12.4) 

    is it really a must or am i missing something ?

    I'm not sure about this, I'm running Windows, so the Zephyr SDK is not available for my platform. What is forcing you to do this updat?

    ziv123 said:

    also, seems that when moving to the new zephyr sdk i have a problem with the dfu (based on the smp service), i use the nrfConnect for the dfu and it seems like its done ok but then after reset the version remains the old version. any ideas on why is that, maybe i need to change some configs ? 

    do i also need to update the MCUBoot or/and the bootloader version for this to work ?

    I would recommend you to post this issue in a new ticket, as it is off topic for this thread. That way, you will also get help from someone more knowledgeable about this topic than me.

    Best regards,
    Jørgen 

  • hi

    i will open a new thread on the ncs update  (wish i would have done that 10 days ago)

    currently the 'set_tx_power()' does not work for me but i moved to work on something else for the moment .. once the issue will be solved i will close this thread with the solution

    best regards

    Ziv

Related