I am trying to emulate (reverse engineer) another program that is reading and writing to the COM4 serial port (connected to another device) with just ANSI C calls like fopen(), fread(), and fwrite(), etc.
The first read or write is a fwrite() and my software protocol analyzer shows that I am writing OK with the bytes expected and a 0 success code.
When I then do a rewind(pH) followed by a fread(buffer, 1, 1, pH), the 1st byte shown in the protocol analyzer is the one I want and expect, BUT it is followed by several other unexpected bytes and a timeout (0x00000102).
Any ideas of what is happening or what I can try?
I really need this C code to be as skeletal and portable as possible, NOT C++ or .NET specific.
Thanks!
Joe
-------------