[fpc-pascal] Using built-in serial instead of synaser and the like for Linux console app?

Michael Van Canneyt michael at freepascal.org
Fri Aug 21 12:21:09 CEST 2020



On Fri, 21 Aug 2020, Bo Berglund via fpc-pascal wrote:

> What is the advantage of using synaser over serial in a simple non-gui
> program running in the console in Linux?
>
> I have been struggling making LazSerial work in a console app and been
> adviced to instead use synaser (which is what lazserial is built on).
> A few months back it seemingly started to work but with some "fixes".
>
> Yesterday I needed to quickly make a checkup tool for serial comm and
> this time (again) I was hit by the appearance of GUI errors. Don't
> remember how exactly I solved it last time...
> What I remembered was using widgetset nogui, but it seems impossible
> to get to such a setting in this simple program.
> And using 'interfaces' on the line preceding Lazserial was also a fix
> in the previous app but does not work now.
>
> So hence my question:
> Is there something bad about serial (built-in to fpc) that makes it
> unsuitable for use?
>
> Seems like there are virtually no posts describing solutions using
> serial...
> As it is built-in to fpc one would assume it is the preferred way, but
> for some reason it looks like it is not...

Why do you think so ?

Why not take it one step at a time ? 
Write a small console applocation that does what you want (some simple test
cases) with the serial unit.

You can do the same with synaser and compare your 2 solutions.

Then, once satisfied, integrate it in your final solution.
That can be GUI program if you need that, but does not have to be so.

Michael.


More information about the fpc-pascal mailing list