How to receive the whole bytes in c#

Tip / Sign in to post questions, reply, level up, and achieve exciting badges. Know more

cross mob
YuWa_4674726
Level 1
Level 1

Hi,

I could send/read the data with C# (cyusb.dll) and every time I read 512 bytes.

But my full data's size is not a multiple of 512.

The function WaitForXfer() always returns false if the remaining data's size does not reach 512. These remaining data would interfere with the byte content next time.

So my question is how to receive these remaining data(less than 512).

Thank you !

0 Likes
1 Solution
YatheeshD_36
Moderator
Moderator
Moderator
750 replies posted 500 replies posted 250 solutions authored

Hello,

For the application to read the data, the data should be committed to the endpoint buffer by the firmware. Please confirm the same.

You can use the synchronous Xferdata call, where you can specify the length of data that is to be read from the corresponding endpoint.

Refer to section "4.14.7 XferData( )" from the CyUSB.NET.pdf available in the FX3 SDK.

Thanks,

Yatheesh

View solution in original post

0 Likes
3 Replies