Hi,

one more question regarding the unit serial. I use the following function to get one single byte form a serial port, which has been open before with seropen:

function getdata(inhandle: tserialhandle; var recdata: char): longint;
begin
fillchar(inbuffer, sizeof(inbuffer), #0);
getdata := serread(inhandle, inbuffer[0], 1);
recdata := inbuffer[0]
end;

I repeat this function as long as I need to read data from a serial port, byte by byte. One interesting error occurs at the 52478th byte: serread returns 0 instead of 1. How can I get it work properly?

Best regards, Holger

_______________________________________________
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/mailman/listinfo/fpc-pascal

Reply via email to