1/*
2 * Copyright (c) 2023 Huawei Device Co., Ltd.
3 * Licensed under the Apache License, Version 2.0 (the "License");
4 * you may not use this file except in compliance with the License.
5 * You may obtain a copy of the License at
6 *
7 *     http://www.apache.org/licenses/LICENSE-2.0
8 *
9 * Unless required by applicable law or agreed to in writing, software
10 * distributed under the License is distributed on an "AS IS" BASIS,
11 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12 * See the License for the specific language governing permissions and
13 * limitations under the License.
14 */
15
16/**
17 * @addtogroup HdiNfc
18 * @{
19 *
20 * @brief Provides unified APIs for nfc services to access nfc drivers.
21 *
22 * An nfc service can obtain an nfc driver object or agent and then call APIs provided by this object or agent to
23 * access nfc devices, thereby obtaining enabling or disabling an nfc controller, initializing an nfc core,
24 * writing NCI data to an nfc driver, starting configuration for RF discovery of nfc remote endpoints,
25 * sending nfc commands to an nfc driver for IO control.
26 *
27 * @version 1.1
28 */
29
30package ohos.hdi.nfc.v1_1;
31
32import ohos.hdi.nfc.v1_0.NfcTypes;
33import ohos.hdi.nfc.v1_0.INfcInterface;
34import ohos.hdi.nfc.v1_1.NfcTypes;
35
36/**
37 * @brief Declares the APIs provided by the nfc module for obtaining nfc controller operations, enabling or
38 * disabling an nfc controller, initializing an nfc core, writing NCI data to an nfc driver, starting
39 * configuration for RF discovery of nfc remote endpoints, sending nfc commands to an nfc driver for IO control.
40 *
41 * @since 4.1
42 * @version 1.1
43 */
44interface INfcInterface extends ohos.hdi.nfc.v1_0.INfcInterface {
45    /**
46     * @brief Gets the vendor configuration for nfc.
47     *
48     * @param config The vendor configuration for nfc.
49     * @return Returns <b>0</b> if the operation is succeed, otherwise marks the reason of failure.
50     * For details, see {@link NfcTypes}.
51     *
52     * @since 4.1
53     * @version 1.0
54     */
55    GetVendorConfig([out] struct NfcVendorConfig config, [out] enum NfcStatus status);
56
57    /**
58     * @brief Nfc factory reset.
59     *
60     * @return Returns <b>0</b> if the operation is succeed, otherwise marks the reason of failure.
61     * For details, see {@link NfcTypes}.
62     *
63     * @since 4.1
64     * @version 1.0
65     */
66     DoFactoryReset([out] enum NfcStatus status);
67
68    /**
69     * @brief Device shutdown. If the device supports power off NFC functionality, enable it.
70     *
71     * @return Returns <b>0</b> if the operation is succeed, otherwise marks the reason of failure.
72     * For details, see {@link NfcTypes}.
73     *
74     * @since 4.1
75     * @version 1.0
76     */
77     Shutdown([out] enum NfcStatus status);
78
79    /**
80     * @brief Sends I/O control commands and data from the nfc stack to HDI.
81     *
82     * @param cmd Indicates the commands that defined in NfcCommand in {@link NfcTypes}.
83     * @param data Indicates the data that sent to HDI.
84     * @return response Return the response of the cmd from HDI to nfc.
85     * @return NfcStatus Returns <b>0</b> if the operation is succeed, otherwise marks the reason of failure.
86     * For details, see {@link NfcTypes}.
87     *
88     * @since 4.1
89     * @version 1.0
90     */
91    IoctlWithResponse([in] enum NfcCommand cmd, [in] List<unsigned char> data, [out] List<unsigned char> response, [out] enum NfcStatus status);
92}
93