What I am looking to is this:
Receive 32 bytes of data from serial port into an array. ( This I have done already)
Now based on say the second byte in the first 32 bytes, i will know the size of the entire packet I need to receive, say for example its 128 bytes.
So I need to now receive the remaining 3 packets of 32 bytes each and as I get them, combine them all into one big array of 128 bytes to transmit them elsewhere.
I am trying to think about the best way to do this. Any suggestions ? Thanks for all your help.