On Wed, 9 Feb 2011, fabianhiernaux wrote:
> Hi everybody,
>
> I'd like to configure the ttyTS0 (COM3 on my TS7260) but when I run my
> soft during serial port openning I receved the error :
>
> tsuart:unsupported stop bits, using 1
> tsuart:unsupported byte size, using CS8
> tsuart:unsupported stop bits, using 1
>
You may want to simplify things by using the
cfmakeraw, cfsetispeed and cfsetospeed
macros, instead of trying to get all the individual bits right.
There are man pages for them.
I cannot see you setting CS8 for 8 data bits, and check the manual page for
tcsetattr, you are SETTING 2 stop bits by ORing in CSTOPB - you need to
clear it.
>
> Sure there is a problem in my config with cflag but where and what?
>
> Could you help me ?
>
>
> Here under my open serial function :
>
> #define DEVICE "/dev/ttyTS0"
>
> int OpenSerialPort()
> {
> int dawf;
>
> fd = open(DEVICE, O_RDWR | O_NOCTTY | O_NDELAY ); //O_RDWR | O_NOCTTY |
> O_NONBLOCK);
>
>
> if (fd < 0)
> {
> perror(DEVICE);
> return -1;
> }
>
>
>
> tcgetattr(fd,&oldtio);
>
> bzero(&settings, sizeof(settings)); // new tio
>
>
> settings.c_line = 0;
>
> settings.c_lflag &= ~(ISIG|ICANON|ECHO|ECHOE|ECHOK|ECHOKE|ECHOCTL|IEXTEN);
>
> settings.c_iflag &= ~(INLCR|IGNCR|ICRNL|IUCLC|IXON|IXOFF|IMAXBEL|PARMRK);
> settings.c_iflag |= IGNBRK;
> settings.c_iflag |= IGNPAR;
>
> settings.c_oflag &= ~(OLCUC|ONLCR|OCRNL|ONLRET|OFILL|OFDEL|OPOST);
>
> settings.c_cflag= B19200 | CLOCAL | CREAD | CSTOPB;
>
>
> settings.c_cc[VMIN] = 0;
> settings.c_cc[VTIME] = 0;
>
>
> tcflush(fd, TCIFLUSH);
> if ((dawf=tcsetattr(fd,TCSANOW,&settings))<0){
> printf("err new config");
> fflush(stdout);
> return -1;
> }
> disable_binary();
>
> return fd;
>
> }
>
>
------------------------------------
Yahoo! Groups Links
<*> To visit your group on the web, go to:
http://groups.yahoo.com/group/ts-7000/
<*> Your email settings:
Individual Email | Traditional
<*> To change settings online go to:
http://groups.yahoo.com/group/ts-7000/join
(Yahoo! ID required)
<*> To change settings via email:
<*> To unsubscribe from this group, send an email to:
<*> Your use of Yahoo! Groups is subject to:
http://docs.yahoo.com/info/terms/
|