Exemplo n.º 1
0
        @Override
        public void update(Observable observable, Object data) {
          if (DEBUG) Log.d(TAG, "Received firmware IAP Updated message");

          UAVObject obj = objMngr.getObject("FirmwareIAPObj");
          UAVObjectField description = obj.getField("Description");
          if (description == null || description.getNumElements() < 100) {
            telemService.toastMessage("Failed to determine UAVO set");
          } else {
            final int HASH_SIZE_USED = 8;
            String jarName = new String();
            for (int i = 0; i < HASH_SIZE_USED; i++)
              jarName += Integer.toHexString((int) description.getDouble(i + 60));
            jarName += ".jar";
            if (DEBUG) Log.d(TAG, "Attempting to load: " + jarName);
            if (telemService.loadUavobjects(jarName, objMngr)) {
              telemService.toastMessage("Loaded appropriate UAVO set");
            } else telemService.toastMessage("Failed to determine UAVO set");
          }

          obj.removeUpdatedObserver(this);
        }