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
30/**
31 * @file NfcTypes.idl
32 *
33 * @brief Declares the APIs provided by the sensor module for obtaining sensor information, subscribing to or
34 * unsubscribing from sensor data, enabling or disabling a sensor, setting the sensor data reporting mode,
35 * and setting sensor options such as the accuracy and measurement range.
36 *
37 * @since 4.1
38 * @version 1.1
39 */
40
41package ohos.hdi.nfc.v1_1;
42
43/**
44 * @brief Vendor Specific Proprietary Protocal and Discovery Configuration.
45 *
46 * @since 4.1
47 */
48enum VendorProtocalDiscoveryCfg {
49    NCI_PROTOCOL_18092_ACTIVE         = 0,
50    NCI_PROTOCOL_B_PRIME              = 1,
51    NCI_PROTOCOL_DUAL                 = 2,
52    NCI_PROTOCOL_15693                = 3,
53    NCI_PROTOCOL_KOVIO                = 4,
54    NCI_PROTOCOL_MIFARE               = 5,
55    NCI_DISCOVERY_TYPE_POLL_KOVIO     = 6,
56    NCI_DISCOVERY_TYPE_POLL_B_PRIME   = 7,
57    NCI_DISCOVERY_TYPE_LISTEN_B_PRIME = 8,
58    VENDOR_PROPEIETARY_CFG_MAX        = 9,
59};
60
61/**
62 * @brief Vendor Specific NFC Configuration.
63 *
64 * @since 4.1
65 */
66struct NfcVendorConfig {
67    /** Extended APDU length for ISO_DEP */
68    unsigned int isoDepExtApduLength;
69
70    /** Default Secure Element route id */
71    unsigned char defaultOffHostRoute;
72
73    /** Default Secure Element route id for felica */
74    unsigned char defaultOffHostRouteFelica;
75
76    /** Set the default Felica T3T System Code OffHost route Location */
77    unsigned char defaultSysCodeRoute;
78
79    /** Set the Felica T3T System Code Power state */
80    unsigned char defaultSysCodePwrState;
81
82    /** Default route for unconfigured protocols and technology. */
83    unsigned char defaultUnconfiguredRoute;
84
85    /** Configure the NFC Extras to open and use a static pipe. EE is ESE */
86    unsigned char esePipeId;
87
88    /** onfigure the NFC Extras to open and use a static pipe. EE is SIM */
89    unsigned char simPipeId;
90
91    /** If set to true, NFCC is using bail out mode for either Type A or Type B poll. */
92    boolean pollBailOutMode;
93
94    /** Choose the presence-check algorithm for type-4 tag. If not defined, the default is I_BLOCK. */
95    unsigned char checkAlgorithm;
96
97    /** Vendor Specific Proprietary Protocol & Discovery Configuration. */
98    unsigned char []vendorProtocalDiscoveryCfg;
99
100    /** Vendor Specific Proprietary Protocol & Discovery Configuration Data Size. */
101    unsigned char vendorProtocalDiscoveryCfgSize;
102
103    /** White list of Hosts */
104    List<unsigned char> hostWhitelist;
105
106    /** OffHost UICC route location for Multi SE */
107    List<unsigned char> offHostRouteUicc;
108
109    /** OffHost eSE route location for Multi SE */
110    List<unsigned char> offHostRouteEse;
111
112    /** Set the ISODEP route location */
113    unsigned char defaultIsoDepRoute;
114};