Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 01 Feb 1999 20:28:12 -0500
From:      Mark Turpin <mturpin@spel.com>
To:        questions@FreeBSD.ORG
Subject:   Serial programming
Message-ID:  <36B654AC.8489301D@spel.com>

next in thread | raw e-mail | index | archive | help
Hello,

        Ok,  I feel really stupid having to ask this..

    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?


Thanks

Mark

-----------------------------------------------------------------------------
Mark Turpin                   |  Consulting - Training - Network
Installation
Systems Engineer              |
Main Street Technology Centre |        http://www.MainStreetTech.com
-----------------------------------------------------------------------------




To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-questions" in the body of the message



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?36B654AC.8489301D>