imm wrote:
> However - fltk does not provide any portability layer for any of  
> these serial interfaces: all are better supported by specific cross- 
> platform libs elsewhere. Pick one that does what you need and use it.
> Actually accessing the serial port on a PC is pretty trivial though,  
> so writing your own code with a few #ifdef's to deal with the various  
> different OS peculiarities is fairly easy, and quite educational too!

        Yes, I think SetCommTimeouts()/GetCommState()/SetCommState() is
        what I've used in the past under WIN32 to open the serial port,
        set the baud rate, etc.

        Then you can just use WriteFile()/ReadFile() to send/receive
        data over the port.

        I used this technique for bidirectional communications with
        an RS-232 oriented stepper motor drive.. very easy (if you know
        where to start!). Using the low level access to the ports
        avoids all of microsoft's higher level crapola that changes often
        and is needlessly "heavy".

        To integrate the above with FLTK is probably best done with
        either a thread, or creating your own Fl::run() loop using
        Fl::wait() with some small timeout, so you can poll back and
        forth between FLTK and the serial port.
        
_______________________________________________
fltk-dev mailing list
[email protected]
http://lists.easysw.com/mailman/listinfo/fltk-dev

Reply via email to