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

/** @file IQWESConfig.idl */

/** @cond */
interface IQWESConfig  {
/** @endcond */

  /**
   * @addtogroup IQWESConfig
   * @{
   */

    /* option values refer to a bit that should be set in opt */
    const uint64 OPT_SELECT_TEST_ROOT        = 0x00000001; /**< Use to set test keys */

    /* Property IDs */
    const uint32 CLOUD_TTIME                 = 1; /**< Id for decoding cloud message and extracting TTime */
    const uint32 SET_TIME_TO_LIVE            = 2; /**< Id for setting TTime, when test root is being used */

    /* Error code for IQWESConfig */
    error ERROR_OPTS_NOT_SUPPORTED;               /**< Options are not valid. */
    error ERROR_INVALID_PARAM;                    /**< Error due to passed incorrect input/output params. */
    error ERROR_TTIME_ALREADY_SET;                /**< Trusted time is already set. */
    error ERROR_INVALID_NONCE;                    /**< Nonce length or string does not match */
    error ERROR_REQUEST_EXPIRED;                  /**< Response time exceeded time to live */
    error ERROR_ECDSA_VERIFY_SIGNATURE;           /**< Signature verification failed */
    error ERROR_CBOR_INVALID_BUFFER_SIZE;         /**< Buffer size is too small for input or larger than INT32_MAX*/
    error ERROR_CBOR_DECODE_FAILED;               /**< Error while decoding cbor */
    error ERROR_CBOR_ENCODE_FAILED;               /**< Error while cbor encoding */
    error ERROR_PACKET_FORMAT;                    /**< Error in the property packet format */
    error ERROR_INVALID_PROPERTY_ID;              /**< Property ID is not valid */

    /**
    @brief Get nonce from qwes TA. It will return a cbor encoded buffer with nonce
    and SKID.

    @param[out] nonce - Returns buffer with nonce and SKID in cbor form.

    @return Object_OK on success
    */
    method getNonce(out buffer nonce);

    /**
    @brief sets a property of QWES by ID.

    @param[in] propertyID      ID defines which property to be set.
    @param[in] propertyValue   Buffer containing data for property from cloud.

    @return Object_OK on success
    */
    method setProperty(in uint32 propertyID, in buffer propertyValue);

    /**
    @brief sets options like key and time to live. Need call for option for options with optionData.

    @param[in] optionValue      Which option being set now.

    @return Object_OK on success
    */
    method setOptions(in uint64 optionValue);

  /* @} */ /* end_addtogroup IQWESConfig */
};
