当前位置: 首页>>代码示例>>Java>>正文


Java SerialPort.FLOWCONTROL_RTSCTS_IN属性代码示例

本文整理汇总了Java中gnu.io.SerialPort.FLOWCONTROL_RTSCTS_IN属性的典型用法代码示例。如果您正苦于以下问题:Java SerialPort.FLOWCONTROL_RTSCTS_IN属性的具体用法?Java SerialPort.FLOWCONTROL_RTSCTS_IN怎么用?Java SerialPort.FLOWCONTROL_RTSCTS_IN使用的例子?那么恭喜您, 这里精选的属性代码示例或许可以为您提供帮助。您也可以进一步了解该属性所在gnu.io.SerialPort的用法示例。


在下文中一共展示了SerialPort.FLOWCONTROL_RTSCTS_IN属性的9个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: stringToFlow

/**
 * Converts a <tt>String</tt> describing a flow control type to the
 * <tt>int</tt> which is defined in SerialPort.
 *
 * @param flowcontrol the <tt>String</tt> describing the flow control type.
 * @return the <tt>int</tt> describing the flow control type.
 */
private int stringToFlow(String flowcontrol) {
  flowcontrol = flowcontrol.toLowerCase();
  if (flowcontrol.equals("none")) {
    return SerialPort.FLOWCONTROL_NONE;
  }
  if (flowcontrol.equals("xon/xoff out")) {
    return SerialPort.FLOWCONTROL_XONXOFF_OUT;
  }
  if (flowcontrol.equals("xon/xoff in")) {
    return SerialPort.FLOWCONTROL_XONXOFF_IN;
  }
  if (flowcontrol.equals("rts/cts in")) {
    return SerialPort.FLOWCONTROL_RTSCTS_IN;
  }
  if (flowcontrol.equals("rts/cts out")) {
    return SerialPort.FLOWCONTROL_RTSCTS_OUT;
  }
  return SerialPort.FLOWCONTROL_NONE;
}
 
开发者ID:andrey-desman,项目名称:openhab-hdl,代码行数:26,代码来源:SerialParameters.java

示例2: flowToString

/**
 * Converts an <tt>int</tt> describing a flow control type to a
 * String describing a flow control type.
 *
 * @param flowcontrol the <tt>int</tt> describing the
 *                    flow control type.
 * @return the <tt>String</tt> describing the flow control type.
 */
private String flowToString(int flowcontrol) {
  switch (flowcontrol) {
    case SerialPort.FLOWCONTROL_NONE:
      return "none";
    case SerialPort.FLOWCONTROL_XONXOFF_OUT:
      return "xon/xoff out";
    case SerialPort.FLOWCONTROL_XONXOFF_IN:
      return "xon/xoff in";
    case SerialPort.FLOWCONTROL_RTSCTS_IN:
      return "rts/cts in";
    case SerialPort.FLOWCONTROL_RTSCTS_OUT:
      return "rts/cts out";
    default:
      return "none";
  }
}
 
开发者ID:andrey-desman,项目名称:openhab-hdl,代码行数:24,代码来源:SerialParameters.java

示例3: updatePortParameters

/**
 * Initialize all port parameters DIALOG -&gt; PORT
 */
public void updatePortParameters(SerialPort port)
{
	if (initialized && port != null)
	{
		try
		{
			port.setSerialPortParams(Integer.valueOf(cbBaudrate.getSelectedItem().toString()).intValue(),
				cbDataBits.getSelectedIndex() + 5,
				cbStopBits.getSelectedIndex() + 1,
				cbParity.getSelectedIndex());
			// flow control parameters
			int mode = 0;
			mode |= (cbProtocolRx.getSelectedIndex() == 1) ? SerialPort.FLOWCONTROL_RTSCTS_IN : (cbProtocolRx.getSelectedIndex() == 2) ? SerialPort.FLOWCONTROL_XONXOFF_IN : 0;
			mode |= (cbProtocolTx.getSelectedIndex() == 1) ? SerialPort.FLOWCONTROL_RTSCTS_OUT : (cbProtocolTx.getSelectedIndex() == 2) ? SerialPort.FLOWCONTROL_XONXOFF_OUT : 0;
			port.setFlowControlMode(mode);
		} catch (Exception ex)
		{
			ex.printStackTrace();
		}
	}
}
 
