title: Java: Serial Communication using jSSC
body: <p>I'm developing an application that involves a device, card dispenser specifically and there is provided documentation for its API. According to the documentation, for example, sending "C45" command will raise the card lift up.</p>
  
  <p>So based on jSSC API in communicating with serial, it will be like this,</p>
  
  <pre><code>SerialPort serialPort = new SerialPort("COM2");
  try {
      serialPort.openPort();//Open serial port
      serialPort.setParams(SerialPort.BAUDRATE_9600, 
                           SerialPort.DATABITS_8,
                           SerialPort.STOPBITS_1,
                           SerialPort.PARITY_NONE);
      serialPort.writeBytes("C45".getBytes());
      serialPort.closePort();//Close serial port
  }
  catch (SerialPortException ex) {
      System.out.println(ex);
  }
  </code></pre>
  
  <p>But executing this code does nothing to device, issuing "C45" has to be raising its card lift.</p>
  
  <p>One more this, the device includes a demo program but probably it runs with programming languages under Visual Studio and it does not include the source code, just the documentation.</p>
  
  <p>Thanks!</p>