(aucun objet)

cpghost at cordula.ws cpghost at cordula.ws
Thu Dec 9 08:22:01 PST 2004


On Thu, Dec 09, 2004 at 02:48:16PM +0100, martinlex wrote:
> Hello, I am beginner and I would like to program the parallel port on C 
> under freeBSD. I want to be able to receive and send binary data. I 
> suppose that this question was already treated but I did not find 
> information on the programming of this port under freeBSD.

Hello,

you could start by reading the man pages lpt(4), ppbus(4), ppc(4)
and ppi(4) and following the pointers in the SEE ALSO sections.
If you have any special questions, please feel free to ask.

Normally, using the parallel port is just as trivial as open(2)-ing
/dev/lpt0, then write(2)-ing and read(2)-ing from the file descriptor.
If you need more advanced control, apply ioctl(2)s on the file
descriptor, as listed in ppi(4) and other man pages. You can also
have a look at the source code of lptcontrol(8) for a good example
where an open(2), ioctl(2) and close(2) combination is used to
configure the parallel port:

/usr/src/usr.sbin/lptcontrol/lptcontrol.c

> thank you in advance of your assistance

Good luck and happy hacking!

> alex l'a"kro" du r?seau

Cheers,
cpghost.

-- 
Cordula's Web. http://www.cordula.ws/


More information about the freebsd-questions mailing list