开发者ID:fr3ts0n,项目名称:AndrOBD,代码行数:24,代码来源:SerialConfigPanel.java

示例4: flowToString

/**
 * Converts an <code>int</code> describing a flow control type to a <code>String</code>
 * describing a flow control type.
 * 
 * @param flowControl
 *            An <code>int</code> describing a flow control type.
 * @return A <code>String</code> describing a flow control type.
 */
String flowToString(final int flowControl) {
	switch (flowControl) {
	case SerialPort.FLOWCONTROL_NONE:
		return "None"; //$NON-NLS-1$
	case SerialPort.FLOWCONTROL_XONXOFF_OUT:
		return "Xon/Xoff Out"; //$NON-NLS-1$
	case SerialPort.FLOWCONTROL_XONXOFF_IN:
		return "Xon/Xoff In"; //$NON-NLS-1$
	case SerialPort.FLOWCONTROL_RTSCTS_IN:
		return "RTS/CTS In"; //$NON-NLS-1$
	case SerialPort.FLOWCONTROL_RTSCTS_OUT:
		return "RTS/CTS Out"; //$NON-NLS-1$
	default:
		return "None"; //$NON-NLS-1$
	}
}
 
开发者ID:wolfgang-ch,项目名称:mytourbook,代码行数:24,代码来源:SerialParameters.java

示例5: stringToFlow

/**
 * Converts a <code>String</code> describing a flow control type to an <code>int</code> type
 * defined in <code>SerialPort</code>.
 * 
 * @param flowControl
 *            A <code>string</code> describing a flow control type.
 * @return An <code>int</code> describing a flow control type.
 */
private int stringToFlow(final String flowControl) {
	if (flowControl.equals("None")) { //$NON-NLS-1$
		return SerialPort.FLOWCONTROL_NONE;
	}
	if (flowControl.equals("Xon/Xoff Out")) { //$NON-NLS-1$
		return SerialPort.FLOWCONTROL_XONXOFF_OUT;
	}
	if (flowControl.equals("Xon/Xoff In")) { //$NON-NLS-1$
		return SerialPort.FLOWCONTROL_XONXOFF_IN;
	}
	if (flowControl.equals("RTS/CTS In")) { //$NON-NLS-1$
		return SerialPort.FLOWCONTROL_RTSCTS_IN;
	}
	if (flowControl.equals("RTS/CTS Out")) { //$NON-NLS-1$
		return SerialPort.FLOWCONTROL_RTSCTS_OUT;
	}
	return SerialPort.FLOWCONTROL_NONE;
}
 
开发者ID:wolfgang-ch,项目名称:mytourbook,代码行数:26,代码来源:SerialParameters.java

示例6: stringToFlow

/**
 * Converts a <tt>String</tt> describing a flow control type to the
 * <tt>int</tt> which is defined in SerialPort.
 *
 * @param flowcontrol the <tt>String</tt> describing the flow control type.
 * @return the <tt>int</tt> describing the flow control type.
 */
private int stringToFlow(String flowcontrol) {
    flowcontrol = flowcontrol.toLowerCase();
    if (flowcontrol.equals("none")) {
        return SerialPort.FLOWCONTROL_NONE;
    }
    if (flowcontrol.equals("xon/xoff out")) {
        return SerialPort.FLOWCONTROL_XONXOFF_OUT;
    }
    if (flowcontrol.equals("xon/xoff in")) {
        return SerialPort.FLOWCONTROL_XONXOFF_IN;
    }
    if (flowcontrol.equals("rts/cts in")) {
        return SerialPort.FLOWCONTROL_RTSCTS_IN;
    }
    if (flowcontrol.equals("rts/cts out")) {
        return SerialPort.FLOWCONTROL_RTSCTS_OUT;
    }
    return SerialPort.FLOWCONTROL_NONE;
}
 
