[Gambas-devel] Parallel port

Jean-Francois Perreault cmcpero at ...28...
Mon Jun 2 17:34:48 CEST 2003


I haven't used gambas yet so I'm completely in the dark here , but 
wouldn't it be possible to use /dev/ttySx as a normal file to use the 
serial ports (and other devices) without the need for a special components

I mean if cat /dev/ttyS0 display all the raw input from a mouse all you 
need is a data parser and you can read mouse data , wouldn't it work ? 
maybe I'm way out on this but I'd like to know why



Rob wrote:

>You would need to write a parallel port component in C or C++.  Since someone 
>was just asking about the serial port, maybe one of you should write a 
>generalized Unix device component with support for ioctl functions and maybe 
>stty for the serial stuff.  (I have no serial devices at all and my only 
>parallel port devices have undocumented interfaces, so I won't be of much 
>help writing or testing such a thing.)
>
>Further discussion about such a component would probably be appropriate to 
>keep talking about on gambas-devel, but further discussion about workarounds 
>like using helper apps from your Gambas project (though I know of no parallel 
>port helper apps like cu is for the serial port) should go to gambas-user.  
>For example, if what you really want to do is drive a printer, there's 
>already a printer component in Gambas.
>
>If you do want to learn how to write a component, there's an example one in 
>src/lib/example from the Gambas source tarball.  It looks like it's included 
>in the Gambas build by default, so if you go into Project Properties and 
>check off gb.example under Components, you can then use the component 
>explorer to see how its methods and properties show up to Gambas.  It's not 
>documented, but at least the source is heavily commented.  Notice that the 
>example is GPL'ed so make sure to share your source with all of us if you 
>base a component on it ;)
>
>Rob
>  
>
-- 
--------------------
Jean-Francois Perreault
NanoTech Informatique

UIN 783056
cmcpero at ...28...





More information about the Devel mailing list