On 02.04.2008, at 22:19, Mike bug wrote:
> I need to use the RS-232.  Can someone share his code to operate the  
> RS-232 serial port because i have no ide where to start from.

One of my apps, DyneTK, uses the serial port in FLTK. It is public  
domain:

http://code.google.com/p/dynee5/source/browse

Just extract Flio_Serial_Port and Flio_Stream to get your serial  
communication going (there may be other dependencies). DynTK and all  
source code within is licensed LGPL.

Flio_Serial_Port is just a standard widget that can be visible in your  
GUI. You can open and close your connection and wrte to it. Whenever  
Flio_Serial_Widget receives data over the serial port, the widget's  
callback will be called. You can then use available() to find out how  
many bytes can be read without blocking, and then simply read() those.

The code has been tested and used quite a lot. Nevertheless, please  
let me know if you find bugs.

Matthias

_______________________________________________
fltk-dev mailing list
[email protected]
http://lists.easysw.com/mailman/listinfo/fltk-dev

Reply via email to