nfa_dm_cfg.c revision 552f2b745deddd35d9b75da9c9c09bd2f3f573a8
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 *
22 *  This file contains compile-time configurable constants for NFA modules
23 *
24 ******************************************************************************/
25#include "nfa_api.h"
26
27/* the SetConfig for CE T3T/T4T */
28const uint8_t nfa_dm_ce_cfg[] =
29{
30    13,                         /* total length */
31    NFC_PMID_LF_T3T_PMM,        /* Type-3 tag default PMM */
32    NCI_PARAM_LEN_LF_T3T_PMM,
33    0x01,                       /* This PAD0 is used to identify HCE-F on Android */
34    0xFE,                       /* This PAD0 is used to identify HCE-F on Android */
35    0xFF,
36    0xFF,
37    0xFF,
38    0xFF,
39    0xFF,
40    0xFF,
41    NFC_PMID_FWI,               /* FWI for ISO-DEP */
42    1,
43    CE_T4T_ISO_DEP_FWI
44};
45
46uint8_t *p_nfa_dm_ce_cfg = (uint8_t *) nfa_dm_ce_cfg;
47
48/* the SetConfig for optional general NFC stack functions */
49const uint8_t nfa_dm_gen_cfg[] =
50{
51    3,                         /* total length */
52    /* Instruct NFCC to report RF field generated by remote device (or not) */
53    NFC_PMID_RF_FIELD_INFO,
54    1,
55    0x01
56};
57
58uint8_t *p_nfa_dm_gen_cfg = NULL;
59
60
61/* the RF Discovery Frequency for each technology */
62const tNFA_DM_DISC_FREQ_CFG nfa_dm_rf_disc_freq_cfg =
63{
64    1,      /* Frequency for NFC Technology A               */
65    1,      /* Frequency for NFC Technology B               */
66    1,      /* Frequency for NFC Technology F               */
67    1,      /* Frequency for Proprietary Technology/15693   */
68    1,      /* Frequency for Proprietary Technology/B-Prime */
69    1,      /* Frequency for Proprietary Technology/Kovio   */
70    1,      /* Frequency for NFC Technology A active mode   */
71    1       /* Frequency for NFC Technology F active mode   */
72};
73
74tNFA_DM_DISC_FREQ_CFG *p_nfa_dm_rf_disc_freq_cfg = (tNFA_DM_DISC_FREQ_CFG *)&nfa_dm_rf_disc_freq_cfg;
75
76uint8_t nfa_ee_max_ee_cfg = NFA_EE_MAX_EE_SUPPORTED;
77
78
79const tNCI_DISCOVER_MAPS nfa_dm_interface_mapping[NFA_DM_NUM_INTERFACE_MAP] =
80{
81    /* Protocols that use Frame Interface do not need to be included in the interface mapping */
82    {
83        NCI_PROTOCOL_ISO_DEP,
84        NCI_INTERFACE_MODE_POLL_N_LISTEN,
85        NCI_INTERFACE_ISO_DEP
86    },
87    {
88        NCI_PROTOCOL_NFC_DEP,
89        NCI_INTERFACE_MODE_POLL_N_LISTEN,
90        NCI_INTERFACE_NFC_DEP
91    }
92};
93/* set to NULL to use the default mapping set by stack */
94tNCI_DISCOVER_MAPS *p_nfa_dm_interface_mapping = NULL;
95uint8_t nfa_dm_num_dm_interface_mapping = 0;
96
97
98const tNFA_DM_CFG nfa_dm_cfg =
99{
100    /* Automatic NDEF detection (when not in exclusive RF mode) */
101    NFA_DM_AUTO_DETECT_NDEF,
102    /* Automatic NDEF read (when not in exclusive RF mode) */
103    NFA_DM_AUTO_READ_NDEF,
104    /* Automatic presence check */
105    NFA_DM_AUTO_PRESENCE_CHECK,
106    /* Use sleep/wake(last interface) for ISODEP presence check */
107    NFA_DM_PRESENCE_CHECK_OPTION,
108    /* Maximum time to wait for presence check response */
109    NFA_DM_MAX_PRESENCE_CHECK_TIMEOUT
110};
111
112tNFA_DM_CFG *p_nfa_dm_cfg = (tNFA_DM_CFG *) &nfa_dm_cfg;
113
114const uint8_t nfa_hci_whitelist[] =
115{
116    0x02,
117    0x03,
118    0x04
119};
120
121const tNFA_HCI_CFG nfa_hci_cfg =
122{
123    /* Max HCI Network IDLE time to wait for EE DISC REQ Ntf(s) */
124    NFA_HCI_NETWK_INIT_IDLE_TIMEOUT,
125    /* Maximum HCP Response time to any HCP Command */
126    NFA_HCI_RESPONSE_TIMEOUT,
127    /* Number of host in the whitelist of Terminal host */
128    0x03,
129    /* Pointer to the Whitelist of Terminal Host */
130    (uint8_t *) nfa_hci_whitelist
131};
132
133tNFA_HCI_CFG *p_nfa_hci_cfg = (tNFA_HCI_CFG *) &nfa_hci_cfg;
134
135bool    nfa_poll_bail_out_mode = false;
136const tNFA_PROPRIETARY_CFG nfa_proprietary_cfg =
137{
138    0x80, /* NCI_PROTOCOL_18092_ACTIVE */
139    0x81, /* NCI_PROTOCOL_B_PRIME */
140    0x82, /* NCI_PROTOCOL_DUAL */
141    0x83, /* NCI_PROTOCOL_15693 */
142    0x8A, /* NCI_PROTOCOL_KOVIO */
143    0xFF, /* NCI_PROTOCOL_MIFARE */
144    0x77, /* NCI_DISCOVERY_TYPE_POLL_KOVIO */
145    0x74, /* NCI_DISCOVERY_TYPE_POLL_B_PRIME */
146    0xF4, /* NCI_DISCOVERY_TYPE_LISTEN_B_PRIME */
147};
148
149tNFA_PROPRIETARY_CFG *p_nfa_proprietary_cfg = (tNFA_PROPRIETARY_CFG *) &nfa_proprietary_cfg;
150