Failing this method I am moving to have my platform specific code handle the 
send and receiving, however I would still really like to use some kind of a 
callback like g_io_add_watch.

I can easily achieve this under Linux with a little re-organisation to separate 
out the platform specific portions.

Does anyone have a fairly straightforward approach to do the same under 
windows?  If I cannot add a watch to the serial port I am afraid I may have to 
either fake it with a poll?

Regards,
Burkey


-----Original Message-----
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Burke.Daniel
Sent: Friday, 4 May 2007 10:11
To: gtk-list@gnome.org
Subject: RE: Hello and win32 g_io_channel help needed

Actually I changed it to use the win32 one but it behaves the same.

This seems to be a difficult one to answer, so far nobody has been able to even 
suggest anything.


-----Original Message-----
From: Chris Vine [mailto:[EMAIL PROTECTED] 
Sent: Thursday, 3 May 2007 20:15
To: Burke.Daniel
Cc: gtk-list@gnome.org
Subject: Re: Hello and win32 g_io_channel help needed

On Thu, 2007-05-03 at 14:04 +1000, Burke.Daniel wrote:
> Hail!  I am new.. so gday to everyone here.
>
> I am after some assistance with getting my event-driven serial port
> input working on Windows.
> 
> The project is a portable serial tool for internal use within our
> company, I am writing it using libglademm since I love C++ and am a
> big Gnome/GTK fan (my laptop being Ubuntu Gnome based)

> On Linux I am using open and termios to handle the serial port setup,
> finally returning a GIOChannel for monitoring and so far.. so good.
> However I am now trying to get the evil version of it running and am
> not so happy.  Here I am using CreateFile to open and configure my
> port, then use:
>
> m_PortDescriptor = _open_osfhandle((long)m_PortHandle, 0);
> 
> channel = g_io_channel_unix_new(m_PortDescriptor);

> to get the channel.  Later on I use g_io_add_watch to setup a monitor
> which seems to compile and run ok, however when I send data using
> g_io_channel_write_chars it seems to crash and I also don’t seem to be
> receiving data (often resulting another application halt)

You mention that you are using Windows, so is there any reason why you
are calling g_io_channel_unix_new() instead of the
g_io_channel_win32_new*() functions to create the GIOChannel object?

Chris




_______________________________________________
gtk-list mailing list
gtk-list@gnome.org
http://mail.gnome.org/mailman/listinfo/gtk-list
_______________________________________________
gtk-list mailing list
gtk-list@gnome.org
http://mail.gnome.org/mailman/listinfo/gtk-list

Reply via email to