On Fri, Aug 21, 2020 at 12:05 PM Bo Berglund via fpc-pascal <
fpc-pascal@lists.freepascal.org> wrote:

> So hence my question:
> Is there something bad about serial (built-in to fpc) that makes it
> unsuitable for use?
>

In my limited experience the FPC serial unit is a bit more low level than
the components such as synaser etc.  There is a bit more of a learning
curve and one needs to decide whether to go blocking or not and how to
handle async reads etc.  I needed to use custom baud rates with auto baud
for an application (debugwire-gdb-bridge) so I took the time to figure out
some of the details.  Since then I've re-used it in other serial based
applications - once you get past the learning curve of how things fit
together it is relatively easy (I guess like most things).  I prefer it now
because it reduces external dependencies in a project.


> Seems like there are virtually no posts describing solutions using
> serial...
>

Here is a unit showing how to open, read and write (blocking) using the
serial unit:
https://github.com/ccrause/debugwire-gdb-bridge/blob/master/serialutils.pas
Unfortunately there is other code for sending a break command and setting
custom baud rates which makes it appear more complicated than it should be.
_______________________________________________
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
https://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal

Reply via email to