Do not set PF_RC_CODE in the case of NCI 2.0
In NFCForum NCI2.0 specification, PF_RC_CODE param has been removed
from Discovery Configuration Parameter for Poll F.
So the parameter should be used only if NCI_VERSION_1_0.
Test: Set ReaderMode and read HCE-F
Bug: 79546870
Change-Id: I3e6cf429e3f4bab9c4e9acdfefc1dd3fdff96c2f
(cherry picked from commit 47c74a2d934d34beec62b786833c54724f0445cc)
diff --git a/src/nfa/dm/nfa_dm_discover.cc b/src/nfa/dm/nfa_dm_discover.cc
index d494e1f..62332cb 100644
--- a/src/nfa/dm/nfa_dm_discover.cc
+++ b/src/nfa/dm/nfa_dm_discover.cc
@@ -1047,27 +1047,29 @@
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
+ if (NFC_GetNCIVersion() == NCI_VERSION_1_0) {
+ 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);
}
- nfa_dm_check_set_config(p - config_params, config_params, false);
}
}