From owner-freebsd-questions@FreeBSD.ORG Thu Dec 9 16:22:01 2004 Return-Path: Delivered-To: freebsd-questions@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 7FF3216A4CE for ; Thu, 9 Dec 2004 16:22:01 +0000 (GMT) Received: from fw.farid-hajji.net (fw.farid-hajji.net [213.146.115.42]) by mx1.FreeBSD.org (Postfix) with ESMTP id F358843D5A for ; Thu, 9 Dec 2004 16:22:00 +0000 (GMT) (envelope-from cpghost@cordula.ws) Received: from bsdbox.farid-hajji.net (bsdbox [192.168.254.3]) by fw.farid-hajji.net (Postfix) with ESMTP id 312464AD8D; Thu, 9 Dec 2004 17:21:26 +0100 (CET) Date: Thu, 9 Dec 2004 17:24:57 +0100 From: cpghost@cordula.ws To: martinlex Message-ID: <20041209162457.GA1579@bsdbox.farid-hajji.net> References: <41B857A0.2070906@leg.ensieg.inpg.fr> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <41B857A0.2070906@leg.ensieg.inpg.fr> User-Agent: Mutt/1.5.6i cc: freebsd-questions@freebsd.org Subject: Re: (aucun objet) X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 09 Dec 2004 16:22:01 -0000 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/