Hey I have been trying to work on this for some time but I am just getting no where
I am trying to get bytes in from a USB device, this works fine for one or two lines coming in but when it gets to quite a few it just doesn’t work.
I am using this line of code to bring in data:
conn.bulkTransfer(epIN, buffer, 57600, 500);
is there any way to do a USB transfer over and over again until there is no more data coming in? Because the amount of data coming in can be anything from 8 bytes to a few MB
In reply to user387184
Would something like this work to transfer large amounts of data?
while ( conn.bulkTransfer(epIN, buffer, 57600, 500) > 0 ){
\\do some stuff
}
If your USB connection really stops receiving data if there is no more data then all you need to do is to put a while receivedBufferIsNotEmpty around your statement since:
gets
0 in lenOfReceivedBufferif no more data can be found on the port using 500ms timeout.You may also increase the timeout a bit, if your sending side is too slow.