Package gnu.io

Examples of gnu.io.CommPort


      CommPortIdentifier portIdentifier = CommPortIdentifier.getPortIdentifier(deviceName);
      if (portIdentifier.isCurrentlyOwned()) {
        throw new CULDeviceException("The port " + deviceName + " is currenty used by "
            + portIdentifier.getCurrentOwner());
      }
      CommPort port = portIdentifier.open(this.getClass().getName(), 2000);
      if (!(port instanceof SerialPort)) {
        throw new CULDeviceException("The device " + deviceName + " is not a serial port");
      }
      serialPort = (SerialPort) port;
      serialPort.setSerialPortParams(baudRate, SerialPort.DATABITS_8, SerialPort.STOPBITS_1, parityMode);
View Full Code Here


  public void connect(final String serialPortName)
      throws SerialInterfaceException {
    logger.info("Connecting to serial port {}", serialPortName);
    try {
      CommPortIdentifier portIdentifier = CommPortIdentifier.getPortIdentifier(serialPortName);
      CommPort commPort = portIdentifier.open("org.openhab.binding.zwave",2000);
      this.serialPort = (SerialPort) commPort;
      this.serialPort.setSerialPortParams(115200,SerialPort.DATABITS_8,SerialPort.STOPBITS_1,SerialPort.PARITY_NONE);
      this.serialPort.enableReceiveThreshold(1);
      this.serialPort.enableReceiveTimeout(ZWAVE_RECEIVE_TIMEOUT);
      this.receiveThread = new ZWaveReceiveThread();
View Full Code Here

  public void open() {

    try {
     
      CommPortIdentifier portIdentifier = CommPortIdentifier.getPortIdentifier(serialPortName);
      CommPort commPort = portIdentifier.open(this.getClass().getName(), 2000);
     
      serialPort = (SerialPort) commPort;
      serialPort.setSerialPortParams(baudRate, SerialPort.DATABITS_8, SerialPort.STOPBITS_1, SerialPort.PARITY_NONE);
      serialPort.enableReceiveThreshold(1);
      serialPort.disableReceiveTimeout();
View Full Code Here

  public void connect() throws OpenEnergyMonitorException {

    try {
      CommPortIdentifier portIdentifier = CommPortIdentifier
          .getPortIdentifier(portName);
      CommPort commPort = portIdentifier.open(this.getClass().getName(),
          2000);
      serialPort = (SerialPort) commPort;
      serialPort.setSerialPortParams(BAUDRATE, SerialPort.DATABITS_8,
          SerialPort.STOPBITS_1, SerialPort.PARITY_NONE);
View Full Code Here

    try {
      logger.debug("Open connection to serial port '{}'", serialPortName);
      CommPortIdentifier portIdentifier = CommPortIdentifier.getPortIdentifier(serialPortName);

      CommPort commPort = portIdentifier.open(this.getClass().getName(),2000);

      serialPort = (SerialPort) commPort;
      serialPort.setSerialPortParams(9600, SerialPort.DATABITS_8,
          SerialPort.STOPBITS_1, SerialPort.PARITY_NONE);
      serialPort.enableReceiveThreshold(1);
View Full Code Here

  @Override
  public void connect(String device) throws NoSuchPortException, PortInUseException, UnsupportedCommOperationException, IOException {
    CommPortIdentifier portIdentifier = CommPortIdentifier
        .getPortIdentifier(device);

    CommPort commPort = portIdentifier
        .open(this.getClass().getName(), 2000);

    serialPort = (SerialPort) commPort;
    serialPort.setSerialPortParams(38400, SerialPort.DATABITS_8,
        SerialPort.STOPBITS_1, SerialPort.PARITY_NONE);
View Full Code Here

         * /dev/ttyUSB*, and will so not find symlinks. The
         *  setProperty() call below helps
         */
        System.setProperty("gnu.io.rxtx.SerialPorts", m_serialDeviceName);
        CommPortIdentifier ci =  CommPortIdentifier.getPortIdentifier(m_serialDeviceName);
        CommPort cp = ci.open("openhabalarmdecoder", 10000);
        if (cp == null) {
          throw new IllegalStateException("cannot open serial port!");
        }
        if (cp instanceof SerialPort) {
          m_port = (SerialPort)cp;
View Full Code Here

  public void connect() throws SwegonVentilationException {

    try {
      CommPortIdentifier portIdentifier = CommPortIdentifier
          .getPortIdentifier(portName);
      CommPort commPort = portIdentifier.open(this.getClass().getName(),
          2000);
      serialPort = (SerialPort) commPort;
      serialPort.setSerialPortParams(BAUDRATE, SerialPort.DATABITS_8,
          SerialPort.STOPBITS_1, SerialPort.PARITY_NONE);
View Full Code Here

       *  setProperty() call below helps
       */
      System.setProperty("gnu.io.rxtx.SerialPorts", m_devName);
      CommPortIdentifier ci =
          CommPortIdentifier.getPortIdentifier(m_devName);
      CommPort cp = ci.open(m_appName, 1000);
      if (cp instanceof SerialPort) {
        m_port = (SerialPort)cp;
      } else {
        throw new IllegalStateException("unknown port type");
      }
View Full Code Here

TOP

Related Classes of gnu.io.CommPort

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.