FX2/LP: CCyIsoPktInfo length incorrect? | Cypress Semiconductor
FX2/LP: CCyIsoPktInfo length incorrect?
I just finished converting a working bulk design to use an isochronous endpoint and I think I may be misunderstanding what CCyIsoPktInfo.Length is trying to tell me. Here's what I am observing:
1) I fill my data buffer with a magic pattern before reading into it (host side--IN transfer).
2) I read data from the isochronous endpoint using beginDataXfer / WaitForXfer / FinishDataXfer. The endpoint is configured for 3 1K transfers per microframe.
3) All of the calls return success. The bus analyzer indicates that all of the data was transmitted. I iterate over the CCyIsoPktInfo structures to see how much of my data came through as expected. A cleaned up code snippet:
CCyIsocEndPoint *ep = ... // this is my endpoint
CCyIsoPktInfo *pktInfos = ep->CreatePktInfos(l, packets);
memset(pktInfos, 0, sizeof(CCyIsoPktInfo) * packets);
ret = ep ->FinishDataXfer(buf, l, c->Overlapped(), c->m_ptr, pktInfos);
for(int i = 0; i < packets; i++)
if(pktInfos[i].Status != 0)
len += pktInfos[i].Length;
delete  pktInfos;
At this point, I expect "len" to contain the length of data successfully sent through up to the first dropped packet (if there are any). However, if I iterate over the first "len" bytes of the buffer, I find "holes" in the buffer where the original magic pattern still exists. The holes always begin and end on 1K boundaries.
I expected to see the CCyIsoPktInfo status return nonzero any time data wasn't copied into my buffer. Am I doing something obviously wrong with the SDK or should I look elsewhere in my code for the bug?