[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

RE: serial port loop



Ok. The mistake made by me.

My application starts from inittab and of course I set up the serial port...
That's way the ttyS0 differs from S1 and S2. Like a newbie ;-)

Thanks,
Sza.

Problems with Windows - Reboot.
Problems with Linux       - Be root.


> -----Original Message-----
> From:	Pieter Grimmerink [SMTP:mailinglists@xxxxxxx.nl]
> Sent:	2003. március 2. 19:18
> To:	'dev-etrax@xxxxxxx.com'
> Cc:	tamas.szabo@xxxxxxx.com
> Subject:	Re: serial port loop
> 
> 
> 
> On Sat, 1 Mar 2003, Szabo, Tamas wrote:
> 
> ...
> > cat /dev/ttySx and echo Hello > /dev/ttySx
> >
> > in two terminal window. Txd and RxD was connected to each other. I
> realised
> > that with ttyS0 if I sent once it appears once in the other window.
> However
> > on ttyS1 and ttyS2 seems like an endless loop. The output was:
> >
> > Hello <newline><nl>
> > Hello <nl><nl><nl><nl>
> > Hello <nl><nl><nl><nl><nl><nl><nl><nl>
> > Hello 16x<nl>
> > ...
> >
> > Is it normal?
> 
> Yes, echoing etc are enabled by default.
> This is what I do to get a somewhat 'normal' comport:
> 
> struct termios term;
> 
> tcgetattr(fd, &term);
> 
> term.c_lflag &= ~(ICANON | ECHO | ISIG | XCASE);
> term.c_cflag |= (CLOCAL | CREAD);
> 
> term.c_cflag &= ~CRTSCTS;
> term.c_iflag &= ~(INPCK | ISTRIP | IUCLC);
> term.c_iflag &= ~(IXON | IXOFF | IXANY);
> term.c_cflag &= ~CSIZE;
> term.c_cflag |= CS8;
> term.c_oflag &= ~OPOST;
> term.c_cc[VMIN] = 1;
> term.c_cc[VTIME] = 0;
> 
> cfsetispeed(&term,B115200);
> cfsetospeed(&term,B115200);
> 
> tcsetattr(fd,TCSANOW,&term);
> 
> Regards,
> 
> Pieter
> 


***********************************************************************************************
The information contained in this message or any of its attachments may be confidential and is intended for the exclusive use of the addressee(s). Any disclosure, reproduction, distribution or other dissemination or use of this communication is strictly prohibited without the express permission of the sender. The views expressed in this email are those of the individual and not necessarily those of Sony or Sony affiliated companies. Sony email is for business use only. 

This email and any response may be monitored by Sony United Kingdom Limited.
(04)
***********************************************************************************************