[fpc-pascal] Reading Serial Hex Data
Jean SUZINEAU
jean.suzineau at wanadoo.fr
Sun Dec 27 21:15:03 CET 2020
May be using TBlockSerial from unit synaser from Ararat Synapse ?
( doc: http://synapse.ararat.cz/doc/help/synaser.TBlockSerial.html ,
download: http://synapse.ararat.cz/doku.php/download ).
Given a variable (SynSer: TBlockSerial;), you can test if data is
available with SynSer.CanReadEx(0) and then use
SynSer.RecvPacket(Timeout) to get your data.
I think it should work, I haven't used directly TBlockSerial this way,
but through TLazSerial component for reading data from an Arduino in a
program running on Windows, Linux x86, or Raspberry.
I think TBlockSerial can work in your console programĀ context. May be
TLazSerial can be more tricky to use in your context, you'll need to use
events/callbacks and FCL.
More information about the fpc-pascal
mailing list