public void configureConnection(ConnectionFactory connFactory, Properties connectionConfig) throws PositionException { if (connConfigd) { comm.disconnect(); comm = null; connConfigd = false; } try { comm = new SerialCommunicate(connFactory, connectionConfig); } catch (PositionException e) { throw (e); } connConfigd = true; }
public void disconnect() { if (connConfigd && comm != null) comm.disconnect(); }
public Properties getConnectConfig() { if (!connConfigd) { return null; } return comm.getConnectConfig(); }
public void connect() throws PositionException { if (!connConfigd) throw new PositionException("Invalid serial port configuration"); comm.connect(); }
public int getConnectStatus() { if (!connConfigd) return KuraConnectionStatus.NEVERCONNECTED; return comm.getConnectStatus(); }