/*
 * Copyright (c) 2023 Huawei Device Co., Ltd.
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *     http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

/**
 * @addtogroup HdiNfc
 * @{
 *
 * @brief Provides unified APIs for nfc services to access nfc drivers.
 *
 * An nfc service can obtain an nfc driver object or agent and then call APIs provided by this object or agent to
 * access nfc devices, thereby obtaining enabling or disabling an nfc controller, initializing an nfc core,
 * writing NCI data to an nfc driver, starting configuration for RF discovery of nfc remote endpoints,
 * sending nfc commands to an nfc driver for IO control.
 *
 * @version 1.1
 */

package ohos.hdi.nfc.v1_1;

import ohos.hdi.nfc.v1_0.NfcTypes;
import ohos.hdi.nfc.v1_0.INfcInterface;
import ohos.hdi.nfc.v1_1.NfcTypes;

/**
 * @brief Declares the APIs provided by the nfc module for obtaining nfc controller operations, enabling or 
 * disabling an nfc controller, initializing an nfc core, writing NCI data to an nfc driver, starting 
 * configuration for RF discovery of nfc remote endpoints, sending nfc commands to an nfc driver for IO control.
 *
 * @since 4.1
 * @version 1.1
 */
interface INfcInterface extends ohos.hdi.nfc.v1_0.INfcInterface {
    /**
     * @brief Gets the vendor configuration for nfc.
     * 
     * @param config The vendor configuration for nfc.
     * @return Returns <b>0</b> if the operation is succeed, otherwise marks the reason of failure.
     * For details, see {@link NfcTypes}.
     *
     * @since 4.1
     * @version 1.0
     */
    GetVendorConfig([out] struct NfcVendorConfig config, [out] enum NfcStatus status);

    /**
     * @brief Nfc factory reset.
     * 
     * @return Returns <b>0</b> if the operation is succeed, otherwise marks the reason of failure.
     * For details, see {@link NfcTypes}.
     *
     * @since 4.1
     * @version 1.0
     */
     DoFactoryReset([out] enum NfcStatus status);

    /**
     * @brief Device shutdown. If the device supports power off NFC functionality, enable it.
     * 
     * @return Returns <b>0</b> if the operation is succeed, otherwise marks the reason of failure.
     * For details, see {@link NfcTypes}.
     *
     * @since 4.1
     * @version 1.0
     */
     Shutdown([out] enum NfcStatus status);

    /**
     * @brief Sends I/O control commands and data from the nfc stack to HDI.
     *
     * @param cmd Indicates the commands that defined in NfcCommand in {@link NfcTypes}.
     * @param data Indicates the data that sent to HDI.
     * @return response Return the response of the cmd from HDI to nfc.
     * @return NfcStatus Returns <b>0</b> if the operation is succeed, otherwise marks the reason of failure.
     * For details, see {@link NfcTypes}.
     *
     * @since 4.1
     * @version 1.0
     */
    IoctlWithResponse([in] enum NfcCommand cmd, [in] List<unsigned char> data, [out] List<unsigned char> response, [out] enum NfcStatus status);
}