//Copyright (c) Qualcomm Technologies, Inc. and/or its subsidiaries.
//All rights reserved.
//Confidential and Proprietary - Qualcomm Technologies, Inc. 

/**
 * INistLoggingFramework provides an interface to collect logs from NistLogging partition.
 *
 */
//---------------------------------------------------------------------------------
// Interface to expose NistLoggingFramework API's
//---------------------------------------------------------------------------------
/** @cond */
interface INistLoggingFramework {
/** @endcond */

  /**
   * @addtogroup INistLoggingFramework
   * @{
   */

  /** @cond */
  /**
   * Error codes
   */
  error ERR_INCOMP_READ;            /**< Read unsuccessful */
  error ERR_INVAL_PARAMETER;        /**< Parameter provided is invalid */
  /** @endcond */
  /**
    @brief This method gets the size of NIST partition corresponding to the provided
    argument. It will return either the entire size or the size occupied by the
    valid logs. Number of valid records logged in partition will be updated in validRecCount.
    validRecCount and size will be updated in success case only.
    
    @param[in]   sizeType         Size to read out
                                  @li  1 = Size of entire NIST partition
                                  @li  2 = Size of partition having valid records
    @param[out]  validRecCount    Number of valid records in the partition
    @param[out]  size             Size of nist log
    
    @return  Object_OK if successful.

    @note  This API can be called first to determine how much space is require to read
           out the current set of records
  */
  method getSize(in uint32 sizeType, out uint32 validRecCount, out uint32 size);

  /**
    @brief This method reads records from NIST partition into the buffer provided
    by the client. The records are read out in sequential order, starting with the
    oldest record.
    recordOffset can be used to start the read at a location other than the oldest
    record, and maxReadCount can be used to limit how many records are read.
    If record count provided by client is 0 this function will read up to the size of
    buffer provided by the client. If it's greater than zero API will read up to the
    specificed number of records, or until the buffer is full.
    
    @param[out]  buf                Buffer to hold the data read
    @param[in]   recordOffset       Number of records to skip before reading out data. 0 will start from the oldest record.
    @param[in]   maxReadCount       Indicates the maximum number of records to be read into the buffer. A value of 0 will read
                                    out as many records as will fit into the buffer
    @param[out]  recordRead         No of valid records read out to the provided buffer

    @return  Object_OK if successful.
  */
  method readRecords(out buffer buf, in uint32 recordOffset, in uint32 maxReadCount, out uint32 recordRead);

  /**
    @brief This method will erase out the entire NIST partition.
    
    @return  Object_OK if successful.
  */
  method erasePartition();

  /* @} */ /* end_addtogroup INistLoggingFramework */
};

