I am doing burst transfers using exactly the code suggested here devzone.nordicsemi.com/.../
The problem is, the data is received three times by the receiver (three times the same packet)
Additional info:
- I have a registered a callback function on ANT events on the transmitter, and during transmission it triggers only once event 0x0a (EVENT_TRANSFER_TX_START) and 0x05 (EVENT_TRANSFER_TX_COMPLETED)
- On the receiver (AntWare II) the packet indexes are consecutive, as if it was only a single burst transmission (i.e. if the burst transmission is 2 * 8 bytes, indexes are 0x00, 0x20, 0x30, 0x60, 0x20, 0xc0);
- The only difference I reckon, my m_burst_data[] is bigger than the real data, and I use the second argument of sd_ant_burst_handler_request(..) for telling how many bytes to send (always multiple of 8). That way, I can send almost arbitrary length data - is that a legit usage? I'd like to avoid using heap and malloc. - EDIT: even with an array of the right size, the problem persists.
EDIT #2:
reference code:
do
{
err_code = sd_ant_burst_handler_request(CHANNEL_0, sizeof(m_burst_data), m_burst_data, BURST_SEGMENT_START);
} while (err_code == NRF_ANT_ERROR_TRANSFER_IN_PROGRESS);
APP_ERROR_CHECK(err_code);
while(burst_wait)
;
err_code = sd_ant_burst_handler_request(CHANNEL_0, sizeof(m_burst_data), m_burst_data, BURST_SEGMENT_CONTINUE);
APP_ERROR_CHECK(err_code);
while(burst_wait)
;
err_code = sd_ant_burst_handler_request(CHANNEL_0, sizeof(m_burst_data), m_burst_data, BURST_SEGMENT_END);
APP_ERROR_CHECK(err_code);
while(burst_wait)
;
If I comment the middle "sd_ant_burst_handler_request(... BURST_SEGMENT_CONTINUE)" section, the burst transmission happens 'only' 2 times.
I I comment both the middle section and the last "sd_ant_burst_handler_request(... BURST_SEGMENT_END)", the burst is received once, but the receiver triggers a EVENT_TRANSFER_RX_FAILED_0x04
Has anyone an idea about how sd_ant_burst_handler_request() is supposed to work and what it specifically does? Why have I found also a version without BURST_SEGMENT_CONTINUE somewhere in the thisisant website? www.thisisant.com/