func Open(device string, speed int) (*Port, error) {
	const openFlags = unix.O_NONBLOCK | unix.O_NOCTTY | unix.O_RDWR
	fd, err := unix.Open(device, openFlags, 0)
	if err != nil {
		return nil, err
	}
	baudrate, err := getBaudRate(speed)
	if err != nil {
		return nil, err
	}
	err = unix.IoctlSetTermios(fd, unix.TCSETS, &unix.Termios{
		Iflag: unix.IGNPAR,
		Cflag: unix.CLOCAL | unix.CREAD | unix.CS8 | baudrate,
	})
	if err != nil {
		return nil, err
	}
	err = unix.SetNonblock(fd, false)
	if err != nil {
		return nil, err
	}
	return &Port{fd}, nil
}
// Open opens the specified serial device.
Open opens the specified serial device.
// Open opens the specified serial device .
func Open(device string, speed int) (*Port, error) {
	const openFlags = unix.O_NONBLOCK | unix.O_NOCTTY | unix.O_RDWR
	fd, err := unix.Open(device, openFlags, 0)
	if err != nil {
		return nil, err
	}
	baudrate, err := getBaudRate(speed)
	if err != nil {
		return nil, err
	}
	err = unix.IoctlSetTermios(fd, unix.TCSETS, &unix.Termios{
		Iflag: unix.IGNPAR,
		Cflag: unix.CLOCAL | unix.CREAD | unix.CS8 | baudrate,
	})
	if err != nil {
		return nil, err
	}
	err = unix.SetNonblock(fd, false)
	if err != nil {
		return nil, err
	}
	return &Port{fd}, nil
}
func Open ( device string , speed int ) ( * Port , error ) { const openFlags = unix . O_NONBLOCK | unix . O_NOCTTY | unix . O_RDWR fd , err := unix . Open ( device , openFlags , 0 ) if err != nil { return nil , err } baudrate , err := getBaudRate ( speed ) if err != nil { return nil , err } err = unix . IoctlSetTermios ( fd , unix . TCSETS , & unix . Termios { Iflag : unix . IGNPAR , Cflag : unix . CLOCAL | unix . CREAD | unix . CS8 | baudrate , } ) if err != nil { return nil , err } err = unix . SetNonblock ( fd , false ) if err != nil { return nil , err } return & Port { fd } , nil }
Open opens the specified serial device.
Open opens the specified serial device .