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