ts-7000
[Top] [All Lists]

Re: [ts-7000] TS-7800 COM2 port won't transmit until program has ended

To:
Subject: Re: [ts-7000] TS-7800 COM2 port won't transmit until program has ended
From: walter marvin <>
Date: Mon, 17 Jan 2011 17:12:39 -0800 (PST)


Try doing a flush after the write.

--- On Mon, 1/17/11, tommessum <> wrote:

From: tommessum <>
Subject: [ts-7000] TS-7800 COM2 port won't transmit until program has ended
To:
Date: Monday, January 17, 2011, 11:29 AM

 


In a nutshell I have: at the start:

fd = open("/dev/ttyS1", O_RDWR | O_NOCTTY); (1) (2)

followed by:

tcgetattr(fd,&oldtio);
newtio.c_cflag = B115200 | CRTSCTS | CS8 | CLOCAL | CREAD ;
newtio.c_iflag = 0;
newtio.c_oflag = 0;
newtio.c_lflag = 0;
newtio.c_cc[VMIN] = 1;
newtio.c_cc[VTIME] = 0;
tcsetattr(fd, TCSANOW, &newtio);

then later on, to write some data:
write(fd,"hello\r\n",7); (3)

The problem is that data doesn't get sent to the UART until the program is terminated. The "write" must be buffering the output data obviously. But I can't figure a way of forcing a flush after the "write".

There must be some simple obvious explanation, but I can't figure out why! Any ideas?

Thanks!

NB:

(1) Also have tried including "O_NDELAY O_NONBLOCK"

(2) Also have tried including "fcntl(fd, F_SETFL, O_NONBLOCK)"

(3) Also tried adding fsync(fd), fflush(NULL) after write()



__._,_.___


Your email settings: Individual Email|Traditional
Change settings via the Web (Yahoo! ID required)
Change settings via email: =Email Delivery: Digest | m("yahoogroups.com?subject","ts-7000-fullfeatured");=Change Delivery Format: Fully Featured">Switch to Fully Featured
Visit Your Group | Yahoo! Groups Terms of Use | =Unsubscribe

__,_._,___
<Prev in Thread] Current Thread [Next in Thread>
Admin

Disclaimer: Neither Andrew Taylor nor the University of NSW School of Computer and Engineering take any responsibility for the contents of this archive. It is purely a compilation of material sent by many people to the birding-aus mailing list. It has not been checked for accuracy nor its content verified in any way. If you wish to get material removed from the archive or have other queries about the archive e-mail Andrew Taylor at this address: andrewt@cse.unsw.EDU.AU