Hi,
I am trying to modify ACK handling in ESB(nrf_esb.c, inside on_radio_disabled_rx()) but confused about accessing real payload data (PRX example, SDK17)
-
static uint8_t m_rx_payload_buffer[NRF_ESB_MAX_PAYLOAD_LENGTH + 2]
is used for receive by settingNRF_RADIO->PACKETPTR = (uint32_t)m_rx_payload_buffer;
- It should hold total ESB payload defined as
typedef struct { uint8_t length; //!< Length of the packet (maximum value is @ref NRF_ESB_MAX_PAYLOAD_LENGTH). uint8_t pipe; //!< Pipe used for this payload. int8_t rssi; //!< RSSI for the received packet. uint8_t noack; //!< Flag indicating that this packet will not be acknowledgement. Flag is ignored when selective auto ack is enabled. uint8_t pid; //!< PID assigned during communication. uint8_t data[NRF_ESB_MAX_PAYLOAD_LENGTH]; //!< The payload data. } nrf_esb_payload_t; - I guess that would make first byte of data as m_rx_payload_buffer[5]?
- However, I can see stuff like this:
memcpy(m_rx_fifo.p_payload[m_rx_fifo.entry_point]->data, &m_rx_payload_buffer[2], m_rx_fifo.p_payload[m_rx_fifo.entry_point]->length);which suggests data index == [2].
So, which index is correct? What am I missing?
Thanks.