ahhhh, now I see what you were talking about all along!
Just I don't like the fact that you overlap 2 packets into one... yeah it's too high to pick up, but just so I know I have an understanding of packets, this code would make it get the full packet, right?
Code:
int i;
int start;
unsigned char info[26];
for(int i=0; i <=24; i++){
if(readBuff[i]==255 && readBuff[i+1]==255){ //packets start with 255,255
start=i;
break;
}
}
for(int i=start; i<=25; i++){
info[i-start]=readBuff[i];
}
unsigned char remainingBuffer[start];
ReadFile (hSerial, remainingBuffer, start, &read, 0);
for (int j=0; j<start; j++) {
info[26-start+j]=remainingBuffer[j];
}