From owner-freebsd-hackers Tue Oct 29 8: 9:16 2002 Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 52F5C37B401 for ; Tue, 29 Oct 2002 08:09:14 -0800 (PST) Received: from srv1.cosmo-project.de (srv1.cosmo-project.de [213.83.6.106]) by mx1.FreeBSD.org (Postfix) with ESMTP id 00C8C43E7B for ; Tue, 29 Oct 2002 08:09:13 -0800 (PST) (envelope-from ticso@cicely8.cicely.de) Received: from cicely5.cicely.de (cicely5.cicely.de [IPv6:3ffe:400:8d0:301:200:92ff:fe9b:20e7]) by srv1.cosmo-project.de (8.12.5/8.12.5) with ESMTP id g9TG8qWQ072230 (version=TLSv1/SSLv3 cipher=EDH-RSA-DES-CBC3-SHA bits=168 verify=OK); Tue, 29 Oct 2002 17:08:55 +0100 (CET) (envelope-from ticso@cicely8.cicely.de) Received: from cicely8.cicely.de (cicely8.cicely.de [10.1.1.10]) by cicely5.cicely.de (8.12.6/8.12.6) with ESMTP id g9TG8pCu028006 (version=TLSv1/SSLv3 cipher=EDH-RSA-DES-CBC3-SHA bits=168 verify=NO); Tue, 29 Oct 2002 17:08:51 +0100 (CET) (envelope-from ticso@cicely8.cicely.de) Received: from cicely8.cicely.de (localhost [127.0.0.1]) by cicely8.cicely.de (8.12.6/8.12.6) with ESMTP id g9TG8ol8017178; Tue, 29 Oct 2002 17:08:50 +0100 (CET) (envelope-from ticso@cicely8.cicely.de) Received: (from ticso@localhost) by cicely8.cicely.de (8.12.6/8.12.6/Submit) id g9TG8k0j017177; Tue, 29 Oct 2002 17:08:46 +0100 (CET) Date: Tue, 29 Oct 2002 17:08:45 +0100 From: Bernd Walter To: Joe Sunday Cc: David Nicholas Kayal , freebsd-hackers@FreeBSD.ORG Subject: Re: i am looking for a 5 volt signal Message-ID: <20021029160844.GA16922@cicely8.cicely.de> Reply-To: ticso@cicely.de References: <20021028135635.GA28293@csh.rit.edu> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20021028135635.GA28293@csh.rit.edu> X-Operating-System: FreeBSD cicely8.cicely.de 5.0-CURRENT i386 User-Agent: Mutt/1.5.1i Sender: owner-freebsd-hackers@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG On Mon, Oct 28, 2002 at 08:56:35AM -0500, Joe Sunday wrote: > On Sun, Oct 27, 2002 at 09:12:33AM -0800, David Nicholas Kayal wrote: > > > I'm looking for a 5 volt signal. > > > > I have wires plugged into pins 2 and 25 of the parallel port. > > > > I have written a small program: > > > > #include > > #include > > #include > > > > int main() > > { > > int fd; > > while(1) > > { > > ioctl(fd, PPISDATA, 255); > > } > > } > > PPISDATA actually takes an int* argument. (The man page may be a tad > confusing here.) No it takes an u_int8_t* exactly as written in the manpage. Using an int doesn't work in all cases. I have no idea what part of the manpage is confusing. > Try > int main() { > int fd; > int d = 255; u_int8_t d = 255; > fd = open( "/dev/ppi0", O_RDWR ); > > ioctl( fd, PPISDATA, &d ); > > return 0; > } -- B.Walter COSMO-Project http://www.cosmo-project.de ticso@cicely.de Usergroup info@cosmo-project.de To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-hackers" in the body of the message