/*
 * Copyright (c) Qualcomm Technologies, Inc.
 * All Rights Reserved.
 * Confidential and Proprietary - Qualcomm Technologies, Inc.
 */

/**
 * This interface is used by QWES TA to get modem data to TZ.
 */

/** @cond */
interface ITrustedDataProviderResp {
  /** @endcond */

  /**
   * @addtogroup ITrustedDataProviderResp
   * @{
   */

  /**
   * This method will allow modem service to return modem data to QWES TA.
   *
   * @param[in]  params - Parameter value
   * @param[in]  respBuffer - report of the modem data in CBOR
   *
   * @return
   * Object_OK on success.
   */

  method finishUpdate(in buffer params, in buffer respBuffer);

  /** @} */
};

/** @cond */
interface ITrustedDataProviderCB {
/** @endcond */

  /**
   * @addtogroup ITrustedDataProviderCB
   * @{
   */

  /**
   * QWES TA uses this method to notify modem service to update.
   *
   * @param[in] flags - Type of modem data to be updated
   * @param[in] license - License buffer
   * @param[in] apphash - App hash
   *
   * @return
   * Object_OK on success.
   */

  method beginUpdate(in uint32 flags, in buffer license, in buffer apphash);

  /** @} */
};


/** @cond */
interface ITrustedDataProvider {
  /** @endcond */

  /**
   * @addtogroup ITrustedDataProvider
   * @{
   */

  /* Trusted Data Provider Error Codes */
  error NO_MEMORY;                      /**< Failure during memory allocation */
  error INVALID_SUBMOD;                 /**< Invalid submodID */
  error INVALID_CALLBACK;               /**< Callback object is null */
  error RESERVED_3;
  error RESERVED_4;
  error INVALID_ARGUMENT;               /**< Invalid arguments. */

  /* Supported submod ID */
  const uint64 SSGSCA_SUBMOD      = 1;
  const uint64 SSGCCS_SUBMOD      = 2;
  const uint64 LAST_SUBMOD        = 3;

  /**
   * This method will register a callback object for modem service which will be
   * used by QWES TA to request modem data update.
   *
   * @param[in]  submodID -  Identify modem service
   * @param[in]  trustedDataProviderCB -  \link ITrustedDataProviderCB \endlink object
   * @param[out] resp - \link ITrustedDataProviderResp \endlink object
   *
   * @return
   * Object_OK on success.
   */

  method registerCallBack(in uint32 submodID, in ITrustedDataProviderCB trustedDataProviderCB, out ITrustedDataProviderResp resp);

  /** @} */
};
