本文整理汇总了Java中gnu.io.SerialPort.FLOWCONTROL_XONXOFF_IN属性的典型用法代码示例。如果您正苦于以下问题:Java SerialPort.FLOWCONTROL_XONXOFF_IN属性的具体用法?Java SerialPort.FLOWCONTROL_XONXOFF_IN怎么用?Java SerialPort.FLOWCONTROL_XONXOFF_IN使用的例子?那么, 这里精选的属性代码示例或许可以为您提供帮助。您也可以进一步了解该属性所在类gnu.io.SerialPort
的用法示例。
在下文中一共展示了SerialPort.FLOWCONTROL_XONXOFF_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;
}
示例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";
}
}
示例3: updatePortParameters
/**
* Initialize all port parameters DIALOG -> 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();
}
}
}
示例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$
}
}
示例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;
}
示例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;
}
示例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";
}
}
示例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;
}
示例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$
}
}