summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorMartijn Coenen <maco@google.com>2011-09-01 09:34:23 -0700
committerAndroid (Google) Code Review <android-gerrit@google.com>2011-09-01 09:34:23 -0700
commit76a56bae5192ad4392d787c07e41db88da1c1418 (patch)
treef84ee230a0f2dfe614c374b29bb20d73f214aee5 /src
parent868cc2d7e3a1efdf52ecc758bedffc5fd9c78e1e (diff)
parentdd7125f5ab402a8e52625182542c668db3e51c2c (diff)
downloadexternal_libnfc-nxp-76a56bae5192ad4392d787c07e41db88da1c1418.zip
external_libnfc-nxp-76a56bae5192ad4392d787c07e41db88da1c1418.tar.gz
external_libnfc-nxp-76a56bae5192ad4392d787c07e41db88da1c1418.tar.bz2
Merge "Felica system code related changes"
Diffstat (limited to 'src')
-rw-r--r--src/phFriNfc_FelicaMap.c130
-rw-r--r--src/phHal4Nfc_Internal.h1
-rw-r--r--src/phHal4Nfc_Reader.c98
-rw-r--r--src/phHciNfc_DevMgmt.c34
-rw-r--r--src/phHciNfc_DevMgmt.h1
-rw-r--r--src/phHciNfc_Felica.c45
6 files changed, 230 insertions, 79 deletions
diff --git a/src/phFriNfc_FelicaMap.c b/src/phFriNfc_FelicaMap.c
index 2604649..8a810f9 100644
--- a/src/phFriNfc_FelicaMap.c
+++ b/src/phFriNfc_FelicaMap.c
@@ -57,13 +57,10 @@ static NFCSTATUS phFriNfc_Felica_HCalCheckSum(const uint8_t *TempBuffer,
uint8_t EndIndex,
uint16_t RecvChkSum);
-#ifndef PH_HAL4_ENABLE
/* Helpers for Poll Related Operations*/
static NFCSTATUS phFriNfc_Felica_HPollCard( phFriNfc_NdefMap_t *NdefMap,
const uint8_t sysCode[],
uint8_t state);
-#endif /* #ifndef PH_HAL4_ENABLE */
-
static NFCSTATUS phFriNfc_Felica_HUpdateManufIdDetails(const phFriNfc_NdefMap_t *NdefMap);
@@ -2118,39 +2115,65 @@ static NFCSTATUS phFriNfc_Felica_HWriteDataBlk(phFriNfc_NdefMap_t *NdefMap)
NFCSTATUS phFriNfc_Felica_ChkNdef( phFriNfc_NdefMap_t *NdefMap)
{
NFCSTATUS status = NFCSTATUS_PENDING;
-
-#ifndef PH_HAL4_ENABLE
uint8_t sysCode[2];
-#endif /* #ifndef PH_HAL4_ENABLE */
-#ifdef PH_HAL4_ENABLE
-
- /* check the ndef compliency with the system code reecived in the RemoteDevInfo*/
- status = phFriNfc_Felica_HUpdateManufIdDetails(NdefMap);
-
- if (status == NFCSTATUS_SUCCESS)
- {
-
- /* set the operation type to Check ndef type*/
- NdefMap->Felica.OpFlag = PH_FRINFC_NDEFMAP_FELI_CHK_NDEF_OP;
- status = phFriNfc_Felica_HRdAttrInfo(NdefMap);
- }
-#else
-
/* set the system code for selecting the wild card*/
sysCode[0] = 0x12;
sysCode[1] = 0xFC;
status = phFriNfc_Felica_HPollCard( NdefMap,sysCode,PH_NFCFRI_NDEFMAP_FELI_STATE_SELECT_NDEF_APP);
-#endif /* #ifdef PH_HAL4_ENABLE */
return (status);
}
/*!
* \brief Check whether a particular Remote Device is NDEF compliant.
- * selects the wild card and then NFC Forum Reference Applications
+ * selects the sysCode and then NFC Forum Reference Applications
*/
+#ifdef PH_HAL4_ENABLE
+static NFCSTATUS phFriNfc_Felica_HPollCard( phFriNfc_NdefMap_t *NdefMap,
+ const uint8_t sysCode[],
+ uint8_t state)
+{
+ NFCSTATUS status = NFCSTATUS_PENDING;
+
+ /*Format the Poll Packet for selecting the system code passed as parameter */
+ NdefMap->SendRecvBuf[0] = 0x06;
+ NdefMap->SendRecvBuf[1] = 0x00;
+ NdefMap->SendRecvBuf[2] = sysCode[0];
+ NdefMap->SendRecvBuf[3] = sysCode[1];
+ NdefMap->SendRecvBuf[4] = 0x01;
+ NdefMap->SendRecvBuf[5] = 0x03;
+
+ NdefMap->SendLength = 6;
+
+ /*set the completion routines for the felica card operations*/
+ NdefMap->MapCompletionInfo.CompletionRoutine = phFriNfc_Felica_Process;
+ NdefMap->MapCompletionInfo.Context = NdefMap;
+
+ /*Set Ndef State*/
+ NdefMap->State = state;
+
+ /* set the felica cmd */
+ NdefMap->Cmd.FelCmd = phHal_eFelica_Raw;
+
+ /*set the additional informations for the data exchange*/
+ NdefMap->psDepAdditionalInfo.DepFlags.MetaChaining = 0;
+ NdefMap->psDepAdditionalInfo.DepFlags.NADPresent = 0;
+
+ status = phFriNfc_OvrHal_Transceive(NdefMap->LowerDevice,
+ &NdefMap->MapCompletionInfo,
+ NdefMap->psRemoteDevInfo,
+ NdefMap->Cmd,
+ &NdefMap->psDepAdditionalInfo,
+ NdefMap->SendRecvBuf,
+ NdefMap->SendLength,
+ NdefMap->SendRecvBuf,
+ NdefMap->SendRecvLength);
+ return (status);
+}
+#endif
+
#ifndef PH_HAL4_ENABLE
static NFCSTATUS phFriNfc_Felica_HPollCard( phFriNfc_NdefMap_t *NdefMap,
@@ -2210,50 +2233,45 @@ static NFCSTATUS phFriNfc_Felica_HUpdateManufIdDetails(const phFriNfc_NdefMap_
{
NFCSTATUS status = NFCSTATUS_PENDING;
-#ifdef PH_HAL4_ENABLE
- /* copy the IDm and PMm in Manufacture Details Structure*/
- (void)memcpy( (uint8_t *)(NdefMap->FelicaManufDetails.ManufID),
- (uint8_t *)NdefMap->psRemoteDevInfo->RemoteDevInfo.Felica_Info.IDm,
- 8);
- (void)memcpy( (uint8_t *)(NdefMap->FelicaManufDetails.ManufParameter),
- (uint8_t *)NdefMap->psRemoteDevInfo->RemoteDevInfo.Felica_Info.PMm,
- 8);
- status = PHNFCSTVAL(CID_NFC_NONE, NFCSTATUS_SUCCESS);
-#else
-
-
- /* Check the System Code for 0x12,0xFC*/
- if( (NdefMap->FelicaPollDetails.psTempRemoteDevInfo.RemoteDevInfo.CardInfo212_424.Startup212_424.SystemCodeAvailable == 1)
- && (NdefMap->FelicaPollDetails.psTempRemoteDevInfo.RemoteDevInfo.CardInfo212_424.Startup212_424.SystemCode[0] == 0x12)
- && (NdefMap->FelicaPollDetails.psTempRemoteDevInfo.RemoteDevInfo.CardInfo212_424.Startup212_424.SystemCode[1] == 0xFC))
+ /* Get the details from Poll Response packet */
+ if (NdefMap->SendRecvLength >= 20)
{
-
- /* copy the IDm and PMm in Manufacture Details Structure*/
- (void)memcpy( (uint8_t *)(NdefMap->FelicaManufDetails.ManufID),
- (uint8_t *)NdefMap->FelicaPollDetails.psTempRemoteDevInfo.RemoteDevInfo.CardInfo212_424.Startup212_424.NFCID2t,
- 8);
- (void)memcpy( (uint8_t *)(NdefMap->FelicaManufDetails.ManufParameter),
- (uint8_t *)NdefMap->FelicaPollDetails.psTempRemoteDevInfo.RemoteDevInfo.CardInfo212_424.Startup212_424.PMm,
- 8);
-
+ (void)memcpy( (uint8_t *)NdefMap->psRemoteDevInfo->RemoteDevInfo.Felica_Info.IDm,
+ (uint8_t *)&NdefMap->SendRecvBuf[2], 8);
+ (void)memcpy( (uint8_t *)NdefMap->psRemoteDevInfo->RemoteDevInfo.Felica_Info.PMm,
+ (uint8_t *)&NdefMap->SendRecvBuf[10], 8);
+ NdefMap->psRemoteDevInfo->RemoteDevInfo.Felica_Info.SystemCode[1] = NdefMap->SendRecvBuf[18];
+ NdefMap->psRemoteDevInfo->RemoteDevInfo.Felica_Info.SystemCode[0] = NdefMap->SendRecvBuf[19];
+ NdefMap->psRemoteDevInfo->RemoteDevInfo.Felica_Info.IDmLength = 8;
- status = PHNFCSTVAL(CID_NFC_NONE,
- NFCSTATUS_SUCCESS);
-
+ /* copy the IDm and PMm in Manufacture Details Structure*/
+ (void)memcpy( (uint8_t *)(NdefMap->FelicaManufDetails.ManufID),
+ (uint8_t *)NdefMap->psRemoteDevInfo->RemoteDevInfo.Felica_Info.IDm,
+ 8);
+ (void)memcpy( (uint8_t *)(NdefMap->FelicaManufDetails.ManufParameter),
+ (uint8_t *)NdefMap->psRemoteDevInfo->RemoteDevInfo.Felica_Info.PMm,
+ 8);
+ if((NdefMap->psRemoteDevInfo->RemoteDevInfo.Felica_Info.SystemCode[1] == 0x12)
+ && (NdefMap->psRemoteDevInfo->RemoteDevInfo.Felica_Info.SystemCode[0] == 0xFC))
+ {
+ status = PHNFCSTVAL(CID_NFC_NONE, NFCSTATUS_SUCCESS);
+ }
+ else
+ {
+ status = PHNFCSTVAL(CID_FRI_NFC_NDEF_MAP,
+ NFCSTATUS_NO_NDEF_SUPPORT);
+ }
}
else
{
- status = PHNFCSTVAL(CID_FRI_NFC_NDEF_MAP,
- NFCSTATUS_NO_NDEF_SUPPORT);
+ status = PHNFCSTVAL(CID_FRI_NFC_NDEF_MAP,
+ NFCSTATUS_NO_NDEF_SUPPORT);
}
-#endif /* #ifdef PH_HAL4_ENABLE */
-
- return (status);
+ return (status);
}
-
/*!
* \brief Completion Routine, Processing function, needed to avoid long blocking.
* \note The lower (Overlapped HAL) layer must register a pointer to this function as a Completion
diff --git a/src/phHal4Nfc_Internal.h b/src/phHal4Nfc_Internal.h
index 8675c55..50f4ea1 100644
--- a/src/phHal4Nfc_Internal.h
+++ b/src/phHal4Nfc_Internal.h
@@ -226,6 +226,7 @@ typedef struct phHal4Nfc_Hal4Ctxt{
/*used to ignore multiple Protected events*/
uint8_t Ignore_Event_Protected;
#endif/*#ifdef IGNORE_EVT_PROTECTED*/
+ uint8_t FelicaIDm[(PHHAL_FEL_ID_LEN + 2)];
}phHal4Nfc_Hal4Ctxt_t;
diff --git a/src/phHal4Nfc_Reader.c b/src/phHal4Nfc_Reader.c
index b767858..5a91e85 100644
--- a/src/phHal4Nfc_Reader.c
+++ b/src/phHal4Nfc_Reader.c
@@ -51,6 +51,7 @@
#define PH_HAL4NFC_SEL_SECTOR2_BYTE0 0x02
#define PH_HAL4NFC_SEL_SECTOR2_BYTE_RESERVED 0x00
+phHal4Nfc_Hal4Ctxt_t *gpHal4Ctxt;
/* --------------------Structures and enumerations --------------------------*/
@@ -962,13 +963,24 @@ NFCSTATUS phHal4Nfc_PresenceCheck(
/*allow only one Presence chk command at any point in time*/
if (eHal4StatePresenceCheck != Hal4Ctxt->Hal4NextState)
{
+ /* Check if remote device is felica */
+ if (Hal4Ctxt->sTgtConnectInfo.psConnectedDevice->RemDevType ==
+ phHal_eFelica_PICC)
+ {
+ /* If felica PICC then copy existing IDm to compare later,
+ If IDm will be same then same PICC is present after presence check
+ else PICC is changed */
+ (void) memcpy(Hal4Ctxt->FelicaIDm,
+ Hal4Ctxt->sTgtConnectInfo.psConnectedDevice->RemoteDevInfo.Felica_Info.IDm,
+ Hal4Ctxt->sTgtConnectInfo.psConnectedDevice->RemoteDevInfo.Felica_Info.IDmLength);
+ }
Hal4Ctxt->sUpperLayerInfo.psUpperLayerCtxt = context;
Hal4Ctxt->sTgtConnectInfo.pPresenceChkCb = pPresenceChkCb;
RetStatus = phHciNfc_Presence_Check(Hal4Ctxt->psHciHandle,
psHwReference
);
Hal4Ctxt->Hal4NextState = (NFCSTATUS_PENDING == RetStatus?
- eHal4StatePresenceCheck:Hal4Ctxt->Hal4NextState);
+ eHal4StatePresenceCheck:Hal4Ctxt->Hal4NextState);
}
else/*Ongoing presence chk*/
{
@@ -990,6 +1002,28 @@ void phHal4Nfc_PresenceChkComplete(
{
Hal4Ctxt->sTgtConnectInfo.psConnectedDevice->SessionOpened
=(uint8_t)(NFCSTATUS_SUCCESS == RetStatus?TRUE:FALSE);
+ /* Check if remote device is felica */
+ if (Hal4Ctxt->sTgtConnectInfo.psConnectedDevice->RemDevType ==
+ phHal_eFelica_PICC)
+ {
+ /* Check if IDm received is same as saved */
+ if (0 != phOsalNfc_MemCompare(Hal4Ctxt->FelicaIDm,
+ Hal4Ctxt->sTgtConnectInfo.psConnectedDevice->RemoteDevInfo.Felica_Info.IDm,
+ Hal4Ctxt->sTgtConnectInfo.psConnectedDevice->RemoteDevInfo.Felica_Info.IDmLength))
+ {
+ RetStatus = NFCSTATUS_FAILED;
+
+ /* Presence check failed so reset remote device information */
+ (void) memset(Hal4Ctxt->sTgtConnectInfo.psConnectedDevice->RemoteDevInfo.Felica_Info.IDm,
+ 0, PHHAL_FEL_ID_LEN + 2);
+ (void) memset(Hal4Ctxt->sTgtConnectInfo.psConnectedDevice->RemoteDevInfo.Felica_Info.PMm,
+ 0, PHHAL_FEL_PM_LEN);
+ }
+
+ /* Cleanup for stored IDm value for using it next time */
+ (void) memset(Hal4Ctxt->FelicaIDm, 0, PHHAL_FEL_ID_LEN + 2);
+ }
+
(*Hal4Ctxt->sTgtConnectInfo.pPresenceChkCb)(
Hal4Ctxt->sUpperLayerInfo.psUpperLayerCtxt,
RetStatus
@@ -1035,7 +1069,28 @@ void phHal4Nfc_ReactivationComplete(
return;
}
+void phHal4Nfc_Felica_RePoll(void *context,
+ NFCSTATUS status)
+{
+ phHal4Nfc_Hal4Ctxt_t *Hal4Ctxt = gpHal4Ctxt;
+ pphHal4Nfc_ConnectCallback_t pUpperConnectCb
+ = Hal4Ctxt->sTgtConnectInfo.pUpperConnectCb;
+
+ Hal4Ctxt->sTgtConnectInfo.pUpperConnectCb = NULL;
+ PHDBG_INFO("Hal4:Calling Connect callback");
+
+ if (pUpperConnectCb != NULL)
+ {
+ /*Notify to the upper layer*/
+ (*pUpperConnectCb)(
+ Hal4Ctxt->sUpperLayerInfo.psUpperLayerCtxt,
+ Hal4Ctxt->sTgtConnectInfo.psConnectedDevice,
+ status
+ );
+ }
+ return;
+}
void phHal4Nfc_ConnectComplete(
phHal4Nfc_Hal4Ctxt_t *Hal4Ctxt,
void *pInfo
@@ -1046,18 +1101,25 @@ void phHal4Nfc_ConnectComplete(
= Hal4Ctxt->sTgtConnectInfo.pUpperConnectCb;
/*Flag to decide whether or not upper layer callback has to be called*/
uint8_t CallConnectCb = TRUE;
+ uint8_t felicaRePoll = FALSE;
+
/*Remote device Connect successful*/
if((NFCSTATUS_SUCCESS == ConnectStatus)
||(eHal4StateTargetConnected == Hal4Ctxt->Hal4CurrentState))
{
+ phHal_sRemoteDevInformation_t *psRmtTgtConnected =
+ Hal4Ctxt->sTgtConnectInfo.psConnectedDevice;
PHDBG_INFO("Hal4:Connect status Success");
Hal4Ctxt->Hal4CurrentState = eHal4StateTargetConnected;
Hal4Ctxt->Hal4NextState = eHal4StateInvalid;
/* Open the Session */
- Hal4Ctxt->sTgtConnectInfo.psConnectedDevice->SessionOpened =
+ psRmtTgtConnected->SessionOpened =
(uint8_t)(NFCSTATUS_SUCCESS == ConnectStatus?TRUE:FALSE);
Hal4Ctxt->sTgtConnectInfo.pUpperConnectCb = NULL;
-
+ if (psRmtTgtConnected->RemDevType == phHal_eFelica_PICC)
+ {
+ felicaRePoll = TRUE;
+ }
}
else/*Remote device Connect failed*/
{
@@ -1094,13 +1156,37 @@ void phHal4Nfc_ConnectComplete(
}
if(TRUE == CallConnectCb)
{
- PHDBG_INFO("Hal4:Calling Connect callback");
- /*Notify to the upper layer*/
- (*pUpperConnectCb)(
+ if (felicaRePoll == TRUE)
+ {
+ /* Felica repoll through presence check */
+
+ /* If felica PICC then copy existing IDm to compare later,
+ If IDm will be same then same PICC is present after presence check
+ else PICC is changed */
+ (void) memcpy(Hal4Ctxt->FelicaIDm,
+ Hal4Ctxt->sTgtConnectInfo.psConnectedDevice->RemoteDevInfo.Felica_Info.IDm,
+ Hal4Ctxt->sTgtConnectInfo.psConnectedDevice->RemoteDevInfo.Felica_Info.IDmLength);
+
+ gpHal4Ctxt = Hal4Ctxt;
+ Hal4Ctxt->sTgtConnectInfo.pPresenceChkCb = phHal4Nfc_Felica_RePoll;
+ ConnectStatus = phHciNfc_Presence_Check(Hal4Ctxt->psHciHandle,
+ gpphHal4Nfc_Hwref
+ );
+ Hal4Ctxt->Hal4NextState = (NFCSTATUS_PENDING == ConnectStatus?
+ eHal4StatePresenceCheck:Hal4Ctxt->Hal4NextState);
+ felicaRePoll = FALSE;
+ Hal4Ctxt->sTgtConnectInfo.pUpperConnectCb = pUpperConnectCb;
+ }
+ else
+ {
+ PHDBG_INFO("Hal4:Calling Connect callback");
+ /*Notify to the upper layer*/
+ (*pUpperConnectCb)(
Hal4Ctxt->sUpperLayerInfo.psUpperLayerCtxt,
Hal4Ctxt->sTgtConnectInfo.psConnectedDevice,
ConnectStatus
);
+ }
}
else
{
diff --git a/src/phHciNfc_DevMgmt.c b/src/phHciNfc_DevMgmt.c
index 60bcf73..ef3aa78 100644
--- a/src/phHciNfc_DevMgmt.c
+++ b/src/phHciNfc_DevMgmt.c
@@ -118,6 +118,7 @@ typedef enum phHciNfc_DevMgmt_Seq{
DEV_MGMT_LLC_GRD_TO_L,
DEV_MGMT_LLC_ACK_TO_H,
DEV_MGMT_LLC_ACK_TO_L,
+ DEV_MGMT_FELICA_RC,
DEV_MGMT_EVT_AUTONOMOUS,
DEV_MGMT_PIPE_CLOSE
} phHciNfc_DevMgmt_Seq_t;
@@ -517,17 +518,8 @@ phHciNfc_DevMgmt_Initialise(
pHwRef, p_pipe_info );
if(status == NFCSTATUS_SUCCESS)
{
-
- if (HCI_SELF_TEST == psHciContext->init_mode )
- {
- p_device_mgmt_info->next_seq =
- DEV_MGMT_GPIO_PDIR;
- }
- else
- {
- p_device_mgmt_info->next_seq =
- DEV_MGMT_GET_EEPROM_INFO;
- }
+ p_device_mgmt_info->next_seq =
+ DEV_MGMT_FELICA_RC;
status = NFCSTATUS_PENDING;
}
break;
@@ -579,6 +571,26 @@ phHciNfc_DevMgmt_Initialise(
}
break;
}
+ case DEV_MGMT_FELICA_RC:
+ {
+ config = 0x00;
+ status = phHciNfc_DevMgmt_Configure( psHciContext, pHwRef,
+ NFC_FELICA_RC_ADDR , config );
+ if(NFCSTATUS_PENDING == status )
+ {
+ if (HCI_SELF_TEST == psHciContext->init_mode )
+ {
+ p_device_mgmt_info->next_seq =
+ DEV_MGMT_GPIO_PDIR;
+ }
+ else
+ {
+ p_device_mgmt_info->next_seq =
+ DEV_MGMT_GET_EEPROM_INFO;
+ }
+ }
+ break;
+ }
#if ( NXP_NFC_IFC_TIMEOUT & 0x01 )
diff --git a/src/phHciNfc_DevMgmt.h b/src/phHciNfc_DevMgmt.h
index 571fac2..e886013 100644
--- a/src/phHciNfc_DevMgmt.h
+++ b/src/phHciNfc_DevMgmt.h
@@ -119,6 +119,7 @@
#define NFC_ADDRESS_PMOS_MOD 0x997AU
#endif
+#define NFC_FELICA_RC_ADDR 0x9F9AU
/* The Address Definition for the Enabling the EVT_HOT_PLUG */
#define NFC_ADDRESS_HOTPLUG_EVT 0x9FF0U
diff --git a/src/phHciNfc_Felica.c b/src/phHciNfc_Felica.c
index 2bbb32a..2897690 100644
--- a/src/phHciNfc_Felica.c
+++ b/src/phHciNfc_Felica.c
@@ -51,6 +51,7 @@
#define NXP_WRA_CONTINUE_ACTIVATION 0x12U
#define NXP_FEL_SYS_CODE 0x01U
+#define NXP_FEL_POLREQ_SYS_CODE 0x02U
#define NXP_FEL_CURRENTIDM 0x04U
#define NXP_FEL_CURRENTPMM 0x05U
@@ -63,6 +64,7 @@ uint8_t nxp_nfc_felica_timeout = NXP_FELICA_XCHG_TIMEOUT;
/* Presence check command for felica tag */
#define FELICA_REQ_MODE 0x04U
+
/*
*************************** Structure and Enumeration ***************************
*/
@@ -418,10 +420,9 @@ phHciNfc_Felica_InfoUpdate(
{
if (NXP_FEL_SYS_CODE_LEN == reg_length)
{
- HCI_PRINT_BUFFER("\tFelica system code data", reg_value, reg_length);
- /* Update current system code values */
- (void)memcpy(p_fel_tag_info->SystemCode, reg_value,
- reg_length);
+ /* System code from registry is invalid in this case */
+ p_fel_tag_info->SystemCode[0] = 0;
+ p_fel_tag_info->SystemCode[1] = 0;
}
else
{
@@ -501,6 +502,39 @@ phHciNfc_Recv_Felica_Packet(
index = (index + 1);
psHciContext->rx_index = (HCP_HEADER_LEN + 1);
HCI_PRINT_BUFFER("Felica Bytes received", &pResponse[index], (length - index));
+ /* If Poll response received then update IDm and PMm parameters, when presence check going on */
+ if (pResponse[index + 1] == 0x01)
+ {
+ if (length >= 19)
+ {
+ /* IDm */
+ (void) memcpy(psHciContext->p_target_info->RemoteDevInfo.Felica_Info.IDm,
+ &pResponse[index + 2], 8);
+ /* PMm */
+ (void) memcpy(psHciContext->p_target_info->RemoteDevInfo.Felica_Info.PMm,
+ &pResponse[index + 2 + 8], 8);
+ index = index + 2 + 8 + 8;
+
+ /* SC */
+ if (length >= 21)
+ {
+ /* Copy SC if available */
+ psHciContext->p_target_info->RemoteDevInfo.Felica_Info.SystemCode[0] = pResponse[index];
+ psHciContext->p_target_info->RemoteDevInfo.Felica_Info.SystemCode[1] = pResponse[index + 1];
+ }
+ else
+ {
+ /* If SC is not available in packet then set to zero */
+ psHciContext->p_target_info->RemoteDevInfo.Felica_Info.SystemCode[0] = 0;
+ psHciContext->p_target_info->RemoteDevInfo.Felica_Info.SystemCode[1] = 0;
+ }
+ }
+ else
+ {
+ status = PHNFCSTVAL(CID_NFC_HCI,
+ NFCSTATUS_INVALID_HCI_RESPONSE);
+ }
+ }
}
else
{
@@ -828,7 +862,7 @@ phHciNfc_Felica_Request_Mode(
pres_chk_data[1] = 0x00; // Felica poll
pres_chk_data[2] = 0xFF;
pres_chk_data[3] = 0xFF;
- pres_chk_data[4] = 0x00;
+ pres_chk_data[4] = 0x01;
pres_chk_data[5] = 0x00;
ps_pipe_info->param_info = pres_chk_data;
@@ -843,7 +877,6 @@ phHciNfc_Felica_Request_Mode(
return status;
}
-
NFCSTATUS
phHciNfc_Send_Felica_Command(
phHciNfc_sContext_t *psContext,