GIOChannel and serial ports



Hello all.

I'm using a serial port to communicate with an industrial controller at
a slow 9600 Baud. I've programmed a GIOChannel for reception, but I loose
characters if they come too fast (or the CPU is busy - tested by switching
desktops quickly). CPU is 1.4 GHz, that should not be the problem.

Questions:

1) I opened only one fd for the port, as RDWR. I use reception with a
GIOChannel (GIO_POLL_IN only set), and use a normal port write to send
information. Is this correct or should I open two fds - one for RD one for
WR?

2) Is is even correct to mix GIOChannel IO with normal IO (be it on
different channels?

The data comes in pairs of characters, closely spaced. The second
character changes from C8 to EC, from C0 to E0 and C4 to E6, indicating a
bit displacement... Yet g_io_channel_read_chars does not indicate any
error.

Suggestions?
John



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]