[fpc-pascal] Question on programming serial communication.

Johann Glaser Johann.Glaser at gmx.at
Mon Feb 25 17:43:45 CET 2008


Hi!

> 3. I will prefer to simply open a /dev/ttyXX from my central software and
>    talk to my controllers then. If this is interrupt driven or not, I do
>    not really (want to) care about.
>    I expect that an Operating System like Linux will be able to give me
>    that functionality and does all this low level stuff by itself?
> 
>    I only want to use sme kind of API, Class, Object or set of procedures
>    which allows me similar things as were possible with the FOSSIL 
>    driver:
>    - Buffered I/O
>    - Flow Control as I need (RTS/CTS, XON/XOFF, Both, None)
>    - Direct Control of control lines like DTR, ...
>    - Possibilities for monitoring fill level of buffers, to force
>      them to be erased (made empty), ...

In Linux you simply open() the /dev/ttySxx device and then read() and
write() to it. This is for data, for other stuff (e.g. flow
control, ...) can be done via ioctl() (please excuse the C syntax). But
as Horacio already said you probably go better with a wrapper, e.g.
Synaser or TSerial (but I didn't use either).

Your second problem could be to find suitable Linux drivers for your
special multiport-RS232 hardware. But I assume you already got it
working.

Bye
  Hansi





More information about the fpc-pascal mailing list