Ejemplo 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);
        }
Ejemplo n.º 2
0
 @Override
 public void update(Observable arg0, Object arg1) {
   if (DEBUG)
     Log.d(
         TAG,
         "Mon updated. Connected: "
             + mon.getConnected()
             + " objects updated: "
             + mon.getObjectsUpdated());
   if (mon.getConnected()) {
     Intent intent = new Intent();
     intent.setAction(OPTelemetryService.INTENT_ACTION_CONNECTED);
     telemService.sendBroadcast(intent, null);
   }
 }
Ejemplo n.º 3
0
  @Override
  public void run() {
    try {

      Looper.prepare();
      handler = new Handler();

      if (DEBUG) Log.d(TAG, "Attempting connection");
      if (attemptConnection() == false) return; // Attempt failed

      Looper.loop();

      if (DEBUG) Log.d(TAG, "TelemetryTask runnable finished");

    } catch (Throwable t) {
      Log.e(TAG, "halted due to an error", t);
    }

    telemService.toastMessage("Telemetry Thread finished");
  }