Пример #1
0
  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;
  }
Пример #2
0
 public void disconnect() {
   if (connConfigd && comm != null) comm.disconnect();
 }
Пример #3
0
 public Properties getConnectConfig() {
   if (!connConfigd) {
     return null;
   }
   return comm.getConnectConfig();
 }
Пример #4
0
 public void connect() throws PositionException {
   if (!connConfigd) throw new PositionException("Invalid serial port configuration");
   comm.connect();
 }
Пример #5
0
 public int getConnectStatus() {
   if (!connConfigd) return KuraConnectionStatus.NEVERCONNECTED;
   return comm.getConnectStatus();
 }