A poor way to handle EOF with only minor changes to your code.Code:if(byte1==0xDF && byte2==0x00 && byte3==0x00 && byte4==0x00 && byte5==0x00 && byte6==0x00 && byte7==0x00 && byte8==0x00) { break; }
Not tested or syntax checked.Code:if(byte1==EOF || byte2==EOF || byte3==EOF || byte4==EOF || byte5==EOF || byte6==EOF || byte7==EOF || byte8==EOF) {
byte1=0xDF;
byte2=0x00;
byte3=0x00;
byte4=0x00;
byte5=0x00;
byte6=0x00;
byte7=0x00;
byte8=0x00;
}
if(byte1==0xDF && byte2==0x00 && byte3==0x00 && byte4==0x00 && byte5==0x00 && byte6==0x00 && byte7==0x00 && byte8==0x00) { break; }
Tim S.