[fpc-pascal] Serial port parity...
henry.vermaak at gmail.com
Tue Mar 2 14:23:49 CET 2010
On 2 March 2010 12:52, Mihai Rainer <mihai at remember.ro> wrote:
> Is there eny chance to handle the parity bit for serial
> port communication?
> I am using a 9 bit communication with a device and I need
> to control the 9th bit.
> I tried synaser. It dows not handle parity for MARK/SPACE.
> I have written a procedure to count bits in a byte and
> config the port for EVEN/ODD parity acordingly to have the
> parity bit as I need. It is working, but, I have to insert
> a 2ms delay after each byte sent for settling serial port
> on each parity mode change. It is working fine except that
> 2ms will trigger the timeout procedure on the serial
> equipment. So, I need to control parity bit on the fly. Any
> chance to do that without building a serial interface with
> a uC?
Read `man termios` (see the CMSPAR, PARENB, PARODD flags). You can
probably modify synaser, or just call tcgetattr/tcgetattr yourself
(these are in unit termio.pp). Note that this is not supported on all
More information about the fpc-pascal