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

can I get the length of payload when using the funciton of nrf_gzll_fetch_packet_from_rx_fifo() in the gazell protocol on nrf51822

Hi,

there is an example named gzll_ack_payload in the SDK of nrf51822. when nrf51822 works in device mode, if a packet is send successfully, the funciton of nrf_gzll_device_tx_success() is called. my question: Can i get the length of payload while using nrf_gzll_fetch_packet_from_rx_fifo() if i don't know the length in advance?

thank you.

  • Hi,

    Yes, you can get the length. The input in the nrf_gzll_fetch_packet_from_rx_fifo() is a uint32_t * length, so gazell will modify the input variable and return you the length of the received packet:

    
    uint8_t payload[NRF_GZLL_CONST_MAX_PAYLOAD_LENGTH];
    uint32_t length = NRF_GZLL_CONST_MAX_PAYLOAD_LENGTH;
    nrf_gzll_fetch_packet_from_rx_fifo(pipe, payload, &length);
    /*
    length will now hold the size of your received payload
    */
    
    

    Best regards Håkon

Related