/**
   * this function determines if the specific shimmer device is connected to the shimmer service. It
   * has it's own function because the fucntionality gets used so many times
   *
   * @return
   */
  private boolean isDeviceConnected() {

    if (serviceshim != null) {
      // if the user returns from the Bluetooth finder then we will have the btAddress
      // of the device already and we can set the radio button without having to create
      // a list of the connected shimmer devices through the hashMapShimmer
      if (btAddress != "" && serviceshim.isDeviceConnected(btAddress)) return true;
      else {
        HashMap<String, Object> temp = serviceshim.hashMapShimmer;
        Collection<Object> shimmers = temp.values();
        Iterator<Object> iterator = shimmers.iterator();
        while (iterator.hasNext()) {
          Shimmer sTemp = (Shimmer) iterator.next();
          int sensor = sTemp.getEnabledSensors();

          if ((sensor == Shimmer.SENSOR_ECG && deviceid == ECG_DEVICE)
              || (sensor == Shimmer.SENSOR_EMG && deviceid == EMG_DEVICE)
              || (sensor == Shimmer.SENSOR_GSR && deviceid == GSR_DEVICE)) {
            btAddress = sTemp.getBluetoothAddress();
            return true;
          }
          // TODO: add section for EEG device
        } // end while loop
      } // end else statement
    } // end if serviceshim not null
    return false;
  } // end function isDevicConnected()