Probier mal:
Code:
	int SerialPort;
	struct termios SerialPortOptions;
	int SerialPortStatus;

	if ( ( SerialPort = open(devFilepath, O_RDWR | O_NOCTTY | O_NDELAY) ) == -1 ){
		perror("open_port: Unable to open /dev/ttyS0 - ");
	}
	
	fcntl(SerialPort, F_SETFL, 0);
	
	tcgetattr( SerialPort, &SerialPortOptions );
	cfsetispeed( &SerialPortOptions, B19200 );
	cfsetospeed( &SerialPortOptions, B19200 );			// 19200 bautrate
	SerialPortOptions.c_cflag &= ~PARENB;				// No parity
	SerialPortOptions.c_cflag &= ~CSTOPB;				// 1 stopbit
	SerialPortOptions.c_cflag &= ~CSIZE;				// 8 databits 
	SerialPortOptions.c_cflag |= CS8;
	SerialPortOptions.c_cflag &= ~CRTSCTS;				// no hardware flow control
	SerialPortOptions.c_cflag |= (CLOCAL | CREAD);		// Enable receiver & local mode
	SerialPortOptions.c_iflag |= (INPCK | ISTRIP);
	cfmakeraw( &SerialPortOptions );					// RAW data
	tcsetattr( SerialPort, TCSAFLUSH, &SerialPortOptions );
	
	// DTR=1 RTS=0
	ioctl(SerialPort, TIOCMGET, &SerialPortStatus);
	SerialPortStatus |= TIOCM_DTR;
	SerialPortStatus &= ~TIOCM_RTS;	
	ioctl(SerialPort, TIOCMSET, &SerialPortStatus);

// wirklicher Code mit read und write kommt hier her

	close(SerialPort);
Wobei devFilepath musst du halt durch dein serielles Port ersetzen (zB /dev/ttyS0)