Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 9 Dec 2004 17:24:57 +0100
From:      cpghost@cordula.ws
To:        martinlex <Alexandre.Martin@leg.ensieg.inpg.fr>
Cc:        freebsd-questions@freebsd.org
Subject:   Re: (aucun objet)
Message-ID:  <20041209162457.GA1579@bsdbox.farid-hajji.net>
In-Reply-To: <41B857A0.2070906@leg.ensieg.inpg.fr>
References:  <41B857A0.2070906@leg.ensieg.inpg.fr>

next in thread | previous in thread | raw e-mail | index | archive | help
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/



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20041209162457.GA1579>