2012-09-13 07:12 AM
2012-09-17 06:31 PM
realize that with your current code when you overrun your buffer you will end up writing back to the begging. if you have an expected packet structure it will destroy at least one packet causing you to loose data.
You should look into a circular buffer or at least be sure not to set the rxbyte count back to 0 anywhere else except in the int and check for overflow. I only say this because I ran into the same issue with the exact same code. I would get errors at high bit rates and eventually found out it was because upon sending two packets my buffer was getting set back to index 0 and destroying my packet, but only if sending two at a time. Circular buffers might have a little learning curve but they are a great way to handle this sort of situation.2012-09-25 10:10 AM