From owner-freebsd-questions Wed Oct 23 20: 1:53 2002 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 5836037B401 for ; Wed, 23 Oct 2002 20:01:52 -0700 (PDT) Received: from dc.cis.okstate.edu (dc.cis.okstate.edu [139.78.100.219]) by mx1.FreeBSD.org (Postfix) with ESMTP id E115A43E65 for ; Wed, 23 Oct 2002 20:01:51 -0700 (PDT) (envelope-from martin@dc.cis.okstate.edu) Received: from dc.cis.okstate.edu (localhost [127.0.0.1]) by dc.cis.okstate.edu (8.11.6/8.11.6) with ESMTP id g9O31fG47058 for ; Wed, 23 Oct 2002 22:01:41 -0500 (CDT) (envelope-from martin@dc.cis.okstate.edu) Message-Id: <200210240301.g9O31fG47058@dc.cis.okstate.edu> To: freebsd-questions@freebsd.org Subject: Serial Data Acquisition Mystery Solved. Date: Wed, 23 Oct 2002 22:01:41 -0500 From: Martin McCormick Sender: owner-freebsd-questions@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG I wrote in yesterday with a question about using /dev/ttyd0 as a serial data input port. I found out that there were two reasons for my program not to work. Firstly, I had made a truly stupid mistake which must have happened when I may have gotten a phone call or somebody stopped by. I forgot to add one line to the code that dumped each received line of text in to the file I had opened for that purpose. The other problem was simply that I hadn't entered very much test data in to the file and the buffers hadn't flushed yet. I put a fflush (fp_inputstream); in my program to run when a file is closed and then one can see any inputted data. I haven't tried large amounts of data yet, but it seems to be working as planned. Does anybody know if opening /dev/ttyd0 for reading only has any ill effects? In this case, there will be no hand shaking or return data, only a 9600-baud stream from a piece of communications equipment to the serial port. Martin McCormick 405 744-7572 Stillwater, OK OSU Center for Computing and Information services Network Operations Group To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-questions" in the body of the message