[Lazarus] Advice needed for serial comm with Lazarus

Mark Morgan Lloyd markMLl.lazarus at telemetry.co.uk
Mon Nov 8 13:09:27 CET 2010


Bo Berglund wrote:

> What is the recommended way to handle such situations? The data
> transfer may take several minutes for large data chunks and I have to
> keep the application responsive while giving feedback to the user
> about the progress...

Put a state machine or equivalent /inside/ the thread that's reading the 
data from the port, using select() etc. Only fire the "got data" event 
when you've received an intact message or know that it's timed out or 
corrupt.

-- 
Mark Morgan Lloyd
markMLl .AT. telemetry.co .DOT. uk

[Opinions above are the author's, not those of his employers or colleagues]




More information about the Lazarus mailing list