NUL chars and g_io_channel_read_chars



Hello people.

I was writing a small program to communicate with a GPS. Receiving NMEA
data went well, but when I tried to implement the (binary) TSIP protocol,
I find that my program hangs. Some data:

1) The serial port is programmed as non-canonical input, vmin=1, time=0

2) I've assigned:

  gps_port = g_io_channel_unix_new(gps_fd);

  rd = gtk_input_add_full(gps_fd, GDK_INPUT_READ,
                          gpsport_callback,
                          NULL,
                          NULL,         // data
                          NULL);

3) I read the characters in the callback:

  g_io_channel_read_chars(gps_port, &inch, 1, &incnt, NULL);

I find that the callback works fine, but gets called continuously when a
NUL character arrives. Looking around on the net, I found no references as
to why the NUL would be an exception.

I'd appreciate a pointer
John



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