Date: Thu, 13 May 1999 11:01:41 -0700 (PDT) From: Doug White <dwhite@resnet.uoregon.edu> To: HyunTech@mail.hitel.net Cc: questions@freebsd.org Subject: Re: How can I send/receive data th Message-ID: <Pine.BSF.4.03.9905131101090.16868-100000@resnet.uoregon.edu> In-Reply-To: <199905130900.RAA21231@mail.hitel.net>
next in thread | previous in thread | raw e-mail | index | archive | help
Don't bcc: lists, thanks.
On Thu, 13 May 1999 HyunTech@mail.hitel.net wrote:
> I want to send/receive data to other computer thru serial port without modem.
> So, I have connected COM1 to COM2 of itself and programed as follows.
>
> Shell("stty -f /dev/ttyd0 clocal cread raw 9600 cs8 -parenb -cstopb");
> Shell("stty -f /dev/ttyd1 clocal cread raw 9600 cs8 -parenb -cstopb");
> fd1 = open("/dev/ttyd0", O_RDWR);
> fd2 = open("/dev/ttyd1", O_RDWR);
> childpid = fork();
> if(childpid > 0)
> for(;;){
> ch = getchar();
> write(fd1, &ch, 1);
> }
> else if(childpid == 0)
> for(;;){
> rc = read(fd2, &ch, 1);
> putchar(ch);
> }
>
> But, if press any key, login message is displayed or nothing is displayed.
> But, I don't want to use serial port for terminal, but only for data
> communication.
> How can I solve this problem ?
Turn the getty off in /etc/ttys on your port (ttyd*) then kill -HUP init.
Doug White
Internet: dwhite@resnet.uoregon.edu | FreeBSD: The Power to Serve
http://gladstone.uoregon.edu/~dwhite | www.freebsd.org
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?Pine.BSF.4.03.9905131101090.16868-100000>
