• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 /******************************************************************************
2  *
3  *  Copyright (C) 2011-2014 Broadcom Corporation
4  *
5  *  Licensed under the Apache License, Version 2.0 (the "License");
6  *  you may not use this file except in compliance with the License.
7  *  You may obtain a copy of the License at:
8  *
9  *  http://www.apache.org/licenses/LICENSE-2.0
10  *
11  *  Unless required by applicable law or agreed to in writing, software
12  *  distributed under the License is distributed on an "AS IS" BASIS,
13  *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14  *  See the License for the specific language governing permissions and
15  *  limitations under the License.
16  *
17  ******************************************************************************/
18 
19 /******************************************************************************
20  *
21  *  This file contains compile-time configurable constants for NFA modules
22  *
23  ******************************************************************************/
24 #include "nfa_api.h"
25 
26 /* the SetConfig for CE T3T/T4T */
27 const uint8_t nfa_dm_ce_cfg[] = {
28     13,                  /* total length */
29     NFC_PMID_LF_T3T_PMM, /* Type-3 tag default PMM */
30     NCI_PARAM_LEN_LF_T3T_PMM,
31     0x01, /* This PAD0 is used to identify HCE-F on Android */
32     0xFE, /* This PAD0 is used to identify HCE-F on Android */
33     0xFF,
34     0xFF,
35     0xFF,
36     0xFF,
37     0xFF,
38     0xFF,
39     NFC_PMID_FWI, /* FWI for ISO-DEP */
40     1,
41     CE_T4T_ISO_DEP_FWI};
42 
43 uint8_t* p_nfa_dm_ce_cfg = (uint8_t*)nfa_dm_ce_cfg;
44 
45 uint8_t* p_nfa_dm_gen_cfg = nullptr;
46 
47 /* the RF Discovery Frequency for each technology */
48 const tNFA_DM_DISC_FREQ_CFG nfa_dm_rf_disc_freq_cfg = {
49     1, /* Frequency for NFC Technology A               */
50     1, /* Frequency for NFC Technology B               */
51     1, /* Frequency for NFC Technology F               */
52     1, /* Frequency for Proprietary Technology/15693   */
53     1, /* Frequency for Proprietary Technology/B-Prime */
54     1, /* Frequency for Proprietary Technology/Kovio   */
55     1, /* Frequency for NFC Technology A active mode   */
56     1, /* Frequency for NFC Technology F active mode   */
57     1  /* Frequency for NFC Technology active mode     */
58 };
59 
60 tNFA_DM_DISC_FREQ_CFG* p_nfa_dm_rf_disc_freq_cfg =
61     (tNFA_DM_DISC_FREQ_CFG*)&nfa_dm_rf_disc_freq_cfg;
62 
63 uint8_t nfa_ee_max_ee_cfg = NFA_EE_MAX_EE_SUPPORTED;
64 
65 /* set to NULL to use the default mapping set by stack */
66 tNCI_DISCOVER_MAPS* p_nfa_dm_interface_mapping = nullptr;
67 uint8_t nfa_dm_num_dm_interface_mapping = 0;
68 
69 tNFA_DM_CFG nfa_dm_cfg = {
70     /* Automatic NDEF detection (when not in exclusive RF mode) */
71     NFA_DM_AUTO_DETECT_NDEF,
72     /* Automatic NDEF read (when not in exclusive RF mode) */
73     NFA_DM_AUTO_READ_NDEF,
74     /* Automatic presence check */
75     NFA_DM_AUTO_PRESENCE_CHECK,
76     /* Use sleep/wake(last interface) for ISODEP presence check */
77     NFA_DM_PRESENCE_CHECK_OPTION,
78     /* Maximum time to wait for presence check response */
79     NFA_DM_MAX_PRESENCE_CHECK_TIMEOUT};
80 
81 tNFA_DM_CFG* p_nfa_dm_cfg = (tNFA_DM_CFG*)&nfa_dm_cfg;
82 
83 const uint8_t nfa_hci_whitelist[] = {0x02, 0x03, 0x04};
84 
85 tNFA_HCI_CFG nfa_hci_cfg = {
86     /* Max HCI Network IDLE time to wait for EE DISC REQ Ntf(s) */
87     NFA_HCI_NETWK_INIT_IDLE_TIMEOUT,
88     /* Maximum HCP Response time to any HCP Command */
89     NFA_HCI_RESPONSE_TIMEOUT,
90     /* Number of host in the whitelist of Terminal host */
91     0x03,
92     /* Pointer to the Whitelist of Terminal Host */
93     (uint8_t*)nfa_hci_whitelist};
94 
95 tNFA_HCI_CFG* p_nfa_hci_cfg = (tNFA_HCI_CFG*)&nfa_hci_cfg;
96 
97 bool nfa_poll_bail_out_mode = false;
98 tNFA_PROPRIETARY_CFG nfa_proprietary_cfg = {
99     0x80, /* NCI_PROTOCOL_18092_ACTIVE */
100     0x81, /* NCI_PROTOCOL_B_PRIME */
101     0x82, /* NCI_PROTOCOL_DUAL */
102     0x83, /* NCI_PROTOCOL_15693 */
103     0x8A, /* NCI_PROTOCOL_KOVIO */
104     0xFF, /* NCI_PROTOCOL_MIFARE */
105     0x77, /* NCI_DISCOVERY_TYPE_POLL_KOVIO */
106     0x74, /* NCI_DISCOVERY_TYPE_POLL_B_PRIME */
107     0xF4, /* NCI_DISCOVERY_TYPE_LISTEN_B_PRIME */
108 };
109 
110 tNFA_PROPRIETARY_CFG* p_nfa_proprietary_cfg =
111     (tNFA_PROPRIETARY_CFG*)&nfa_proprietary_cfg;
112