code: public void connectDevices(Device device1, Device device2)
              throws ShanksException {
          this.connectDevice(device1);
          try {
              this.connectDevice(device2);
          } catch (ShanksException e) {
              this.disconnectDevice(device1);
              throw e;
          }
      }
docs: Connect both devices to the link
  
  @param device1
  @param device2
  @throws TooManyConnectionException