summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMartijn Coenen <martijn.coenen@nxp.com>2010-11-02 08:53:36 -0600
committerNick Pelly <npelly@google.com>2010-11-02 12:13:11 -0500
commitfa199fc046cb0bc698d564daaba669a180b7c6f4 (patch)
treea1ebb605046b1d1b140490fa766d91e9b6f3cfe1
parentc2866714540bec65af19240e95a10d3090df0cf9 (diff)
downloadexternal_libnfc-nxp-fa199fc046cb0bc698d564daaba669a180b7c6f4.zip
external_libnfc-nxp-fa199fc046cb0bc698d564daaba669a180b7c6f4.tar.gz
external_libnfc-nxp-fa199fc046cb0bc698d564daaba669a180b7c6f4.tar.bz2
Fixed ICODE and Felica presence checking.
For Felica, the wrong command was used. For ICODE (ISO15693), there was no check implemented at all Change-Id: I40b17feb8b9184cc3c2765cb5b32ea82ebec143b
-rw-r--r--src/phHciNfc_Felica.c6
-rw-r--r--src/phHciNfc_RFReader.c19
2 files changed, 15 insertions, 10 deletions
diff --git a/src/phHciNfc_Felica.c b/src/phHciNfc_Felica.c
index e631012..6c58df1 100644
--- a/src/phHciNfc_Felica.c
+++ b/src/phHciNfc_Felica.c
@@ -797,7 +797,7 @@ phHciNfc_Felica_Request_Mode(
void *pHwRef)
{
NFCSTATUS status = NFCSTATUS_SUCCESS;
- static uint8_t pres_chk_data[(PHHAL_FEL_ID_LEN + 2)] = {0};
+ static uint8_t pres_chk_data[(PHHAL_FEL_ID_LEN + 4)] = {0};
if( (NULL == psHciContext) || (NULL == pHwRef) )
{
@@ -825,7 +825,9 @@ phHciNfc_Felica_Request_Mode(
&(ps_fel_info->felica_info.RemoteDevInfo.Felica_Info);
pres_chk_data[i++] = sizeof(pres_chk_data);
- pres_chk_data[i++] = FELICA_REQ_MODE;
+ pres_chk_data[i++] = 0x00; // Felica poll
+ pres_chk_data[i++] = 0xFF;
+ pres_chk_data[i++] = 0xFF;
(void)memcpy((void *)&(pres_chk_data[i]),
(void *)ps_rem_fel_info->IDm, PHHAL_FEL_ID_LEN);
diff --git a/src/phHciNfc_RFReader.c b/src/phHciNfc_RFReader.c
index cf124f3..e0aa2dc 100644
--- a/src/phHciNfc_RFReader.c
+++ b/src/phHciNfc_RFReader.c
@@ -1675,18 +1675,21 @@ phHciNfc_ReaderMgmt_Presence_Check(
&& (reader_pipe_id != HCI_UNKNOWN_PIPE_ID )
)
{
-#if 0
+ uint8_t cmd[11];
+ phHciNfc_Pipe_Info_t *p_pipe_info = NULL;
p_pipe_info = psHciContext->p_pipe_list[reader_pipe_id];
- p_pipe_info->param_info = ;
- p_pipe_info->param_length = ;
+ p_pipe_info->param_info = &cmd;
+ p_pipe_info->param_length = 11;
+ // masked inventory command:
+ // set #slots to 1 to use mask without padding,
+ // need to set inventory flag to enable setting #slots
+ cmd[0] = 0x04 | 0x20; // FLAG_INVENTORY | FLAG_SLOTS
+ cmd[1] = 0x01; // CMD_INVENTORY
+ cmd[2] = 64; // mask bit-length
+ memcpy(cmd + 3, &(psHciContext->p_target_info->RemoteDevInfo.Iso15693_Info.Uid), 8);
status = phHciNfc_Send_ISO15693_Command(
psHciContext, pHwRef
,reader_pipe_id, NXP_ISO15693_CMD );
-#else
- status = PHNFCSTVAL(CID_NFC_HCI,
- NFCSTATUS_FEATURE_NOT_SUPPORTED);
-
-#endif
}
break;