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

/**
 *   Provides APIs to perform access control on certain Peripherals.\n
 *   Currently TZ is capable for protecting OEM configured list of peripherals.\n
 *   The level and type of control varies for each peripheral.\n
 *   OEMs can configure this via pc_oem_config.xml
 */

/** @cond */
interface IPeripheralAccessControl {
/** @endcond */

  /**
   * @addtogroup IPeripheralAccessControl
   * @{
   */

  /* Error codes for each peripheral */
  error ERROR_NOTIFY;
  error ERROR_ACCESS_CONTROL;
  error ERROR_NO_LICENSE;
  error ERROR_EMERGENCYCALL;
  error ERROR_WRONG_CONTROLLER;

  /**
   * This method to be called by clients to protect peripheral based
   * on the Object acquired on service open.
   *
   *
   * @return
   * Object_OK on success.\n
   * Object_ERROR on failure.\n
   * IPeripheralAccessControl_ERROR_NOTIFY if notifying registered peripheral clients fails.\n
   * IPeripheralAccessControl_ERROR_ACCESS_CONTROL if Access Controlling peripheral fails.\n
   * IPeripheralAccessControl_ERROR_NO_LICENSE if No License for peripheral.\n
   * IPeripheralAccessControl_ERROR_EMERGENCYCALL if Modem is in Emergency call state.\n
   */

  method protectPeripheral();

  /**
   * This method to be called by clients to unprotect peripheral based
   * on the Object acquired on service open.
   *
   *
   * @return
   * Object_OK on success.\n
   * Object_ERROR on failure.\n
   * IPeripheralAccessControl_ERROR_NOTIFY if notifying registered peripheral clients fails.\n
   * IPeripheralAccessControl_ERROR_ACCESS_CONTROL if Access Controlling peripheral fails.\n
   * IPeripheralAccessControl_ERROR_NO_LICENSE if No License for peripheral.\n
   * IPeripheralAccessControl_ERROR_EMERGENCYCALL if Modem is in Emergency call state.\n
   * IPeripheralAccessControl_ERROR_WRONG_CONTROLLER if Wrong TA is used to unprotect.\n
   */

  method unprotectPeripheral();

  /**
   * This method to be called by clients to get state of peripheral.
   *
   * @param[in]  uint8 various state values are defined in \link IPeripheralState \endlink
   *
   * @return
   * Object_OK on success.
   */

  method getPeripheralState(out uint8 state);

/** @} */
};

