本文整理汇总了C++中PHNFCSTVAL函数的典型用法代码示例。如果您正苦于以下问题:C++ PHNFCSTVAL函数的具体用法?C++ PHNFCSTVAL怎么用?C++ PHNFCSTVAL使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了PHNFCSTVAL函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的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;
}
开发者ID:jamesyan84,项目名称:mt36k_android_4.0.4,代码行数:55,代码来源:phHciNfc_AdminMgmt.c
示例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;
}
开发者ID:hongjichen,项目名称:android_nxp-nci,代码行数:72,代码来源:phDnldNfc.c
示例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;
}
开发者ID:surya-yogi,项目名称:android_device_oneplus_oneplus3,代码行数:79,代码来源:phTmlNfc.c
示例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;
}
开发者ID:a161619,项目名称:linux_libnfc-nci,代码行数:73,代码来源:phDnldNfc.c
示例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;
}
开发者ID:ACSOP,项目名称:android_external_libnfc-nxp,代码行数:54,代码来源:phFriNfc_LlcpMac.c
示例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;
}
开发者ID:ACSOP,项目名称:android_external_libnfc-nxp,代码行数:53,代码来源:phHciNfc_RFReaderB.c
示例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;
}
开发者ID:ACSOP,项目名称:android_external_libnfc-nxp,代码行数:52,代码来源:phHciNfc_SWP.c
示例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;
}
开发者ID:jamesyan84,项目名称:mt36k_android_4.0.4,代码行数:56,代码来源:phHciNfc_AdminMgmt.c
示例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;
}
开发者ID:MIPS,项目名称:external-libnfc-nxp,代码行数:50,代码来源:phHciNfc_Felica.c
示例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;
}
开发者ID:MIPS,项目名称:external-libnfc-nxp,代码行数:49,代码来源:phHciNfc_Felica.c
示例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;
}
开发者ID:ACSOP,项目名称:android_external_libnfc-nxp,代码行数:49,代码来源:phHciNfc_RFReaderB.c
示例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;
}
开发者ID:jamesyan84,项目名称:mt36k_android_4.0.4,代码行数:48,代码来源:phFriNfc_SmtCrdFmt.c
示例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;
}
开发者ID:johnny,项目名称:CobraDroidBeta,代码行数:48,代码来源:phHciNfc_RFReaderA.c
示例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;
}
开发者ID:InsomniaAOSP,项目名称:platform_external_libnfc-nxp,代码行数:27,代码来源:phHciNfc_Pipe.c
示例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;
}
开发者ID:InsomniaAOSP,项目名称:platform_external_libnfc-nxp,代码行数:35,代码来源:phHciNfc_Pipe.c
示例16: phHciNfc_Recv_Iso_B_Packet
static
NFCSTATUS
phHciNfc_Recv_Iso_B_Packet(
phHciNfc_sContext_t *psHciContext,
uint8_t *pResponse,
#ifdef ONE_BYTE_LEN
uint8_t length
#else
uint16_t length
#endif
)
{
NFCSTATUS status = NFCSTATUS_SUCCESS;
uint8_t i = 1;
psHciContext->rx_index = HCP_HEADER_LEN;
/* command WR_XCHG_DATA: so give ISO 14443-4B data to the upper layer */
HCI_PRINT_BUFFER("ISO 14443-4B Bytes received", pResponse, length);
if(FALSE != pResponse[(length - i)])
{
status = PHNFCSTVAL(CID_NFC_HCI,
NFCSTATUS_RF_ERROR);
}
return status;
}
开发者ID:ACSOP,项目名称:android_external_libnfc-nxp,代码行数:25,代码来源:phHciNfc_RFReaderB.c
示例17: phFriNfc_LlcpMac_Nfcip_Activate
static
NFCSTATUS
phFriNfc_LlcpMac_Nfcip_Activate(
_Inout_ phFriNfc_LlcpMac_t *LlcpMac
)
{
NFCSTATUS status = NFCSTATUS_SUCCESS;
PH_LOG_LLCP_FUNC_ENTRY();
if(LlcpMac == NULL)
{
PH_LOG_LLCP_WARN_STR("Invalid 'LlcpMac' pointer");
status = PHNFCSTVAL(CID_FRI_NFC_LLCP_MAC, NFCSTATUS_INVALID_PARAMETER);
}
else
{
PH_LOG_LLCP_INFO_STR("Invoking LinkStatus_Cb with link state 'phFriNfc_LlcpMac_eLinkActivated'");
LlcpMac->LinkState = phFriNfc_LlcpMac_eLinkActivated;
LlcpMac->LinkStatus_Cb(LlcpMac->LinkStatus_Context,
LlcpMac->LinkState,
&LlcpMac->sConfigParam,
LlcpMac->PeerRemoteDevType);
}
PH_LOG_LLCP_INFO_X32MSG("Return:",status);
PH_LOG_LLCP_FUNC_EXIT();
return status;
}
开发者ID:tempbottle,项目名称:NFC-Class-Extension-Driver,代码行数:27,代码来源:phFriNfc_LlcpMacNfcip.c
示例18: phFriNfc_OvrHal_Connect
NFCSTATUS phFriNfc_OvrHal_Connect(phFriNfc_OvrHal_t *OvrHal,
phFriNfc_CplRt_t *CompletionInfo,
phHal_sRemoteDevInformation_t *RemoteDevInfo,
phHal_sDevInputParam_t *DevInputParam)
{
NFCSTATUS status = NFCSTATUS_PENDING;
/* Check the Input Parameters */
if((NULL == OvrHal) || (NULL == CompletionInfo) || (NULL == RemoteDevInfo) ||
(NULL == DevInputParam))
{
status = PHNFCSTVAL(CID_FRI_NFC_OVR_HAL ,NFCSTATUS_INVALID_PARAMETER);
}
else
{
phFriNfc_OvrHal_SetComplInfo(OvrHal, CompletionInfo, PH_FRINFC_OVRHAL_CON);
status = phHal4Nfc_Connect(
OvrHal->psHwReference,
RemoteDevInfo,
phFriNfc_OvrHal_CB_ConnectDisconnect,
(void *)OvrHal
);
}
return status;
}
开发者ID:jamesyan84,项目名称:mt36k_android_4.0.4,代码行数:27,代码来源:phFriNfc_OvrHal.c
示例19: phFriNfc_TopazDynamicFormat_ProcessWritingTermTlvBytes
static NFCSTATUS
phFriNfc_TopazDynamicFormat_ProcessWritingTermTlvBytes(phFriNfc_sNdefSmtCrdFmt_t* NdefSmtCrdFmt)
{
static const uint8_t c_expectedResponse[] =
{
PH_FRINFC_TOPAZ_TLV_TERM_T, /* Terminator TLV */
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* Rest of data bytes are zeros */
};
NFCSTATUS wStatus = NFCSTATUS_SUCCESS;
PH_LOG_NDEF_FUNC_ENTRY();
assert(NdefSmtCrdFmt != NULL);
if ((*NdefSmtCrdFmt->SendRecvLength != sizeof(c_expectedResponse)) ||
(0 != phOsalNfc_MemCompare(NdefSmtCrdFmt->SendRecvBuf,
(void*)c_expectedResponse,
sizeof(c_expectedResponse))))
{
PH_LOG_NDEF_WARN_STR("Unexpected response received. Formatting failed");
wStatus = PHNFCSTVAL(CID_FRI_NFC_NDEF_SMTCRDFMT, NFCSTATUS_FORMAT_ERROR);
}
else
{
PH_LOG_NDEF_INFO_STR("Successfully formatted dynamic Topaz card");
}
PH_LOG_NDEF_FUNC_EXIT();
return wStatus;
}
开发者ID:Microsoft,项目名称:NFC-Class-Extension-Driver,代码行数:31,代码来源:phFriNfc_TopazFormat.c
示例20: phFriNfc_TopazFormat_Format
NFCSTATUS
phFriNfc_TopazFormat_Format(phFriNfc_sNdefSmtCrdFmt_t* NdefSmtCrdFmt)
{
NFCSTATUS wStatus = NFCSTATUS_SUCCESS;
PH_LOG_NDEF_FUNC_ENTRY();
if (NdefSmtCrdFmt == NULL)
{
wStatus = PHNFCSTVAL(CID_FRI_NFC_NDEF_SMTCRDFMT, NFCSTATUS_INVALID_PARAMETER);
}
else
{
NdefSmtCrdFmt->State = 0;
phOsalNfc_SetMemory(&NdefSmtCrdFmt->AddInfo.Type1Info,
0,
sizeof(NdefSmtCrdFmt->AddInfo.Type1Info));
NdefSmtCrdFmt->AddInfo.Type1Info.CurrentBlock = 0x01;
NdefSmtCrdFmt->AddInfo.Type1Info.CurrentByte = 0;
wStatus = phFriNfc_TopazFormat_WriteByte(NdefSmtCrdFmt,
NdefSmtCrdFmt->AddInfo.Type1Info.CurrentBlock,
NdefSmtCrdFmt->AddInfo.Type1Info.CurrentByte,
c_staticTopazFormat[NdefSmtCrdFmt->AddInfo.Type1Info.CurrentByte]);
}
PH_LOG_NDEF_FUNC_EXIT();
return wStatus;
}
开发者ID:Microsoft,项目名称:NFC-Class-Extension-Driver,代码行数:31,代码来源:phFriNfc_TopazFormat.c
注:本文中的PHNFCSTVAL函数示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论