Commit 68f7145d authored by Martijn Coenen's avatar Martijn Coenen Committed by Gerrit Code Review
Browse files

Merge "Set RC=1 when only polling for T3T."

parents 25fcb258 4c888f85
......@@ -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
......
......@@ -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);
}
}
......
......@@ -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;
......
......@@ -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;
/*
......
......@@ -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
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment