Example #1
0
 @Override
 public void write(byte[] bs) throws SerialPortException {
   try {
     if (fifo_out.getSize() > 0) {
       flush();
     }
     writeNative(bs);
   } catch (Exception e) {
     storeData(bs);
     logger.warn(
         "Failed to write "
             + new String(bs)
             + " "
             + bs.length
             + " octects on "
             + this.getPort_name());
     pending(500);
     flush();
   }
 }
Example #2
0
 @Override
 public void flush() throws SerialPortException {
   if (fifo_out.getSize() > 0) {
     writeNative(fifo_out.removeAll());
   }
 }