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

Nrf ESB using nrf_esb_suspend, nrf_esb_disable functions

Which case i have to use nrf_esb_suspend function instead of nrf_esb_disable/enable?

What function i have to use when i change radio RX to TX mode, changing radio channel?

Also, tell me about difference between getting payload as while(nrf_esb_read_rx_payload(&rx_payload) == NRF_SUCCESS) ... and if(nrf_esb_read_rx_payload(&rx_payload) == NRF_SUCCESS) ... ?

  • Hi

    The nrf_esb_suspend() function is mainly used when running ESB in timeslots (for concurrent BLE and ESB operation).
    The ESB library can be suspended when the BLE SoftDevice is running, while leaving the ESB buffers intact.

    If you don't run a SoftDevice on the side then you can just keep ESB enabled all the time.

    If you want to change from PTX to PRX mode you have to disable ESB, change the mode field in the nrf_esb_config_t struct, and re-initialize the library.
    You wouldn't normally do this when using the ESB protocol, instead using the ACK payload feature to send data from the PRX to the PTX.

    Changing the RF channel is handled using the nrf_esb_set_rf_channel(uint32_t channel) function.

    The difference between reading out the RX payloads in a loop or not is that the looping method will read out all the available packets in the FIFO, while the other method will just read out a single packet in the FIFO.

    Best regards
    Torbjørn Øvrebekk

Related