From owner-freebsd-questions Mon Feb 1 23:39:01 1999 Return-Path: Received: (from majordom@localhost) by hub.freebsd.org (8.8.8/8.8.8) id XAA29834 for freebsd-questions-outgoing; Mon, 1 Feb 1999 23:39:01 -0800 (PST) (envelope-from owner-freebsd-questions@FreeBSD.ORG) Received: from mail.atl.bellsouth.net (mail.atl.bellsouth.net [205.152.0.21]) by hub.freebsd.org (8.8.8/8.8.8) with ESMTP id XAA29829 for ; Mon, 1 Feb 1999 23:38:58 -0800 (PST) (envelope-from wghicks@bellsouth.net) Received: from wghicks.bellsouth.net (host-216-76-138-183.ath.bellsouth.net [216.76.138.183]) by mail.atl.bellsouth.net (8.8.8-spamdog/8.8.5) with ESMTP id CAA03636; Tue, 2 Feb 1999 02:38:55 -0500 (EST) Received: from localhost (localhost [127.0.0.1]) by wghicks.bellsouth.net (8.9.2/8.9.2) with ESMTP id CAA01948; Tue, 2 Feb 1999 02:55:52 -0500 (EST) (envelope-from wghicks@wghicks.bellsouth.net) To: mturpin@spel.com Cc: questions@FreeBSD.ORG Subject: Re: Serial programming In-Reply-To: Your message of "Tue, 2 Feb 1999 10:27:37 +0300" <199902020728.KAA09163@gate.nitek.ru> References: <199902020728.KAA09163@gate.nitek.ru> X-Mailer: Mew version 1.93 on XEmacs 20.4 (Emerald) Mime-Version: 1.0 Content-Type: Text/Plain; charset=us-ascii Content-Transfer-Encoding: 7bit Message-Id: <19990202025551L.wghicks@wghicks.bellsouth.net> Date: Tue, 02 Feb 1999 02:55:51 -0500 From: W Gerald Hicks X-Dispatcher: imput version 980905(IM100) Lines: 29 Sender: owner-freebsd-questions@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG > From: Mark Turpin > Subject: Serial programming > > I'm working on a program to communicate with an Amada Punch > Press. It communicates serial. I looked through the lists and found > a reference to the Serial Programming Guide for POSIX compliant > Operating Systems. So using the information I gathered there I've > opened the serial port like this > > fd = open("/dev/ttyd0", O_RDWR | O_NOCTTY | O_NDELAY); > > Then when I go to write to the port > > n = write(fd, "Hello This is a test", 20); > > n ends up being -1. I'm running this as root, I've tried with minicom > and it works fine. > > Any suggestions? I ported qtalk from QNX to FreeBSD; It seems to work well for me and illustrates asynch programming for Unix pretty well (YMMV) http://www.geocities.com/ResearchTriangle/ThinkTank/8131/qtalk.tgz Good Luck, Jerry Hicks wghicks@bellsouth.net To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-questions" in the body of the message