Re: Question about GTK+ and timers
- From: Paul Davis <paul linuxaudiosystems com>
- To: Igor Korot <ikorot01 gmail com>
- Cc: gtk-list gnome org
- Subject: Re: Question about GTK+ and timers
- Date: Fri, 8 Apr 2011 18:28:02 -0400
On Fri, Apr 8, 2011 at 6:14 PM, Igor Korot <ikorot01 gmail com> wrote:
> On Fri, Apr 8, 2011 at 2:33 PM, Mikhail Titov <mlt gmx us> wrote:
>> As far as I understand it is possible to use it with NULL for encoding. It
>> should just read bytes with no interpretation.
>> http://www.mail-archive.com/gtk-list gnome org/msg29589.html
> I understand this.
> However, what I want is to read data in:
> struct Data
> char m_header;
> char m_code;
> char m_voltageMask;
> char m_highestVoltage;
> char m_lowestVoltage;
> char m_status;
> } m_data;
> I need to look at voltageMask, highestVoltage and lowestVoltage initially.
> Is it possible to use m_data with GIOChannel?
but you'd better hope that the compiler packs that data structure in
the same way the device is sending it. you'd be far better off not
using a struct for this, but just reading (in your case) 10 bytes.
sending raw C structs over any kind of "wire protocol" almost always
turns out to be huge mistake unless its been very carefully thought
] [Thread Prev