mil.dod.th.ose.linux.serial/src/java/mil/dod/th/ose/linux/physical/SerialPortProxyImpl.java
private void applyProperties() throws PhysicalLinkException
    {
        long c_iflag = 0;
        final long c_oflag = 0;  // output options not used
        long c_cflag = TerminalIO.CLOCAL 
                           | TerminalIO.CREAD 
                           | getBaudRateMask(m_BaudRate)
                           | getDataBitsMask(m_DataBits)
                           | getParityMask(m_Parity)
                           | getStopBitsMask(m_StopBits);
        final long c_lflag = 0;  // not used

        switch (m_FlowControl)
        {
            case XON_XOFF:
                c_iflag |= TerminalIO.IXON | TerminalIO.IXOFF;
                break;

            case HARDWARE:
                c_cflag |= TerminalIO.CRTSCTS;
                break;

            case NONE:
                // nothing to set in this case
                break;

            default:
                assert false : String.format("Unhandled flow control enumeration (%s)", m_FlowControl);
                break;
        }

        final short[] c_cc = new short[TerminalIO.NCCS];
        c_cc[TerminalIO.VMIN] = 1; // wait for at least one character on a read

        final int returnValue = TerminalIO.tcSetAttr(m_Fd, c_iflag, c_oflag, c_cflag, c_lflag, c_cc);
        if (returnValue != TerminalIO.TIO_SUCCESS)
        {
            throw new PhysicalLinkException(String.format("Unable to set terminal attributes, rv=%d", returnValue));
        }
        
        //Update input stream read timeout.
        m_InputStream.setReadTimeout(m_ReadTimeoutMs);
    }
/**
     * Applies serial port properties to hardware.
     * 
     * @throws PhysicalLinkException
     *             error applying properties
     */
Applies serial port properties to hardware.

@throws PhysicalLinkException
error applying properties
Applies serial port properties to hardware . @throws PhysicalLinkException error applying properties
private void applyProperties() throws PhysicalLinkException
    {
        long c_iflag = 0;
        final long c_oflag = 0;  
        long c_cflag = TerminalIO.CLOCAL 
                           | TerminalIO.CREAD 
                           | getBaudRateMask(m_BaudRate)
                           | getDataBitsMask(m_DataBits)
                           | getParityMask(m_Parity)
                           | getStopBitsMask(m_StopBits);
        final long c_lflag = 0;  
        switch (m_FlowControl)
        {
            case XON_XOFF:
                c_iflag |= TerminalIO.IXON | TerminalIO.IXOFF;
                break;
            case HARDWARE:
                c_cflag |= TerminalIO.CRTSCTS;
                break;
            case NONE:
                break;
            default:
                assert false : String.format("Unhandled flow control enumeration (%s)", m_FlowControl);
                break;
        }
        final short[] c_cc = new short[TerminalIO.NCCS];
        c_cc[TerminalIO.VMIN] = 1; 
        final int returnValue = TerminalIO.tcSetAttr(m_Fd, c_iflag, c_oflag, c_cflag, c_lflag, c_cc);
        if (returnValue != TerminalIO.TIO_SUCCESS)
        {
            throw new PhysicalLinkException(String.format("Unable to set terminal attributes, rv=%d", returnValue));
        }
        m_InputStream.setReadTimeout(m_ReadTimeoutMs);
    }
private void applyProperties ( ) throws PhysicalLinkException { long c_iflag = 0 ; final long c_oflag = 0 ; long c_cflag = TerminalIO . CLOCAL | TerminalIO . CREAD | getBaudRateMask ( m_BaudRate ) | getDataBitsMask ( m_DataBits ) | getParityMask ( m_Parity ) | getStopBitsMask ( m_StopBits ) ; final long c_lflag = 0 ; switch ( m_FlowControl ) { case XON_XOFF : c_iflag |= TerminalIO . IXON | TerminalIO . IXOFF ; break ; case HARDWARE : c_cflag |= TerminalIO . CRTSCTS ; break ; case NONE : break ; default : assert false : String . format ( "Unhandled flow control enumeration (%s)" , m_FlowControl ) ; break ; } final short [ ] c_cc = new short [ TerminalIO . NCCS ] ; c_cc [ TerminalIO . VMIN ] = 1 ; final int returnValue = TerminalIO . tcSetAttr ( m_Fd , c_iflag , c_oflag , c_cflag , c_lflag , c_cc ) ; if ( returnValue != TerminalIO . TIO_SUCCESS ) { throw new PhysicalLinkException ( String . format ( "Unable to set terminal attributes, rv=%d" , returnValue ) ) ; } m_InputStream . setReadTimeout ( m_ReadTimeoutMs ) ; }
Applies serial port properties to hardware.
Applies serial port properties to hardware .
// output options not used // not used // nothing to set in this case // wait for at least one character on a read //Update input stream read timeout.