⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 portcontroloptions.java

📁 利用JAVA采用网络通讯的例子,支持weblogic及websphere
💻 JAVA
字号:
package collector.communication;

/**
 * <p>Title: MoxaAspp.PortControlOptions</p>
 * <p>Description: Constants of Moxa CN2500 Aspp library.
 *                 Most of these public static final  variables are used as
 *                 parameters in call for member function in class
 *                 PortControl to set port configuration. </p>
 * <p>Copyright: Nari Pbs2000j (c) 2004</p>
 * <p>Company: Nari</p>
 * @author Weili
 * @version 1.0
 */

public class PortControlOptions {
  public PortControlOptions() {
  }

  /** 950: TCP port no for 1st data port    */
  public static final short D_START_DATAPORT = 950;
  /** 966: TCP port no for 1st cmd port     */
  public static final short D_START_CMDPORT = 966;

  /** IOCTL command	       */
  public static final byte D_COMMAND_IOCTL = 16;
  /** Flow control command        */
  public static final byte D_COMMAND_FLOWCTRL = 17;
  /** Line status control command */
  public static final byte D_COMMAND_LINECTRL = 18;
  /** Line status read command    */
  public static final byte D_COMMAND_LSTATUS = 19;
  /** Buffer flush command        */
  public static final byte D_COMMAND_FLUSH = 20;
  /** Input queue command	       */
  public static final byte D_COMMAND_IQUEUE = 21;
  /** Output queue command        */
  public static final byte D_COMMAND_OQUEUE = 22;
  /** Port reset command	       */
  public static final byte D_COMMAND_PORT_RESET = 32;

  /** IOCTL : baud rate = 300 bps	 */
  public static final byte D_IOCTL_B300 = 0;
  /** IOCTL : baud rate = 600 bps	 */
  public static final byte D_IOCTL_B600 = 1;
  /** IOCTL : baud rate = 1200 bps  */
  public static final byte D_IOCTL_B1200 = 2;
  /** IOCTL : baud rate = 2400 bps  */
  public static final byte D_IOCTL_B2400 = 3;
  /** IOCTL : baud rate = 4800 bps  */
  public static final byte D_IOCTL_B4800 = 4;
  /** IOCTL : baud rate = 7200 bps  */
  public static final byte D_IOCTL_B7200 = 5;
  /** IOCTL : baud rate = 9600 bps  */
  public static final byte D_IOCTL_B9600 = 6;
  /** IOCTL : baud rate = 19200 bps */
  public static final byte D_IOCTL_B19200 = 7;
  /** IOCTL : baud rate = 38400 bps */
  public static final byte D_IOCTL_B38400 = 8;
  /** IOCTL : baud rate = 57600 bps */
  public static final byte D_IOCTL_B57600 = 9;
  /** IOCTL : baud rate = 115200 bps */
  public static final byte D_IOCTL_B115200 = 10;
  /** IOCTL : baud rate = 230400 bps */
  public static final byte D_IOCTL_B230400 = 11;
  /** IOCTL : baud rate = 460800 bps */
  public static final byte D_IOCTL_B460800 = 12;

  /** IOCTL : 8 data bits */
  public static final byte D_IOCTL_BIT8 = 3;
  /** IOCTL : 7 data bits */
  public static final byte D_IOCTL_BIT7 = 2;
  /** IOCTL : 6 data bits */
  public static final byte D_IOCTL_BIT6 = 1;
  /** IOCTL : 5 data bits */
  public static final byte D_IOCTL_BIT5 = 0;

  /** IOCTL : 1 stop bit  */
  public static final byte D_IOCTL_STOP1 = 0;
  /** IOCTL : 2 stop bits */
  public static final byte D_IOCTL_STOP2 = 4;

  /** IOCTL : even parity */
  public static final byte D_IOCTL_EVEN = 8;
  /** IOCTL : odd parity  */
  public static final byte D_IOCTL_ODD = 16;
  /** IOCTL : none parity */
  public static final byte D_IOCTL_NONE = 0;

  /** yes, do CTS H/W flow control      */
  public static final byte D_FCTRL_CTS_YES = 1;
  /** no, don't do CTS H/W flow control */
  public static final byte D_FCTRL_CTS_NO = 0;
  /** yes, do RTS H/W flow control      */
  public static final byte D_FCTRL_RTS_YES = 1;
  /** no, don't do RTS H/W flow control */
  public static final byte D_FCTRL_RTS_NO = 0;
  /** yes, Tx XON/XOFF S/W flow control */
  public static final byte D_FCTRL_TXXON_YES = 1;
  /** no Tx XON/XOFF S/W flow control   */
  public static final byte D_FCTRL_TXXON_NO = 0;
  /** yes, Rx XON/XOFF S/W flow control */
  public static final byte D_FCTRL_RXXON_YES = 1;
  /** no Rx XON/XOFF S/W flow control   */
  public static final byte D_FCTRL_RXXON_NO = 0;

  /** set DTR on		*/
  public static final byte D_LCTRL_DTR_ON = 1;
  /** set DTR off		*/
  public static final byte D_LCTRL_DTR_OFF = 0;
  /** set RTS on		*/
  public static final byte D_LCTRL_RTS_ON = 1;
  /** set RTS off		*/
  public static final byte D_LCTRL_RTS_OFF = 0;

  /* parameters for D_COMMAND_FLUSH flush buffer command		*/
  /** flush Rx buffer	*/
  public static final byte D_FLUSH_RXBUFFER = 0;
  /** flush Tx buffer	*/
  public static final byte D_FLUSH_TXBUFFER = 1;
  /** flush Rx & Tx buffer */
  public static final byte D_FLUSH_ALLBUFFER = 2;

  /* parameters for D_COMMAND_LSTATUS line status command */
  /** line status : DSR on 	*/
  public static final byte D_LSTATUS_DSR_ON = 1;
  /** line status : DSR off	*/
  public static final byte D_LSTATUS_DSR_OFF = 0;
  /** line status : CTS on 	*/
  public static final byte D_LSTATUS_CTS_ON = 1;
  /** line status : CTS off	*/
  public static final byte D_LSTATUS_CTS_OFF = 0;
  /** line status : DCD on 	*/
  public static final byte D_LSTATUS_DCD_ON = 1;
  /** line status : DCD off	*/
  public static final byte D_LSTATUS_DCD_OFF = 0;

  /** Maximum port number of CN2500 Moxa Async Server. */
  public static final short CN2000_MAXPORT = 16;
  /** Sign for failed return of member function. */
  public static final short FAIL = -1;
  /** Sign for successful return of member function. */
  public static final short OK = 0;

  /** Milliseconds for thread to sleep. */
  public static final int INTERVAL = 300;
  /** Retry times for attempts. Total timeout = RETRY * INTERVAL msec */
  public static final int RETRY = 3;
}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -