From owner-freebsd-questions Mon Feb 1 23:28:45 1999 Return-Path: Received: (from majordom@localhost) by hub.freebsd.org (8.8.8/8.8.8) id XAA27916 for freebsd-questions-outgoing; Mon, 1 Feb 1999 23:28:45 -0800 (PST) (envelope-from owner-freebsd-questions@FreeBSD.ORG) Received: from gate.nitek.ru (nitek.east.ru [195.170.63.240]) by hub.freebsd.org (8.8.8/8.8.8) with ESMTP id XAA27908 for ; Mon, 1 Feb 1999 23:28:42 -0800 (PST) (envelope-from igor@nitek.ru) Received: from igor (igor.nitek.ru [192.168.1.10]) by gate.nitek.ru (8.9.1/8.9.1) with ESMTP id KAA09163 for ; Tue, 2 Feb 1999 10:28:37 +0300 (MSK) Message-Id: <199902020728.KAA09163@gate.nitek.ru> From: "Igor Sysoev" To: Subject: Re: Serial programming Date: Tue, 2 Feb 1999 10:27:37 +0300 X-MSMail-Priority: Normal X-Priority: 3 X-Mailer: Microsoft Internet Mail 4.70.1161 MIME-Version: 1.0 Content-Type: text/plain; charset=KOI8-R Content-Transfer-Encoding: 7bit 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? May you should work with /dev/cuaa0 instead ? As far as I know you will be blocked while opening /dev/ttyd0 until there will be DCD line active. With best regards, Igor Sysoev To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-questions" in the body of the message