本文整理汇总了C++中PHNFCSTVAL函数的典型用法代码示例。如果您正苦于以下问题:C++ PHNFCSTVAL函数的具体用法?C++ PHNFCSTVAL怎么用?C++ PHNFCSTVAL使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了PHNFCSTVAL函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: phHciNfc_Send_Admin_Event
NFCSTATUS
phHciNfc_Send_Admin_Event (
phHciNfc_sContext_t *psHciContext,
void *pHwRef,
uint8_t event,
uint8_t length,
void *params
)
{
phHciNfc_HCP_Packet_t *hcp_packet = NULL;
phHciNfc_AdminGate_Info_t *p_admin_info=NULL;
NFCSTATUS status = NFCSTATUS_SUCCESS;
if( (NULL == psHciContext)
|| (NULL == pHwRef)
)
{
status = PHNFCSTVAL(CID_NFC_HCI, NFCSTATUS_INVALID_PARAMETER);
}
else
{
psHciContext->tx_total = 0 ;
length += HCP_HEADER_LEN ;
p_admin_info = psHciContext->p_admin_info;
if( EVT_HOT_PLUG == event )
{
/* Use the HCP Packet Structure to Construct the send HCP
* Packet data.
*/
hcp_packet = (phHciNfc_HCP_Packet_t *) psHciContext->send_buffer;
phHciNfc_Build_HCPFrame(hcp_packet,HCP_CHAINBIT_DEFAULT,
(uint8_t) HCI_ADMIN_PIPE_ID,
HCP_MSG_TYPE_EVENT, event);
}
else
{
status = PHNFCSTVAL(CID_NFC_HCI, NFCSTATUS_INVALID_HCI_INSTRUCTION);
}
if( NFCSTATUS_SUCCESS == status )
{
p_admin_info->admin_pipe_info->sent_msg_type = HCP_MSG_TYPE_EVENT;
p_admin_info->admin_pipe_info->prev_msg = event ;
p_admin_info->admin_pipe_info->param_info = params ;
psHciContext->tx_total = length;
psHciContext->response_pending = FALSE ;
status = phHciNfc_Send_HCP( (void *)psHciContext, (void *)pHwRef );
p_admin_info->admin_pipe_info->prev_status = NFCSTATUS_PENDING;
}
}
return status;
}
示例2: phDnldNfc_ReadLog
/*******************************************************************************
**
** Function phDnldNfc_ReadLog
**
** Description Retrieves log data from EEPROM
**
** Parameters pData - response buffer which gets updated with data from EEPROM
** pNotify - notify caller after getting response
** pContext - caller context
**
** Returns NFC status:
** NFCSTATUS_SUCCESS - Read request to NFCC is successful
** NFCSTATUS_FAILED - Read request failed due to internal error
** NFCSTATUS_NOT_ALLOWED - command not allowed
** Other command specific errors -
**
*******************************************************************************/
NFCSTATUS phDnldNfc_ReadLog(pphDnldNfc_Buff_t pData, pphDnldNfc_RspCb_t pNotify, void *pContext)
{
NFCSTATUS wStatus = NFCSTATUS_SUCCESS;
if((NULL == pNotify) || (NULL == pData) ||
(NULL == pContext)
)
{
NXPLOG_FWDNLD_E("Invalid Input Parameters!!");
wStatus = PHNFCSTVAL(CID_NFC_DNLD, NFCSTATUS_INVALID_PARAMETER);
}
else
{
if(phDnldNfc_TransitionIdle != gpphDnldContext->tDnldInProgress)
{
NXPLOG_FWDNLD_E("Dnld Cmd Request in Progress..Cannot Continue!!");
wStatus = PHNFCSTVAL(CID_NFC_DNLD, NFCSTATUS_BUSY);
}
else
{
if((NULL != pData->pBuff) && (0 != pData->wLen))
{
(gpphDnldContext->tCmdId) = PH_DL_CMD_READ;
(gpphDnldContext->FrameInp.Type) = phDnldNfc_FTRead;
(gpphDnldContext->FrameInp.dwAddr) = PHDNLDNFC_EEPROM_LOG_START_ADDR;
(gpphDnldContext->tRspBuffInfo.pBuff) = pData->pBuff;
(gpphDnldContext->tRspBuffInfo.wLen) = pData->wLen;
(gpphDnldContext->tUserData.pBuff) = NULL;
(gpphDnldContext->tUserData.wLen) = 0;
(gpphDnldContext->UserCb) = pNotify;
(gpphDnldContext->UserCtxt) = pContext;
memset(&(gpphDnldContext->tRWInfo),0,sizeof(gpphDnldContext->tRWInfo));
wStatus = phDnldNfc_CmdHandler(gpphDnldContext,phDnldNfc_EventRead);
if(NFCSTATUS_PENDING == wStatus)
{
NXPLOG_FWDNLD_D("Read Request submitted successfully");
}
else
{
NXPLOG_FWDNLD_E("Read Request Failed!!");
}
}
else
{
NXPLOG_FWDNLD_E("Invalid Buff Parameters!!");
wStatus = PHNFCSTVAL(CID_NFC_DNLD, NFCSTATUS_INVALID_PARAMETER);
}
}
}
return wStatus;
}
示例3: phTmlNfc_Write
/*******************************************************************************
**
** Function phTmlNfc_Write
**
** Description Asynchronously writes given data block to hardware interface/driver
** Enables writer thread if there are no write requests pending
** Returns successfully once writer thread completes write operation
** Notifies upper layer using callback mechanism
** NOTE:
** * it is important to post a message with id PH_TMLNFC_WRITE_MESSAGE
** to IntegrationThread after data has been written to PN54X
** * if CRC needs to be computed, then input buffer should be capable to store
** two more bytes apart from length of packet
**
** Parameters pBuffer - data to be sent
** wLength - length of data buffer
** pTmlWriteComplete - pointer to the function to be invoked upon completion
** pContext - context provided by upper layer
**
** Returns NFC status:
** NFCSTATUS_PENDING - command is yet to be processed
** NFCSTATUS_INVALID_PARAMETER - at least one parameter is invalid
** NFCSTATUS_BUSY - write request is already in progress
**
*******************************************************************************/
NFCSTATUS phTmlNfc_Write(uint8_t *pBuffer, uint16_t wLength, pphTmlNfc_TransactCompletionCb_t pTmlWriteComplete, void *pContext)
{
NFCSTATUS wWriteStatus;
/* Check whether TML is Initialized */
if (NULL != gpphTmlNfc_Context)
{
if ((NULL != gpphTmlNfc_Context->pDevHandle) && (NULL != pBuffer) &&
(PH_TMLNFC_RESET_VALUE != wLength) && (NULL != pTmlWriteComplete))
{
if (!gpphTmlNfc_Context->tWriteInfo.bThreadBusy)
{
/* Setting the flag marks beginning of a Write Operation */
gpphTmlNfc_Context->tWriteInfo.bThreadBusy = TRUE;
/* Copy the buffer, length and Callback function,
This shall be utilized while invoking the Callback function in thread */
gpphTmlNfc_Context->tWriteInfo.pBuffer = pBuffer;
gpphTmlNfc_Context->tWriteInfo.wLength = wLength;
gpphTmlNfc_Context->tWriteInfo.pThread_Callback = pTmlWriteComplete;
gpphTmlNfc_Context->tWriteInfo.pContext = pContext;
wWriteStatus = NFCSTATUS_PENDING;
//FIXME: If retry is going on. Stop the retry thread/timer
if (phTmlNfc_e_EnableRetrans == gpphTmlNfc_Context->eConfig)
{
/* Set retry count to default value */
//FIXME: If the timer expired there, and meanwhile we have created
// a new request. The expired timer will think that retry is still
// ongoing.
bCurrentRetryCount = gpphTmlNfc_Context->bRetryCount;
gpphTmlNfc_Context->bWriteCbInvoked = FALSE;
}
/* Set event to invoke Writer Thread */
gpphTmlNfc_Context->tWriteInfo.bEnable = 1;
sem_post(&gpphTmlNfc_Context->txSemaphore);
}
else
{
wWriteStatus = PHNFCSTVAL(CID_NFC_TML, NFCSTATUS_BUSY);
}
}
else
{
wWriteStatus = PHNFCSTVAL(CID_NFC_TML, NFCSTATUS_INVALID_PARAMETER);
}
}
else
{
wWriteStatus = PHNFCSTVAL(CID_NFC_TML, NFCSTATUS_NOT_INITIALISED);
}
return wWriteStatus;
}
示例4: phDnldNfc_RawReq
/*******************************************************************************
**
** Function phDnldNfc_RawReq
**
** Description Sends raw frame request to NFCC.
** It is currently used for sending an NCI RESET cmd after doing a production key update
**
** Parameters pFrameData - input buffer, contains raw frame packet to be sent to NFCC
** pRspData - response buffer received from NFCC
** pNotify - notify caller after getting response
** pContext - caller context
**
** Returns NFC status:
** NFCSTATUS_SUCCESS - GetSessionState request to NFCC is successful
** NFCSTATUS_FAILED - GetSessionState request failed due to internal error
** NFCSTATUS_NOT_ALLOWED - command not allowed
** Other command specific errors -
**
*******************************************************************************/
NFCSTATUS phDnldNfc_RawReq(pphDnldNfc_Buff_t pFrameData, pphDnldNfc_Buff_t pRspData, pphDnldNfc_RspCb_t pNotify, void *pContext)
{
NFCSTATUS wStatus = NFCSTATUS_SUCCESS;
if((NULL == pFrameData) || (NULL == pNotify) || (NULL == pRspData) ||
(NULL == pContext)
)
{
NXPLOG_FWDNLD_E("Invalid Input Parameters!!");
wStatus = PHNFCSTVAL(CID_NFC_DNLD, NFCSTATUS_INVALID_PARAMETER);
}
else
{
if(phDnldNfc_TransitionIdle != gpphDnldContext->tDnldInProgress)
{
NXPLOG_FWDNLD_E("Raw Cmd Request in Progress..Cannot Continue!!");
wStatus = PHNFCSTVAL(CID_NFC_DNLD, NFCSTATUS_BUSY);
}
else
{
if(((NULL != pFrameData->pBuff) && (0 != pFrameData->wLen)) &&
((NULL != pRspData->pBuff) && (0 != pRspData->wLen))
)
{
(gpphDnldContext->tRspBuffInfo.pBuff) = pRspData->pBuff;
(gpphDnldContext->tRspBuffInfo.wLen) = pRspData->wLen;
(gpphDnldContext->FrameInp.Type) = phDnldNfc_FTRaw;
(gpphDnldContext->tCmdId) = PH_DL_CMD_NONE;
(gpphDnldContext->tUserData.pBuff) = pFrameData->pBuff;
(gpphDnldContext->tUserData.wLen) = pFrameData->wLen;
(gpphDnldContext->UserCb) = pNotify;
(gpphDnldContext->UserCtxt) = pContext;
wStatus = phDnldNfc_CmdHandler(gpphDnldContext,phDnldNfc_EventRaw);
if(NFCSTATUS_PENDING == wStatus)
{
NXPLOG_FWDNLD_D("RawFrame Request submitted successfully");
}
else
{
NXPLOG_FWDNLD_E("RawFrame Request Failed!!");
}
}
else
{
NXPLOG_FWDNLD_E("Invalid Buff Parameters!!");
wStatus = PHNFCSTVAL(CID_NFC_DNLD, NFCSTATUS_INVALID_PARAMETER);
}
}
}
return wStatus;
}
示例5: phFriNfc_LlcpMac_ChkLlcp
NFCSTATUS phFriNfc_LlcpMac_ChkLlcp (phFriNfc_LlcpMac_t *LlcpMac,
phHal_sRemoteDevInformation_t *psRemoteDevInfo,
phFriNfc_LlcpMac_Chk_CB_t ChkLlcpMac_Cb,
void *pContext)
{
NFCSTATUS status = NFCSTATUS_SUCCESS;
if (NULL == LlcpMac || NULL == psRemoteDevInfo)
{
status = PHNFCSTVAL(CID_FRI_NFC_LLCP_MAC, NFCSTATUS_INVALID_PARAMETER);
}
else
{
/* Store the Remote Device info received from Device Discovery */
LlcpMac->psRemoteDevInfo = psRemoteDevInfo;
if(LlcpMac->psRemoteDevInfo->RemDevType == phHal_eNfcIP1_Initiator)
{
/* Set the PeerRemoteDevType variable to the Target type */
LlcpMac->PeerRemoteDevType = phFriNfc_LlcpMac_ePeerTypeTarget;
}
else if(LlcpMac->psRemoteDevInfo->RemDevType == phHal_eNfcIP1_Target)
{
/* Set the PeerRemoteDevType variable to the Initiator type */
LlcpMac->PeerRemoteDevType = phFriNfc_LlcpMac_ePeerTypeInitiator;
}
switch(LlcpMac->psRemoteDevInfo->RemDevType)
{
case phHal_eNfcIP1_Initiator:
case phHal_eNfcIP1_Target:
{
/* Set the MAC mapping type detected */
LlcpMac->MacType = phFriNfc_LlcpMac_eTypeNfcip;
/* Register the lower layer to the MAC mapping component */
status = phFriNfc_LlcpMac_Nfcip_Register (LlcpMac);
if(status == NFCSTATUS_SUCCESS)
{
status = LlcpMac->LlcpMacInterface.chk(LlcpMac,ChkLlcpMac_Cb,pContext);
}
else
{
status = PHNFCSTVAL(CID_FRI_NFC_LLCP_MAC, NFCSTATUS_FAILED);
}
}break;
default:
{
status = PHNFCSTVAL(CID_FRI_NFC_LLCP_MAC, NFCSTATUS_INVALID_DEVICE);
}break;
}
}
return status;
}
示例6: phHciNfc_ReaderB_Set_LayerData
NFCSTATUS
phHciNfc_ReaderB_Set_LayerData(
void *psContext,
void *pHwRef,
phNfc_sData_t *layer_data_info
)
{
NFCSTATUS status = NFCSTATUS_SUCCESS;
phHciNfc_sContext_t *psHciContext =
(phHciNfc_sContext_t *)psContext ;
if( (NULL == psHciContext) || (NULL == pHwRef) ||
(NULL == layer_data_info) || (NULL == layer_data_info->buffer)
|| (0 == layer_data_info->length))
{
status = PHNFCSTVAL(CID_NFC_HCI, NFCSTATUS_INVALID_PARAMETER);
}
else if((NULL == psHciContext->p_reader_b_info) ||
(HCI_READER_B_ENABLE !=
((phHciNfc_ReaderB_Info_t *)(psHciContext->p_reader_b_info))->
enable_rdr_b_gate))
{
status = PHNFCSTVAL(CID_NFC_HCI, NFCSTATUS_FEATURE_NOT_SUPPORTED);
}
else
{
phHciNfc_ReaderB_Info_t *ps_rdr_b_info=NULL;
phHciNfc_Pipe_Info_t *p_pipe_info=NULL;
uint8_t pipeid = 0;
ps_rdr_b_info = (phHciNfc_ReaderB_Info_t *)
psHciContext->p_reader_b_info ;
p_pipe_info = ps_rdr_b_info->p_pipe_info;
if(NULL == p_pipe_info )
{
status = PHNFCSTVAL(CID_NFC_HCI,
NFCSTATUS_INVALID_HCI_SEQUENCE);
}
else
{
p_pipe_info->reg_index = RDR_B_HIGHER_LAYER_DATA_INDEX;
pipeid = ps_rdr_b_info->pipe_id ;
p_pipe_info->param_info = (void *)layer_data_info->buffer;
p_pipe_info->param_length = (uint8_t)
layer_data_info->length;
/* Fill the data buffer and send the command to the
device */
status = phHciNfc_Send_Generic_Cmd( psHciContext, pHwRef,
pipeid, (uint8_t)ANY_SET_PARAMETER);
}
}
return status;
}
示例7: phHciNfc_SWP_Configure_Mode
NFCSTATUS
phHciNfc_SWP_Configure_Mode(
void *psHciHandle,
void *pHwRef,
uint8_t uicc_mode
)
{
NFCSTATUS status = NFCSTATUS_SUCCESS;
static uint8_t param = 0;
phHciNfc_sContext_t *psHciContext = ((phHciNfc_sContext_t *)
psHciHandle);
if( (NULL == psHciContext)||(NULL == pHwRef))
{
status = PHNFCSTVAL(CID_NFC_HCI, NFCSTATUS_INVALID_PARAMETER);
}
else if ( NULL == psHciContext->p_swp_info )
{
status = PHNFCSTVAL(CID_NFC_HCI,
NFCSTATUS_INVALID_HCI_INFORMATION);
}
else
{
phHciNfc_SWP_Info_t *ps_swp_info=NULL;
phHciNfc_Pipe_Info_t *ps_pipe_info=NULL;
ps_swp_info = (phHciNfc_SWP_Info_t*)psHciContext->p_swp_info;
ps_pipe_info = ps_swp_info->p_pipe_info;
if(NULL == ps_pipe_info)
{
status = PHNFCSTVAL(CID_NFC_HCI,
NFCSTATUS_INVALID_HCI_INFORMATION);
}
else
{
/* Switch the Mode of the SmartMx */
param = uicc_mode;
ps_pipe_info->param_info =(void*)¶m ;
ps_pipe_info->param_length = sizeof(param) ;
status = phHciNfc_Send_SWP_Event( psHciContext, pHwRef,
ps_swp_info->pipe_id,
NXP_EVT_SWP_SWITCH_MODE );
/* Send the Success Status as this is an event */
status = ((status == NFCSTATUS_PENDING)?
NFCSTATUS_SUCCESS : status);
}/* End of else part*/
}
return status;
}
示例8: phHciNfc_Recv_Admin_Event
/*!
* \brief Receives the HCI Admin Event from the corresponding peripheral device.
*
* This function receives the HCI Admin Events from the connected NFC Pheripheral
* device
*/
static
NFCSTATUS
phHciNfc_Recv_Admin_Event (
void *psContext,
void *pHwRef,
uint8_t *pEvent,
#ifdef ONE_BYTE_LEN
uint8_t length
#else
uint16_t length
#endif
)
{
phHciNfc_sContext_t *psHciContext =
(phHciNfc_sContext_t *)psContext ;
phHciNfc_HCP_Packet_t *hcp_packet = NULL;
phHciNfc_HCP_Message_t *hcp_message = NULL;
uint8_t event = (uint8_t) HCP_MSG_INSTRUCTION_INVALID;
NFCSTATUS status = NFCSTATUS_SUCCESS;
if( (NULL == psHciContext)
|| (NULL == pHwRef)
|| (HCP_HEADER_LEN > length )
)
{
status = PHNFCSTVAL(CID_NFC_HCI, NFCSTATUS_INVALID_PARAMETER);
}
else
{
hcp_packet = (phHciNfc_HCP_Packet_t *)pEvent;
hcp_message = &hcp_packet->msg.message;
/* Get the Command instruction bits from the Message Header */
event = (uint8_t) GET_BITS8( hcp_message->msg_header,
HCP_MSG_INSTRUCTION_OFFSET, HCP_MSG_INSTRUCTION_LEN);
if( EVT_HOT_PLUG == event )
{
status = phHciNfc_Send_Admin_Event ( psHciContext, pHwRef,
EVT_HOT_PLUG, 0 ,NULL);
}
else
{
status = PHNFCSTVAL(CID_NFC_HCI, NFCSTATUS_INVALID_HCI_INSTRUCTION);
}
}
return status;
}
示例9: phHciNfc_Felica_Request_Mode
NFCSTATUS
phHciNfc_Felica_Request_Mode(
phHciNfc_sContext_t *psHciContext,
void *pHwRef)
{
NFCSTATUS status = NFCSTATUS_SUCCESS;
static uint8_t pres_chk_data[6] = {0};
if( (NULL == psHciContext) || (NULL == pHwRef) )
{
status = PHNFCSTVAL(CID_NFC_HCI, NFCSTATUS_INVALID_PARAMETER);
}
else
{
phHciNfc_Felica_Info_t *ps_fel_info = NULL;
phHciNfc_Pipe_Info_t *ps_pipe_info = NULL;
phHal_sFelicaInfo_t *ps_rem_fel_info = NULL;
ps_fel_info = (phHciNfc_Felica_Info_t *)
psHciContext->p_felica_info ;
ps_pipe_info = ps_fel_info->p_pipe_info;
if(NULL == ps_pipe_info )
{
status = PHNFCSTVAL(CID_NFC_HCI,
NFCSTATUS_INVALID_HCI_SEQUENCE);
}
else
{
ps_rem_fel_info =
&(ps_fel_info->felica_info.RemoteDevInfo.Felica_Info);
pres_chk_data[0] = sizeof(pres_chk_data);
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[5] = 0x00;
ps_pipe_info->param_info = pres_chk_data;
ps_pipe_info->param_length = sizeof(pres_chk_data);
status = phHciNfc_Send_Felica_Command(
psHciContext, pHwRef,
ps_pipe_info->pipe.pipe_id,
NXP_FELICA_RAW);
}
}
return status;
}
示例10: phHciNfc_Felica_Update_Info
NFCSTATUS
phHciNfc_Felica_Update_Info(
phHciNfc_sContext_t *psHciContext,
uint8_t infotype,
void *fel_info
)
{
NFCSTATUS status = NFCSTATUS_SUCCESS;
if (NULL == psHciContext)
{
status = PHNFCSTVAL(CID_NFC_HCI, NFCSTATUS_INVALID_PARAMETER);
}
else if(NULL == psHciContext->p_felica_info)
{
status = PHNFCSTVAL(CID_NFC_HCI, NFCSTATUS_FEATURE_NOT_SUPPORTED);
}
else
{
phHciNfc_Felica_Info_t *p_fel_info=NULL;
p_fel_info = (phHciNfc_Felica_Info_t *)
psHciContext->p_felica_info ;
switch(infotype)
{
case HCI_FELICA_ENABLE:
{
if (NULL != fel_info)
{
p_fel_info->enable_felica_gate =
*((uint8_t *)fel_info);
}
break;
}
case HCI_FELICA_INFO_SEQ:
{
p_fel_info->current_seq = FELICA_SYSTEMCODE;
p_fel_info->next_seq = FELICA_SYSTEMCODE;
break;
}
default:
{
status = PHNFCSTVAL(CID_NFC_HCI, NFCSTATUS_INVALID_PARAMETER);
break;
}
}
}
return status;
}
示例11: phHciNfc_ReaderB_Update_Info
NFCSTATUS
phHciNfc_ReaderB_Update_Info(
phHciNfc_sContext_t *psHciContext,
uint8_t infotype,
void *rdr_b_info
)
{
NFCSTATUS status = NFCSTATUS_SUCCESS;
if (NULL == psHciContext)
{
status = PHNFCSTVAL(CID_NFC_HCI, NFCSTATUS_INVALID_PARAMETER);
}
else if(NULL == psHciContext->p_reader_b_info)
{
status = PHNFCSTVAL(CID_NFC_HCI, NFCSTATUS_FEATURE_NOT_SUPPORTED);
}
else
{
phHciNfc_ReaderB_Info_t *ps_rdr_b_info=NULL;
ps_rdr_b_info = (phHciNfc_ReaderB_Info_t *)
psHciContext->p_reader_b_info ;
switch(infotype)
{
case HCI_READER_B_ENABLE:
{
if(NULL != rdr_b_info)
{
ps_rdr_b_info->enable_rdr_b_gate =
*((uint8_t *)rdr_b_info);
}
break;
}
case HCI_READER_B_INFO_SEQ:
{
ps_rdr_b_info->current_seq = RDR_B_PUPI;
ps_rdr_b_info->next_seq = RDR_B_PUPI;
break;
}
default:
{
status = PHNFCSTVAL(CID_NFC_HCI, NFCSTATUS_INVALID_PARAMETER);
break;
}
}
}
return status;
}
示例12: phFriNfc_NdefSmtCrd_ConvertToReadOnly
NFCSTATUS
phFriNfc_NdefSmtCrd_ConvertToReadOnly (
phFriNfc_sNdefSmtCrdFmt_t *NdefSmtCrdFmt)
{
NFCSTATUS result = PHNFCSTVAL(CID_FRI_NFC_NDEF_SMTCRDFMT,
NFCSTATUS_INVALID_PARAMETER);
uint8_t sak = 0;
if((NdefSmtCrdFmt != NULL)
&& (NdefSmtCrdFmt->CompletionRoutine->CompletionRoutine != NULL)
&& (NdefSmtCrdFmt->CompletionRoutine->Context != NULL))
{
sak = NdefSmtCrdFmt->psRemoteDevInfo->RemoteDevInfo.Iso14443A_Info.Sak;
switch (NdefSmtCrdFmt->psRemoteDevInfo->RemDevType)
{
case phHal_eMifare_PICC:
{
if (0x00 == sak)
{
result = phFriNfc_MfUL_ConvertToReadOnly (NdefSmtCrdFmt);
}
else
{
/* MIFARE classic 1k/4k is not supported */
result = PHNFCSTVAL(CID_FRI_NFC_NDEF_SMTCRDFMT,
NFCSTATUS_INVALID_REMOTE_DEVICE);
}
break;
}
case phHal_eISO14443_A_PICC:
{
result = phFriNfc_Desfire_ConvertToReadOnly (NdefSmtCrdFmt);
break;
}
default :
{
/* Remote device is not recognised.
Probably not NDEF compliant */
result = PHNFCSTVAL(CID_FRI_NFC_NDEF_SMTCRDFMT,
NFCSTATUS_INVALID_REMOTE_DEVICE);
break;
}
}
}
return result;
}
示例13: phHciNfc_ReaderA_Fwi_Sfgt
NFCSTATUS
phHciNfc_ReaderA_Fwi_Sfgt (
void *psHciHandle,
void *pHwRef
)
{
NFCSTATUS status = NFCSTATUS_SUCCESS;
phHciNfc_sContext_t *psHciContext = ((phHciNfc_sContext_t *)psHciHandle);
if( (NULL == psHciContext)
|| (NULL == pHwRef)
)
{
status = PHNFCSTVAL(CID_NFC_HCI, NFCSTATUS_INVALID_PARAMETER);
}
else if((NULL == psHciContext->p_reader_a_info) ||
(HCI_READER_A_ENABLE !=
((phHciNfc_ReaderA_Info_t *)(psHciContext->p_reader_a_info))->
enable_rdr_a_gate))
{
status = PHNFCSTVAL(CID_NFC_HCI, NFCSTATUS_FEATURE_NOT_SUPPORTED);
}
else
{
phHciNfc_ReaderA_Info_t *p_rdr_a_info=NULL;
phHciNfc_Pipe_Info_t *p_pipe_info=NULL;
uint8_t pipeid = 0;
p_rdr_a_info = (phHciNfc_ReaderA_Info_t *)
psHciContext->p_reader_a_info ;
p_pipe_info = p_rdr_a_info->p_pipe_info;
if(NULL == p_pipe_info )
{
status = PHNFCSTVAL(CID_NFC_HCI,
NFCSTATUS_INVALID_HCI_SEQUENCE);
}
else
{
p_pipe_info->reg_index = RDR_A_FWI_SFGT_INDEX;
pipeid = p_rdr_a_info->pipe_id ;
/* Fill the data buffer and send the command to the
device */
status =
phHciNfc_Send_Generic_Cmd( psHciContext, pHwRef,
pipeid, (uint8_t)ANY_GET_PARAMETER);
}
}
return status;
}
示例14: phHciNfc_Delete_Pipe
NFCSTATUS
phHciNfc_Delete_Pipe(
phHciNfc_sContext_t *psHciContext,
void *pHwRef,
phHciNfc_Pipe_Info_t *pPipeHandle
)
{
NFCSTATUS status=NFCSTATUS_SUCCESS;
NFCSTATUS cmd_status = NFCSTATUS_SUCCESS;
if( (NULL == psHciContext)
|| (NULL == pHwRef)
|| (NULL == pPipeHandle)
)
{
status = PHNFCSTVAL(CID_NFC_HCI, NFCSTATUS_INVALID_PARAMETER);
}
else
{
cmd_status = phHciNfc_Send_Admin_Cmd( psHciContext, pHwRef,
ADM_DELETE_PIPE, PIPEID_LEN, pPipeHandle );
status = ( (cmd_status == NFCSTATUS_PENDING)?
NFCSTATUS_SUCCESS : cmd_status);
}
return status;
}
示例15: phHciNfc_Close_Pipe
NFCSTATUS
phHciNfc_Close_Pipe(
phHciNfc_sContext_t *psHciContext,
void *pHwRef,
phHciNfc_Pipe_Info_t *pPipeHandle
)
{
uint8_t pipe_id = (uint8_t) HCI_UNKNOWN_PIPE_ID;
NFCSTATUS status = NFCSTATUS_SUCCESS;
NFCSTATUS cmd_status = NFCSTATUS_SUCCESS;
if( (NULL == psHciContext)
|| ( NULL == pHwRef )
|| ( NULL == pPipeHandle )
)
{
status = PHNFCSTVAL(CID_NFC_HCI, NFCSTATUS_INVALID_PARAMETER);
}
else
{
/* Obtain the pipe_id from the pipe_handle */
pipe_id = pPipeHandle->pipe.pipe_id;
if( (uint8_t)HCI_UNKNOWN_PIPE_ID > pipe_id)
{
cmd_status = phHciNfc_Send_Generic_Cmd(
psHciContext, pHwRef, pipe_id,
ANY_CLOSE_PIPE );
status = ((cmd_status == NFCSTATUS_PENDING)?
NFCSTATUS_SUCCESS : cmd_status);
}
}
return status;
}