public static void testSerialPort() { SerialCom testSerial = new SerialCom(_txRawBuffer, _rxRawBuffer); try { testSerial.connect(CommConstants.PORT_NAME); Thread thr = new Thread(new Consumer(_rxRawBuffer)); thr.start(); } catch (CommunicationException e) { // TODO Auto-generated catch block e.printStackTrace(); } catch (IOException e) { // TODO Auto-generated catch block e.printStackTrace(); } }
public static void printSerialPortsList() { ArrayList<String> list; if ((list = SerialCom.getSerialPortsList()) != null) { System.out.println("Available Ports:"); for (String port : list) { System.out.println(port); } } }