[quote author=PaulS link=topic=125578.msg944187#msg944187 date=1349342610]
Dynamically sizing the buffer this way is a really bad idea. A statically sized, global buffer is a much better idea.
Ditch the while loop, using an if statement, instead.
[/quote]
Uh, okay... not quite sure what your vision is here. I need to process all incoming packets at once, for timing reasons...
[quote author=PaulS link=topic=125578.msg944187#msg944187 date=1349342610]
[code]Any big mistakes that I missed?
You failed to post all of your Arduino code. You failed to post any of your C# code.
[/quote]
apologies, there is a lot of code, so I'm trying to only post relevant stuff. I will post more though[/code]