本文整理匯總了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$
}
}