Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 31 Jul 2002 11:39:38 -0500
From:      "Seth Henry" <jshamlet@hotmail.com>
To:        freebsd-questions@freebsd.org
Subject:   termios.h question
Message-ID:  <F305InrezDfEB0Xxfi500021725@hotmail.com>

next in thread | raw e-mail | index | archive | help
Hello,
I am working on porting some Linux code to FreeBSD. Specifically, I received 
a sample program from CrystalFontz to drive their CFA633 intelligent LCD 
module.

The problem is in the serial I/O file. There are several references to 
defines that aren't in the FreeBSD termios.h file.

In particular, this is what I get when I try to compile their code:
serial.c: In function `Serial_Init':
serial.c:91: `IUCLC' undeclared (first use in this function)
serial.c:91: (Each undeclared identifier is reported only once
serial.c:91: for each function it appears in.)
serial.c:95: `OLCUC' undeclared (first use in this function)
serial.c:96: `OFILL' undeclared (first use in this function)
serial.c:96: `OFDEL' undeclared (first use in this function)
serial.c:96: `NLDLY' undeclared (first use in this function)
serial.c:96: `CRDLY' undeclared (first use in this function)
serial.c:96: `TABDLY' undeclared (first use in this function)
serial.c:96: `BSDLY' undeclared (first use in this function)
serial.c:96: `VTDLY' undeclared (first use in this function)
serial.c:96: `FFDLY' undeclared (first use in this function)
serial.c:97: `NL0' undeclared (first use in this function)
serial.c:97: `CR0' undeclared (first use in this function)
serial.c:97: `TAB0' undeclared (first use in this function)
serial.c:97: `BS0' undeclared (first use in this function)
serial.c:97: `VT0' undeclared (first use in this function)
serial.c:97: `FF0' undeclared (first use in this function)

The code in question is:
        //input modes
        term.c_iflag &= 
~(IGNBRK|BRKINT|PARMRK|INPCK|ISTRIP|INLCR|IGNCR|ICRNL
                        |IUCLC|IXON|IXANY|IXOFF|IMAXBEL);
        term.c_iflag |= IGNPAR;

        //output modes
        term.c_oflag &= ~(OPOST|OLCUC|ONLCR|OCRNL|ONOCR|ONLRET|OFILL
                        |OFDEL|NLDLY|CRDLY|TABDLY|BSDLY|VTDLY|FFDLY);
        term.c_oflag |= NL0|CR0|TAB0|BS0|VT0|FF0;

        //control modes
        term.c_cflag &= ~(CSIZE|PARENB|CRTSCTS|PARODD|HUPCL);
        term.c_cflag |= CREAD|CS8|CSTOPB|CLOCAL;

        //local modes
        term.c_lflag &= ~(ISIG|ICANON|IEXTEN|ECHO|FLUSHO|PENDIN);
        term.c_lflag |= NOFLSH;

        //set baud rate
        cfsetospeed(&term, brate);
        cfsetispeed(&term, brate);

        //set new device settings
        if (tcsetattr(handle, TCSANOW, &term)  != 0)
        {
                printf("tcsetattr failed\n");
                return(4);
        }

Some of the defines are in the FreeBSD termios.h, but I'm not sure if they 
are trustworthy. Can anyone tell me what these defines should be?
Also, aren't these part of the POSIX spec? If so, what's the deal?

Thanks,
Seth Henry

_________________________________________________________________
MSN Photos is the easiest way to share and print your photos: 
http://photos.msn.com/support/worldwide.aspx


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?F305InrezDfEB0Xxfi500021725>