开发者ID:openhab,项目名称:openhab1-addons,代码行数:26,代码来源:SerialParameters.java

示例7: flowToString

/**
 * Converts an <tt>int</tt> describing a flow control type to a
 * String describing a flow control type.
 *
 * @param flowcontrol the <tt>int</tt> describing the
 *            flow control type.
 * @return the <tt>String</tt> describing the flow control type.
 */
private String flowToString(int flowcontrol) {
    switch (flowcontrol) {
        case SerialPort.FLOWCONTROL_NONE:
            return "none";
        case SerialPort.FLOWCONTROL_XONXOFF_OUT:
            return "xon/xoff out";
        case SerialPort.FLOWCONTROL_XONXOFF_IN:
            return "xon/xoff in";
        case SerialPort.FLOWCONTROL_RTSCTS_IN:
            return "rts/cts in";
        case SerialPort.FLOWCONTROL_RTSCTS_OUT:
            return "rts/cts out";
        default:
            return "none";
    }
}
 
开发者ID:openhab,项目名称:openhab1-addons,代码行数:24,代码来源:SerialParameters.java

示例8: stringToFlow

/**
 * Converts a <code>String</code> describing a flow control type to an <code>int</code> type
 * defined in <code>SerialPort</code>.
 * 
 * @param flowControl
 *            A <code>string</code> describing a flow control type.
 * @return An <code>int</code> describing a flow control type.
 */
private int stringToFlow(final String flowControl){
	if (flowControl.equals("None")) { //$NON-NLS-1$
		return SerialPort.FLOWCONTROL_NONE;
	}
	if (flowControl.equals("Xon/Xoff Out")) { //$NON-NLS-1$
		return SerialPort.FLOWCONTROL_XONXOFF_OUT;
	}
	if (flowControl.equals("Xon/Xoff In")) { //$NON-NLS-1$
		return SerialPort.FLOWCONTROL_XONXOFF_IN;
	}
	if (flowControl.equals("RTS/CTS In")) { //$NON-NLS-1$
		return SerialPort.FLOWCONTROL_RTSCTS_IN;
	}
	if (flowControl.equals("RTS/CTS Out")) { //$NON-NLS-1$
		return SerialPort.FLOWCONTROL_RTSCTS_OUT;
	}
	return SerialPort.FLOWCONTROL_NONE;
}
 
开发者ID:elexis,项目名称:elexis-3-core,代码行数:26,代码来源:SerialParameters.java

示例9: flowToString

/**
 * Converts an <code>int</code> describing a flow control type to a <code>String</code>
 * describing a flow control type.
 * 
 * @param flowControl
 *            An <code>int</code> describing a flow control type.
 * @return A <code>String</code> describing a flow control type.
 */
String flowToString(final int flowControl){
	switch (flowControl) {
	case SerialPort.FLOWCONTROL_NONE:
		return "None"; //$NON-NLS-1$
	case SerialPort.FLOWCONTROL_XONXOFF_OUT:
		return "Xon/Xoff Out"; //$NON-NLS-1$
	case SerialPort.FLOWCONTROL_XONXOFF_IN:
		return "Xon/Xoff In"; //$NON-NLS-1$
	case SerialPort.FLOWCONTROL_RTSCTS_IN:
		return "RTS/CTS In"; //$NON-NLS-1$
	case SerialPort.FLOWCONTROL_RTSCTS_OUT:
		return "RTS/CTS Out"; //$NON-NLS-1$
	default:
		return "None"; //$NON-NLS-1$
	}
}
 
开发者ID:elexis,项目名称:elexis-3-core,代码行数:24,代码来源:SerialParameters.java


注:本文中的gnu.io.SerialPort.FLOWCONTROL_RTSCTS_IN属性示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。