• 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 /* the SetConfig for optional general NFC stack functions */
46 const uint8_t nfa_dm_gen_cfg[] = {
47     3, /* total length */
48     /* Instruct NFCC to report RF field generated by remote device (or not) */
49     NFC_PMID_RF_FIELD_INFO, 1, 0x01};
50 
51 uint8_t* p_nfa_dm_gen_cfg = NULL;
52 
53 /* the RF Discovery Frequency for each technology */
54 const tNFA_DM_DISC_FREQ_CFG nfa_dm_rf_disc_freq_cfg = {
55     1, /* Frequency for NFC Technology A               */
56     1, /* Frequency for NFC Technology B               */
57     1, /* Frequency for NFC Technology F               */
58     1, /* Frequency for Proprietary Technology/15693   */
59     1, /* Frequency for Proprietary Technology/B-Prime */
60     1, /* Frequency for Proprietary Technology/Kovio   */
61     1, /* Frequency for NFC Technology A active mode   */
62     1, /* Frequency for NFC Technology F active mode   */
63     1  /* Frequency for NFC Technology active mode     */
64 };
65 
66 tNFA_DM_DISC_FREQ_CFG* p_nfa_dm_rf_disc_freq_cfg =
67     (tNFA_DM_DISC_FREQ_CFG*)&nfa_dm_rf_disc_freq_cfg;
68 
69 uint8_t nfa_ee_max_ee_cfg = NFA_EE_MAX_EE_SUPPORTED;
70 
71 const tNCI_DISCOVER_MAPS nfa_dm_interface_mapping[NFA_DM_NUM_INTERFACE_MAP] = {
72     /* Protocols that use Frame Interface do not need to be included in the
73        interface mapping */
74     {NCI_PROTOCOL_ISO_DEP, NCI_INTERFACE_MODE_POLL_N_LISTEN,
75      NCI_INTERFACE_ISO_DEP},
76     {NCI_PROTOCOL_NFC_DEP, NCI_INTERFACE_MODE_POLL_N_LISTEN,
77      NCI_INTERFACE_NFC_DEP}};
78 /* set to NULL to use the default mapping set by stack */
79 tNCI_DISCOVER_MAPS* p_nfa_dm_interface_mapping = NULL;
80 uint8_t nfa_dm_num_dm_interface_mapping = 0;
81 
82 const tNFA_DM_CFG nfa_dm_cfg = {
83     /* Automatic NDEF detection (when not in exclusive RF mode) */
84     NFA_DM_AUTO_DETECT_NDEF,
85     /* Automatic NDEF read (when not in exclusive RF mode) */
86     NFA_DM_AUTO_READ_NDEF,
87     /* Automatic presence check */
88     NFA_DM_AUTO_PRESENCE_CHECK,
89     /* Use sleep/wake(last interface) for ISODEP presence check */
90     NFA_DM_PRESENCE_CHECK_OPTION,
91     /* Maximum time to wait for presence check response */
92     NFA_DM_MAX_PRESENCE_CHECK_TIMEOUT};
93 
94 tNFA_DM_CFG* p_nfa_dm_cfg = (tNFA_DM_CFG*)&nfa_dm_cfg;
95 
96 const uint8_t nfa_hci_whitelist[] = {0x02, 0x03, 0x04};
97 
98 const tNFA_HCI_CFG nfa_hci_cfg = {
99     /* Max HCI Network IDLE time to wait for EE DISC REQ Ntf(s) */
100     NFA_HCI_NETWK_INIT_IDLE_TIMEOUT,
101     /* Maximum HCP Response time to any HCP Command */
102     NFA_HCI_RESPONSE_TIMEOUT,
103     /* Number of host in the whitelist of Terminal host */
104     0x03,
105     /* Pointer to the Whitelist of Terminal Host */
106     (uint8_t*)nfa_hci_whitelist};
107 
108 tNFA_HCI_CFG* p_nfa_hci_cfg = (tNFA_HCI_CFG*)&nfa_hci_cfg;
109 
110 bool nfa_poll_bail_out_mode = false;
111 const tNFA_PROPRIETARY_CFG nfa_proprietary_cfg = {
112     0x80, /* NCI_PROTOCOL_18092_ACTIVE */
113     0x81, /* NCI_PROTOCOL_B_PRIME */
114     0x82, /* NCI_PROTOCOL_DUAL */
115     0x83, /* NCI_PROTOCOL_15693 */
116     0x8A, /* NCI_PROTOCOL_KOVIO */
117     0xFF, /* NCI_PROTOCOL_MIFARE */
118     0x77, /* NCI_DISCOVERY_TYPE_POLL_KOVIO */
119     0x74, /* NCI_DISCOVERY_TYPE_POLL_B_PRIME */
120     0xF4, /* NCI_DISCOVERY_TYPE_LISTEN_B_PRIME */
121 };
122 
123 tNFA_PROPRIETARY_CFG* p_nfa_proprietary_cfg =
124     (tNFA_PROPRIETARY_CFG*)&nfa_proprietary_cfg;
125