Package com.neophob.sematrix.core.output

Examples of com.neophob.sematrix.core.output.SerialPortException


   * @param cmdfull
   */
  private synchronized void writeSerialData(byte[] cmdfull) throws SerialPortException {
    //TODO handle the 128 byte buffer limit!
    if (port==null) {
      throw new SerialPortException("port is not ready!");
    }
       
    try {
      port.output.write(cmdfull);
      //DO NOT flush the buffer
    } catch (Exception e) {
      log.log(Level.WARNING, "Error sending serial data!", e);
      throw new SerialPortException("cannot send serial data: "+e);
    }   
  }
View Full Code Here


   * @throws SerialPortException the serial port exception
   */
  private synchronized void writeSerialData(byte[] cmdfull) throws SerialPortException {
    //TODO handle the 128 byte buffer limit!
    if (port==null) {
      throw new SerialPortException("port is not ready!");
    }
   
    //log.log(Level.INFO, "Serial Wire Size: {0}", cmdfull.length);

    try {
      port.output.write(cmdfull);
      //port.output.flush();
      //DO NOT flush the buffer... hmm not sure about this, processing flush also
      //and i discovered strange "hangs"...
    } catch (Exception e) {
      LOG.log(Level.INFO, "Error sending serial data!", e);
      connectionErrorCounter++;
      throw new SerialPortException("cannot send serial data, errorNr: "+connectionErrorCounter+", Error: "+e);
    }   
  }
View Full Code Here

   * @param cmdfull the cmdfull
   * @throws SerialPortException the serial port exception
   */
  private synchronized void writeSerialData(byte[] cmdfull) throws SerialPortException {
    if (port==null) {
      throw new SerialPortException("port is not ready!");
    }
   
    try {
      port.output.write(cmdfull);
      //port.output.flush();
      //DO NOT flush the buffer... hmm not sure about this, processing flush also
      //and i discovered strange "hangs"...
    } catch (Exception e) {
      LOG.log(Level.INFO, "Error sending serial data!", e);
      connectionErrorCounter++;
      throw new SerialPortException("cannot send serial data, errorNr: "+connectionErrorCounter+", Error: "+e);
    }   
  }
View Full Code Here

TOP

Related Classes of com.neophob.sematrix.core.output.SerialPortException

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.