Ejemplo n.º 1
0
  public JAntStatus ANTTxMessage(byte[] message) {
    if (debug) Log.d(TAG, "ANTTxMessage: entered");
    JAntStatus jAntStatus;

    try {
      int AntStatus = nativeJAnt_TxMessage(message);
      jAntStatus = JAntUtils.getEnumConst(JAntStatus.class, AntStatus);
      if (debug) Log.d(TAG, "After nativeJAnt_ANTTxMessage, status = " + jAntStatus.toString());
    } catch (Exception e) {
      Log.e(TAG, "ANTTxMessage: exception during nativeJAnt_ANTTxMessage (" + e.toString() + ")");
      jAntStatus = JAntStatus.FAILED;
    }

    if (debug) Log.d(TAG, "ANTTxMessage: exiting");
    return jAntStatus;
  }
Ejemplo n.º 2
0
  public JAntStatus enable() {
    if (debug) Log.d(TAG, "enable: entered");

    JAntStatus jAntStatus;

    try {
      int AntStatus = nativeJAnt_Enable();
      jAntStatus = JAntUtils.getEnumConst(JAntStatus.class, AntStatus);
      if (debug) Log.d(TAG, "After nativeJAnt_Enable, status = " + jAntStatus.toString());
    } catch (Exception e) {
      Log.e(TAG, "enable: exception during nativeJAnt_enable (" + e.toString() + ")");
      jAntStatus = JAntStatus.FAILED;
    }

    if (debug) Log.d(TAG, "enable: exiting");

    return jAntStatus;
  }
Ejemplo n.º 3
0
  public JAntStatus hardReset() {
    if (debug) Log.d(TAG, "hardReset: entered");

    JAntStatus jAntStatus;

    try {
      int status = nativeJAnt_HardReset();
      jAntStatus = JAntUtils.getEnumConst(JAntStatus.class, status);
      if (debug) Log.d(TAG, "After nativeJAnt_HardReset, status = " + jAntStatus.toString());
    } catch (Exception e) {
      Log.e(TAG, "hardReset: exception during nativeJAnt_HardReset, (" + e.toString() + ")");
      jAntStatus = JAntStatus.FAILED;
    }

    if (debug) Log.d(TAG, "hardReset:: exiting");

    return jAntStatus;
  }
Ejemplo n.º 4
0
  public JAntStatus destroy() {
    if (debug) Log.d(TAG, "destroy: entered");
    JAntStatus jAntStatus;

    try {
      int AntStatus = nativeJAnt_Destroy();
      jAntStatus = JAntUtils.getEnumConst(JAntStatus.class, AntStatus);
      if (JAntStatus.SUCCESS == jAntStatus) {
        if (debug) Log.d(TAG, "destroy: nativeJAnt_Destroy returned success");
        mCallback = null;
      } else {
        Log.e(TAG, "destroy: nativeJAnt_Destroy failed " + jAntStatus);
      }
    } catch (Exception e) {
      Log.e(TAG, "destroy: exception during nativeJAnt_Destroy (" + e.toString() + ")");
      jAntStatus = JAntStatus.FAILED;
    }

    if (debug) Log.d(TAG, "destroy: exiting");

    return jAntStatus;
  }
Ejemplo n.º 5
0
  /**
   * *****************************************************************************
   *
   * <p>Class Methods
   *
   * <p>*****************************************************************************
   */
  public JAntStatus create(ICallback callback) {
    JAntStatus jAntStatus;

    try {
      if (debug) Log.d(TAG, "Calling nativeJAnt_Create");
      int AntStatus = nativeJAnt_Create();
      jAntStatus = JAntUtils.getEnumConst(JAntStatus.class, AntStatus);

      // Record the caller's callback if create was successful
      if (JAntStatus.SUCCESS == jAntStatus) {
        if (debug) Log.d(TAG, "create: nativeJAnt_Create returned success");
        mCallback = callback;
      } else {
        Log.e(TAG, "create: nativeJAnt_Create failed " + jAntStatus);
      }
    } catch (Exception e) {
      Log.e(TAG, "create: exception during nativeJAnt_Create (" + e.toString() + ")");
      jAntStatus = JAntStatus.FAILED;
    }

    return jAntStatus;
  }