As for the buffer clearing, its old code so I cant remember well.
But it may be buggy, but more likely that because the arduino doesnt
put a null on the end of its Serial.print strings,
then my code doesnt know the string is finished.
[EDIT]
is 4 byte integer means 4 byte binary data?
Yes, as in a datatype of "long". Both arduino and liteC appear to have this onein common.
See my second test for you above...