Synasers API is described in the declaration section of the synaser.pas source file.
You could do something like this:
var
Timeouts : integer;
buf : array [0..128] of Byte;
SynaSerComPort: TBlockSerial;
begin
if SynaSerComPort = nil then
SynaSerComPort:= TBlockSerial.Create;
SynaSerComPort.LinuxLock:= False;
// ignore port locking in Linux
if not SynaSerComPort.InstanceActive then
SynaSerComPort.Connect('COM1'); // or whatever com port (might be /dev/ttyUSB0 for Linux)
// add some delays to allow for serial port setup times
sleep(500);
SynaSerComPort.Config(19200, 8, 'N', SB1, False, False);
sleep(300);
count:= SynaSerComPort.RecvBufferEx(@buf[0], 128, 500); //Wait for 500ms per 128 byte packet
if SynaSerComPort.LastError = ErrTimeout then
begin
Inc(Timeouts);
// Do some sort of recovery here maybe
end;
end;