diff options
author | Martijn Coenen <maco@google.com> | 2016-02-04 11:35:47 +0000 |
---|---|---|
committer | Gerrit Code Review <noreply-gerritcodereview@google.com> | 2016-02-04 11:35:47 +0000 |
commit | 68f7145da1fafd91cd5500f219008a1921f54a01 (patch) | |
tree | 2054a3ca951d69d0bea6284f4630e95381ec25c9 | |
parent | 25fcb2588094bc08b9b4a96eb0e2442bcf782ad7 (diff) | |
parent | 4c888f85f62bb59ce8a3d268a61a98536e0dd36e (diff) | |
download | libnfc-nci-68f7145da1fafd91cd5500f219008a1921f54a01.tar.gz |
Merge "Set RC=1 when only polling for T3T."
-rw-r--r-- | src/hal/include/nci_defs.h | 3 | ||||
-rw-r--r-- | src/nfa/dm/nfa_dm_discover.c | 27 | ||||
-rw-r--r-- | src/nfa/dm/nfa_dm_main.c | 7 | ||||
-rw-r--r-- | src/nfa/int/nfa_dm_int.h | 2 | ||||
-rw-r--r-- | src/nfc/include/nfc_api.h | 1 |
5 files changed, 40 insertions, 0 deletions
diff --git a/src/hal/include/nci_defs.h b/src/hal/include/nci_defs.h index 027dd21..d561f29 100644 --- a/src/hal/include/nci_defs.h +++ b/src/hal/include/nci_defs.h @@ -438,6 +438,7 @@ typedef UINT8 tNCI_DISCOVERY_TYPE; #define NCI_PARAM_ID_PB_BAILOUT 0x11 #define NCI_PARAM_ID_PB_ATTRIB_PARAM1 0x12 #define NCI_PARAM_ID_PF_BIT_RATE 0x18 +#define NCI_PARAM_ID_PF_RC 0x19 #define NCI_PARAM_ID_PB_H_INFO 0x20 #define NCI_PARAM_ID_PI_BIT_RATE 0x21 @@ -512,6 +513,8 @@ typedef UINT8 tNCI_DISCOVERY_TYPE; #define NCI_PARAM_LEN_PA_FSDI 1 +#define NCI_PARAM_LEN_PF_RC 1 + #define NCI_PARAM_LEN_LA_BIT_FRAME_SDD 1 #define NCI_PARAM_LEN_LA_PLATFORM_CONFIG 1 #define NCI_PARAM_LEN_LA_SEL_INFO 1 diff --git a/src/nfa/dm/nfa_dm_discover.c b/src/nfa/dm/nfa_dm_discover.c index 9930cfa..35239be 100644 --- a/src/nfa/dm/nfa_dm_discover.c +++ b/src/nfa/dm/nfa_dm_discover.c @@ -970,6 +970,7 @@ void nfa_dm_start_rf_discover (void) { tNFC_DISCOVER_PARAMS disc_params[NFA_DM_MAX_DISC_PARAMS]; tNFA_DM_DISC_TECH_PROTO_MASK dm_disc_mask = 0, poll_mask, listen_mask; + UINT8 config_params[10], *p; UINT8 num_params, xx; NFA_TRACE_DEBUG0 ("nfa_dm_start_rf_discover ()"); @@ -1088,7 +1089,33 @@ void nfa_dm_start_rf_discover (void) /* Let P2P set GEN bytes for LLCP to NFCC */ if (dm_disc_mask & NFA_DM_DISC_MASK_NFC_DEP) { + nfa_p2p_set_config (dm_disc_mask); + + } + if (dm_disc_mask & (NFA_DM_DISC_MASK_PF_NFC_DEP | NFA_DM_DISC_MASK_PF_T3T)) + { + /* According to the NFC Forum Activity spec, controllers must: + * 1) Poll with RC=0 and SC=FFFF to find NFC-DEP targets + * 2) Poll with RC=1 and SC=FFFF to find T3T targets + * Many controllers don't do this yet, and seem to be activating + * NFC-DEP by default. + * + * We can at least fix the scenario where we're not interested + * in NFC-DEP, by setting RC=1 in that case. Otherwise, keep + * the default of RC=0. */ + p = config_params; + UINT8_TO_STREAM (p, NFC_PMID_PF_RC); + UINT8_TO_STREAM (p, NCI_PARAM_LEN_PF_RC); + if ((dm_disc_mask & NFA_DM_DISC_MASK_PF_NFC_DEP) && !nfa_dm_is_p2p_paused()) + { + UINT8_TO_STREAM (p, 0x00); // RC=0 + } + else + { + UINT8_TO_STREAM (p, 0x01); // RC=1 + } + nfa_dm_check_set_config(p - config_params, config_params, FALSE); } } diff --git a/src/nfa/dm/nfa_dm_main.c b/src/nfa/dm/nfa_dm_main.c index 466eff0..1b96c71 100644 --- a/src/nfa/dm/nfa_dm_main.c +++ b/src/nfa/dm/nfa_dm_main.c @@ -250,6 +250,13 @@ tNFA_STATUS nfa_dm_check_set_config (UINT8 tlv_list_len, UINT8 *p_tlv_list, BOOL switch (type) { + /* + ** Poll F Configuration + */ + case NFC_PMID_PF_RC: + p_stored = nfa_dm_cb.params.pf_rc; + max_len = NCI_PARAM_LEN_PF_RC; + break; case NFC_PMID_TOTAL_DURATION: p_stored = nfa_dm_cb.params.total_duration; max_len = NCI_PARAM_LEN_TOTAL_DURATION; diff --git a/src/nfa/int/nfa_dm_int.h b/src/nfa/int/nfa_dm_int.h index cadd18b..f22dcf6 100644 --- a/src/nfa/int/nfa_dm_int.h +++ b/src/nfa/int/nfa_dm_int.h @@ -463,6 +463,8 @@ typedef struct UINT8 atr_req_gen_bytes_len; UINT8 atr_res_gen_bytes[NCI_MAX_GEN_BYTES_LEN]; UINT8 atr_res_gen_bytes_len; + + UINT8 pf_rc[NCI_PARAM_LEN_PF_RC]; } tNFA_DM_PARAMS; /* diff --git a/src/nfc/include/nfc_api.h b/src/nfc/include/nfc_api.h index 70734e4..e19faab 100644 --- a/src/nfc/include/nfc_api.h +++ b/src/nfc/include/nfc_api.h @@ -87,6 +87,7 @@ typedef UINT8 tNFC_STATUS; #define NFC_PMID_PB_BAILOUT NCI_PARAM_ID_PB_BAILOUT #define NFC_PMID_PB_ATTRIB_PARAM1 NCI_PARAM_ID_PB_ATTRIB_PARAM1 #define NFC_PMID_PF_BIT_RATE NCI_PARAM_ID_PF_BIT_RATE +#define NFC_PMID_PF_RC NCI_PARAM_ID_PF_RC #define NFC_PMID_PB_H_INFO NCI_PARAM_ID_PB_H_INFO #define NFC_PMID_BITR_NFC_DEP NCI_PARAM_ID_BITR_NFC_DEP #define NFC_PMID_ATR_REQ_GEN_BYTES NCI_PARAM_ID_ATR_REQ_GEN_BYTES |