Java Code Examples for gnu.io.SerialPort#DATABITS_7
The following examples show how to use
gnu.io.SerialPort#DATABITS_7 .
You can vote up the ones you like or vote down the ones you don't like,
and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: SerialParameters.java From openhab1-addons with Eclipse Public License 2.0 | 6 votes |
/** * Sets the number of data bits. * * @param databits the new number of data bits. */ public void setDatabits(int databits) throws IllegalArgumentException { if (!SerialParameterValidator.isDataBitsValid(databits)) { throw new IllegalArgumentException("Databit '" + databits + "' invalid"); } switch (databits) { case 5: m_Databits = SerialPort.DATABITS_5; break; case 6: m_Databits = SerialPort.DATABITS_6; break; case 7: m_Databits = SerialPort.DATABITS_7; break; case 8: m_Databits = SerialPort.DATABITS_8; break; default: m_Databits = SerialPort.DATABITS_8; break; } }
Example 2
Source File: SerialPortParameters.java From nordpos with GNU General Public License v3.0 | 5 votes |
public static int getDataBits(String sBitsParam) { switch (sBitsParam) { case "5": return SerialPort.DATABITS_5; case "6": return SerialPort.DATABITS_6; case "7": return SerialPort.DATABITS_7; case "8": return SerialPort.DATABITS_8; default: return SerialPort.DATABITS_8; } }
Example 3
Source File: SerialParameters.java From openhab1-addons with Eclipse Public License 2.0 | 5 votes |
/** * Returns the number of data bits as <tt>String</tt>. * * @return the number of data bits as <tt>String</tt>. */ public String getDatabitsString() { switch (m_Databits) { case SerialPort.DATABITS_5: return "5"; case SerialPort.DATABITS_6: return "6"; case SerialPort.DATABITS_7: return "7"; case SerialPort.DATABITS_8: return "8"; default: return "8"; } }
Example 4
Source File: SerialParameters.java From elexis-3-core with Eclipse Public License 1.0 | 5 votes |
/** * Sets data bits. * * @param databits * New data bits setting. */ public void setDatabits(final String databits){ if (databits.equals("5")) { //$NON-NLS-1$ this.databits = SerialPort.DATABITS_5; } if (databits.equals("6")) { //$NON-NLS-1$ this.databits = SerialPort.DATABITS_6; } if (databits.equals("7")) { //$NON-NLS-1$ this.databits = SerialPort.DATABITS_7; } if (databits.equals(Messages.SerialParameters_4)) { this.databits = SerialPort.DATABITS_8; } }
Example 5
Source File: SerialParameters.java From elexis-3-core with Eclipse Public License 1.0 | 5 votes |
/** * Gets data bits as a <code>String</code>. * * @return Current data bits setting. */ public String getDatabitsString(){ switch (databits) { case SerialPort.DATABITS_5: return "5"; //$NON-NLS-1$ case SerialPort.DATABITS_6: return "6"; //$NON-NLS-1$ case SerialPort.DATABITS_7: return "7"; //$NON-NLS-1$ case SerialPort.DATABITS_8: return "8"; //$NON-NLS-1$ default: return "8"; //$NON-NLS-1$ } }