• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

C++ PH_CHECK_SUCCESS_FCT函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了C++中PH_CHECK_SUCCESS_FCT函数的典型用法代码示例。如果您正苦于以下问题:C++ PH_CHECK_SUCCESS_FCT函数的具体用法?C++ PH_CHECK_SUCCESS_FCT怎么用?C++ PH_CHECK_SUCCESS_FCT使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。



在下文中一共展示了PH_CHECK_SUCCESS_FCT函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。

示例1: phalMfp_SamAV2_X_WritePerso

phStatus_t phalMfp_SamAV2_X_WritePerso(
                                       phalMfp_SamAV2_X_DataParams_t * pDataParams,
                                       uint8_t bLayer4Comm,
                                       uint16_t wBlockNr,
                                       uint8_t * pValue
                                       )
{
    phStatus_t  PH_MEMLOC_REM status;
    phStatus_t  PH_MEMLOC_REM statusTmp;
    uint8_t     PH_MEMLOC_REM pEntryPair[2 + PHAL_MFP_MIFARE_BLOCK_SIZE];
    uint8_t     PH_MEMLOC_REM bResponseCode;

    /* Sam natively only supprots L4 WRITE Perso writing*/
    if (bLayer4Comm)
    {
        pEntryPair[0] = (uint8_t)(wBlockNr);
        pEntryPair[1] = (uint8_t)(wBlockNr >> 8);

        memcpy(&pEntryPair[2], pValue, PHAL_MFP_MIFARE_BLOCK_SIZE);  /* PRQA S 3200 */

        status = phhalHw_SamAV2_Cmd_MfpWritePerso(
            pDataParams->pHalDataParams,
            pEntryPair,
            2 + PHAL_MFP_MIFARE_BLOCK_SIZE,
            &bResponseCode);

        /* Convert HAL status codes to palMifare status codes */
        PH_CHECK_SUCCESS_FCT(statusTmp, phalMfp_SamAV2_X_ConvertNak(status));

        /* Check Card response*/
        PH_CHECK_SUCCESS_FCT(statusTmp, phalMfp_Int_ComputeErrorResponse(1, bResponseCode, bLayer4Comm));

    }
    else
    {
开发者ID:zhaohuizhang,项目名称:DanMan,代码行数:35,代码来源:phalMfp_SamAV2_X.c


示例2: phalVca_SamAV2_DeselectVc

phStatus_t phalVca_SamAV2_DeselectVc(
                                     phalVca_SamAV2_DataParams_t * pDataParams
                                     )
{
    /* local variables */
    phStatus_t  PH_MEMLOC_REM statusTmp;
    uint8_t     PH_MEMLOC_REM aCommand[1 /* command code */];
    uint8_t *   PH_MEMLOC_REM pResponse;
    uint16_t    PH_MEMLOC_REM wRxLength;

    /* command code */
    aCommand[0] = PHAL_VCA_CMD_DVC;

    /* command exchange */
    PH_CHECK_SUCCESS_FCT(statusTmp, phpalMifare_ExchangeL4(
        pDataParams->pPalMifareDataParams,
        PH_EXCHANGE_DEFAULT,
        aCommand,
        1,
        &pResponse,
        &wRxLength));

    /* check response */
    PH_CHECK_SUCCESS_FCT(statusTmp, phalVca_Int_ComputeErrorResponse(wRxLength, pResponse[0]));

    /* check response length */
    if (wRxLength != 1 /* STATUS */)
    {
        return PH_ADD_COMPCODE(PH_ERR_PROTOCOL_ERROR, PH_COMP_AL_VCA);
    }

    return PH_ADD_COMPCODE(PH_ERR_SUCCESS, PH_COMP_AL_VCA);
}
开发者ID:halilercikan,项目名称:DWMS,代码行数:33,代码来源:phalVca_SamAV2.c


示例3: phalVca_SamAV2_SelectVc

phStatus_t phalVca_SamAV2_SelectVc(
                                   phalVca_SamAV2_DataParams_t * pDataParams,
                                   uint16_t    wValidIidIndex,
                                   uint16_t wKeyNumber,                      
                                   uint16_t wKeyVersion
                                   )
{
    /* local variables */
    phStatus_t  PH_MEMLOC_REM status;
    phStatus_t  PH_MEMLOC_REM statusTmp;
    uint8_t     PH_MEMLOC_REM aCommand[9];
    uint8_t *   PH_MEMLOC_REM pResponse;
    uint16_t    PH_MEMLOC_REM wRxLength;

    status = phalVca_SamAV2_Int_ResolveValidIndex(
        pDataParams,
        wValidIidIndex,
        &wValidIidIndex);

    /* for the case of an overflow we always send the first random number to the SAM */
    if ((status  & PH_ERR_MASK) == PH_ERR_INVALID_PARAMETER)
    {
        wValidIidIndex = 0;
    }
    else
    {
        PH_CHECK_SUCCESS(status);
    }

    aCommand[0] = PHAL_VCA_CMD_SVC;

    /* Prepare Buffer */
    PH_CHECK_SUCCESS_FCT(statusTmp, phhalHw_SamAV2_Cmd_SAM_SelectVirtualCardMfp(
        pDataParams->pSamHal,
        (uint8_t)wKeyNumber,
        (uint8_t)wKeyVersion,
        &pDataParams->pRndq[wValidIidIndex * 12],
        NULL,
        0,
        &aCommand[1]));

    /* command exchange */
    PH_CHECK_SUCCESS_FCT(statusTmp, phpalMifare_ExchangeL4(
        pDataParams->pPalMifareDataParams,
        PH_EXCHANGE_DEFAULT,
        aCommand,
        9,
        &pResponse,
        &wRxLength));

    PH_CHECK_SUCCESS_FCT(statusTmp, phalVca_Int_ComputeErrorResponse(wRxLength, pResponse[0]));

    /* check response length */
    if (wRxLength != 1 /* STATUS */)
    {
        return PH_ADD_COMPCODE(PH_ERR_PROTOCOL_ERROR, PH_COMP_AL_VCA);
    }

    return PH_ADD_COMPCODE(PH_ERR_SUCCESS, PH_COMP_AL_VCA);
}
开发者ID:halilercikan,项目名称:DWMS,代码行数:60,代码来源:phalVca_SamAV2.c


示例4: phalVca_SamAV2_StartCardSelection

phStatus_t phalVca_SamAV2_StartCardSelection (
    phalVca_SamAV2_DataParams_t * pDataParams
    )
{
    phStatus_t  PH_MEMLOC_REM statusTmp;
    uint8_t     PH_MEMLOC_REM wIndex;

    /* Obtain Random Numbers */
    PH_CHECK_SUCCESS_FCT(statusTmp, phhalHw_SamAV2_Cmd_SAM_GetChallenge(pDataParams->pSamHal, (uint8_t)(12 * pDataParams->wNumCardTableEntries), pDataParams->pRndq));

    /* Send the complete stream to the SAM */
    PH_CHECK_SUCCESS_FCT(statusTmp, phhalHw_SamAV2_Cmd_SAM_VirtualCardSupportMfp(
        pDataParams->pSamHal, 
        PH_EXCHANGE_BUFFER_FIRST,
        NULL,
        0,
        NULL,
        0,
        NULL,
        NULL));

    pDataParams->wCurrentCardTablePos = 0;
    for (wIndex = 0; wIndex <  pDataParams->wNumCardTableEntries; ++wIndex)
    {
        pDataParams->pCardTable[wIndex].bNumKeyDuos = 0;
        pDataParams->pCardTable[wIndex].wIidIndex = 0xFF;
    }

    return PH_ADD_COMPCODE(PH_ERR_SUCCESS, PH_COMP_AL_VCA);
}
开发者ID:halilercikan,项目名称:DWMS,代码行数:30,代码来源:phalVca_SamAV2.c


示例5: phKeyStore_Sw_GetKey

phStatus_t phKeyStore_Sw_GetKey(
                                phKeyStore_Sw_DataParams_t * pDataParams,    
                                uint16_t wKeyNo,
                                uint16_t wKeyVersion,
                                uint8_t bKeyBufSize,
                                uint8_t * pKey,
                                uint16_t * pKeyType
                                )
{
    phStatus_t statusTmp;
	uint16_t wKeySize;
    phKeyStore_Sw_KeyVersionPair_t * pKeyVersion;
    PH_CHECK_SUCCESS_FCT(statusTmp, phKeyStore_Sw_GetKeyValuePtrVersion(pDataParams,wKeyNo,wKeyVersion,&pKeyVersion));

    /* Check for Counter overflow */
    PH_CHECK_SUCCESS_FCT(statusTmp, phKeyStore_Sw_CheckUpdateKUC(pDataParams,pDataParams->pKeyEntries[wKeyNo].wRefNoKUC));

	/* check buffer size */
	wKeySize = phKeyStore_GetKeySize(pDataParams->pKeyEntries[wKeyNo].wKeyType);
    if (bKeyBufSize < wKeySize)
    {
        return PH_ADD_COMPCODE(PH_ERR_BUFFER_OVERFLOW, PH_COMP_KEYSTORE);
    }
	/* copy the key */
    memcpy(pKey, pKeyVersion->pKey, wKeySize); /* PRQA S 3200 */

	*pKeyType = pDataParams->pKeyEntries[wKeyNo].wKeyType;
    return PH_ADD_COMPCODE(PH_ERR_SUCCESS, PH_COMP_KEYSTORE);
}
开发者ID:idodoyo,项目名称:nxprdlib,代码行数:29,代码来源:phKeyStore_Sw.c


示例6: readSector

phStatus_t readSector(uint8_t sector_id, uint8_t * key, uint8_t key_type, uint8_t * bUid, uint8_t * data) {
  uint8_t block = sector_id << 2;
  PH_CHECK_SUCCESS_FCT(status,
      phhalHw_MfcAuthenticate(&hal, block, key_type, key, bUid));
  PH_CHECK_SUCCESS_FCT(status, phalMfc_Read(&alMfc, block + 0, &data[0 * 16]));
  PH_CHECK_SUCCESS_FCT(status, phalMfc_Read(&alMfc, block + 1, &data[1 * 16]));
  PH_CHECK_SUCCESS_FCT(status, phalMfc_Read(&alMfc, block + 2, &data[2 * 16]));
  PH_CHECK_SUCCESS_FCT(status, phalMfc_Read(&alMfc, block + 3, &data[3 * 16]));
  return PH_ERR_SUCCESS;
}
开发者ID:TurpIF,项目名称:pi-nfc,代码行数:10,代码来源:old.c


示例7: search_card

phStatus_t search_card(uint8_t * pUid, uint8_t * pLength, uint8_t * pSak, uint8_t * pNbCards) {
  PH_CHECK_SUCCESS_FCT(status, phhalHw_FieldReset(&hal));

  PH_CHECK_SUCCESS_FCT(status, phhalHw_ApplyProtocolSettings(&hal,
        PHHAL_HW_CARDTYPE_ISO14443A));

  PH_CHECK_SUCCESS_FCT(status, phpalI14443p3a_ActivateCard(&palI14443p3a, NULL, 0x00, pUid,
      pLength, pSak, pNbCards));

  return PH_ERR_SUCCESS;
}
开发者ID:TurpIF,项目名称:pi-nfc,代码行数:11,代码来源:old.c


示例8: phalMfc_Sw_RestoreTransfer

phStatus_t phalMfc_Sw_RestoreTransfer(
                                      phalMfc_Sw_DataParams_t * pDataParams,
                                      uint8_t bSrcBlockNo,
                                      uint8_t bDstBlockNo                                  
                                      )
{
    phStatus_t PH_MEMLOC_REM statusTmp;
    PH_CHECK_SUCCESS_FCT(statusTmp, phalMfc_Sw_Restore(pDataParams, bSrcBlockNo));
    PH_CHECK_SUCCESS_FCT(statusTmp, phalMfc_Sw_Transfer(pDataParams, bDstBlockNo));

    return PH_ADD_COMPCODE(PH_ERR_SUCCESS, PH_COMP_AL_MFC);
}
开发者ID:idodoyo,项目名称:nxprdlib,代码行数:12,代码来源:phalMfc_Sw.c


示例9: phalI15693_Sw_WriteSingleBlock

phStatus_t phalI15693_Sw_WriteSingleBlock(
    phalI15693_Sw_DataParams_t * pDataParams,
    uint8_t bOption,
    uint8_t bBlockNo,
    uint8_t * pTxBuffer,
    uint16_t wTxLength
    )
{
    phStatus_t  PH_MEMLOC_REM statusTmp;
    phStatus_t  PH_MEMLOC_REM status;
    uint8_t     PH_MEMLOC_REM bCommand[2];
    uint8_t *   PH_MEMLOC_REM pRxBuffer;
    uint16_t    PH_MEMLOC_REM bRxLength;

    /* Build command */
    bCommand[0] = PHAL_I15693_SW_CMD_WRITE_SINGLE_BLOCK;
    bCommand[1] = bBlockNo;

    /* Set or clear the flags option bit indicated by bOption. */
    PH_CHECK_SUCCESS_FCT(statusTmp, phalI15693_Sw_Int_SetOptionBit(pDataParams, bOption));

    /* Set long timeout. */
    PH_CHECK_SUCCESS_FCT(statusTmp, phpalSli15693_SetConfig(
        pDataParams->pPalSli15693DataParams,
        PHPAL_SLI15693_CONFIG_TIMEOUT_US,
        PHPAL_SLI15693_TIMEOUT_LONG_US));

    /* Proceed with the command in lower layers */
    PH_CHECK_SUCCESS_FCT(statusTmp, phpalSli15693_Exchange(
        pDataParams->pPalSli15693DataParams,
        PH_EXCHANGE_BUFFER_FIRST,
        bCommand,
        2,
        NULL,
        NULL));

    /* Append given data */
    status = phpalSli15693_Exchange(
        pDataParams->pPalSli15693DataParams,
        PH_EXCHANGE_BUFFER_LAST,
        pTxBuffer,
        wTxLength,
        &pRxBuffer,
        &bRxLength);

    /* Write-alike handling */
    if (bOption != PHAL_I15693_OPTION_OFF)
    {
        return phalI15693_Sw_WriteAlikeHandling(pDataParams, status);
    }

    return status;
}
开发者ID:zhaohuizhang,项目名称:DanMan,代码行数:53,代码来源:phalI15693_Sw.c


示例10: phalI15693_Sw_ReadSingleBlock

phStatus_t phalI15693_Sw_ReadSingleBlock(
    phalI15693_Sw_DataParams_t * pDataParams,
    uint8_t bOption,
    uint8_t bBlockNo,
    uint8_t ** ppRxBuffer,
    uint16_t * pRxLength
    )
{
    phStatus_t  PH_MEMLOC_REM statusTmp;
    uint8_t     PH_MEMLOC_REM bCommand[2];

    /* Build command */
    bCommand[0] = PHAL_I15693_SW_CMD_READ_SINGLE_BLOCK;
    bCommand[1] = bBlockNo;

    /* Set or clear the flags option bit indicated by bOption. */
    PH_CHECK_SUCCESS_FCT(statusTmp, phalI15693_Sw_Int_SetOptionBit(pDataParams, bOption));

    /* Set short timeout. */
    PH_CHECK_SUCCESS_FCT(statusTmp, phpalSli15693_SetConfig(
        pDataParams->pPalSli15693DataParams,
        PHPAL_SLI15693_CONFIG_TIMEOUT_US,
        PHPAL_SLI15693_TIMEOUT_SHORT_US));

    /* Proceed with the command in lower layers */
    PH_CHECK_SUCCESS_FCT(statusTmp, phpalSli15693_Exchange(
        pDataParams->pPalSli15693DataParams,
        PH_EXCHANGE_DEFAULT,
        bCommand,
        2,
        ppRxBuffer,
        pRxLength));

    /* Length check */
    if (bOption != PHAL_I15693_OPTION_OFF)
    {
        if (*pRxLength < 2)
        {
            return PH_ADD_COMPCODE(PH_ERR_PROTOCOL_ERROR, PH_COMP_AL_I15693);
        }
    }
    else
    {
        if (*pRxLength == 0)
        {
            return PH_ADD_COMPCODE(PH_ERR_PROTOCOL_ERROR, PH_COMP_AL_I15693);
        }
    }

    return PH_ADD_COMPCODE(PH_ERR_SUCCESS, PH_COMP_AL_I15693);
}
开发者ID:zhaohuizhang,项目名称:DanMan,代码行数:51,代码来源:phalI15693_Sw.c


示例11: phalI15693_Sw_GetMultipleBlockSecurityStatus

phStatus_t phalI15693_Sw_GetMultipleBlockSecurityStatus(
    phalI15693_Sw_DataParams_t * pDataParams,
    uint8_t bBlockNo,
    uint16_t wNumBlocks,
    uint8_t ** ppRxBuffer,
    uint16_t * pRxLength
    )
{
    phStatus_t  PH_MEMLOC_REM statusTmp;
    uint8_t     PH_MEMLOC_REM bCommand[3];

    /* Number of wNumBlocks can't be zero */
    if (wNumBlocks == 0)
    {
        return PH_ADD_COMPCODE(PH_ERR_INVALID_PARAMETER, PH_COMP_AL_I15693);
    }

    /* adjust number of blocks. */
    --wNumBlocks;

    /* Check number of blocks doesn't exceed 256 */
    if (((uint16_t)bBlockNo + wNumBlocks) >= 0x100)
    {
        return PH_ADD_COMPCODE(PH_ERR_INVALID_PARAMETER, PH_COMP_AL_I15693);
    }

    /* Clear Option bit */
    PH_CHECK_SUCCESS_FCT(statusTmp, phalI15693_Sw_Int_SetOptionBit(pDataParams, PHAL_I15693_OPTION_OFF));

    /* Build command */
    bCommand[0] = PHAL_I15693_SW_CMD_GET_MULTIPLE_BLOCK_SEC;
    bCommand[1] = bBlockNo;
    bCommand[2] = (uint8_t)wNumBlocks;

    /* Set short timeout. */
    PH_CHECK_SUCCESS_FCT(statusTmp, phpalSli15693_SetConfig(
        pDataParams->pPalSli15693DataParams,
        PHPAL_SLI15693_CONFIG_TIMEOUT_US,
        PHPAL_SLI15693_TIMEOUT_SHORT_US));

    /* Proceed with the command in lower layers */
    PH_CHECK_SUCCESS_FCT(statusTmp, phpalSli15693_Exchange(
        pDataParams->pPalSli15693DataParams,
        PH_EXCHANGE_DEFAULT,
        bCommand,
        3,
        ppRxBuffer,
        pRxLength));

    return PH_ADD_COMPCODE(PH_ERR_SUCCESS, PH_COMP_AL_I15693);
}
开发者ID:zhaohuizhang,项目名称:DanMan,代码行数:51,代码来源:phalI15693_Sw.c


示例12: phCryptoRng_Sw_Reseed

phStatus_t phCryptoRng_Sw_Reseed(
                                 phCryptoRng_Sw_DataParams_t * pDataParams,
                                 uint8_t * pEntropyInput,                  
                                 uint16_t wEntropyInputLength,             
                                 uint8_t * pAdditionalInput,                         
                                 uint8_t bAdditionalInputLength        
                                 )
{
    phStatus_t  PH_MEMLOC_REM statusTmp;
    uint8_t     PH_MEMLOC_REM aSeedMaterial[PHCRYPTORNG_SW_SEEDLEN];

    /* Check for operational state */
    if (pDataParams->bState != PHCRYPTORNG_SW_STATE_WORKING)
    {
        return PH_ADD_COMPCODE(PH_ERR_USE_CONDITION, PH_COMP_CRYPTORNG);
    }

    /* Comment: Ensure that the length of the seed_material is exactly seedlen bits. */
    if (PHCRYPTORNG_SW_SEEDLEN != (wEntropyInputLength + bAdditionalInputLength))
    {
        return PH_ADD_COMPCODE(PH_ERR_INVALID_PARAMETER, PH_COMP_CRYPTORNG);
    }

    /* Prepare seed Material */
    /* 1. seed_material = entropy_input || additional_input. */
    memcpy(aSeedMaterial, pEntropyInput, wEntropyInputLength); /* PRQA S 3200 */
    memcpy(&aSeedMaterial[wEntropyInputLength], pAdditionalInput, bAdditionalInputLength); /* PRQA S 3200 */

    /* Encrypt the seed value */
    /* 2. seed_material = Block_Cipher_df (seed_material, seedlen). */
    PH_CHECK_SUCCESS_FCT(statusTmp, phCryptoRng_Sw_BlockCipherDf(
        pDataParams,
        aSeedMaterial));

    /* Update using aSeedMaterial as the personalization string. */
    /* 3. (Key, V) = Update (seed_material, Key, V). */
    PH_CHECK_SUCCESS_FCT(statusTmp, phCryptoRng_Sw_Update(pDataParams, aSeedMaterial));

    /* Set the counter again to 1. */
    /* 4. reseed_counter = 1. */    
    pDataParams->dwRequestCounter = 1;
    
    /* 5. Return V, Key, and reseed_counter as the new_working_state. */

    /* Clear seed material for security reasons */
    memset(aSeedMaterial, 0x00, sizeof(aSeedMaterial));  /* PRQA S 3200 */

    return PH_ADD_COMPCODE(PH_ERR_SUCCESS, PH_COMP_CRYPTORNG);
}
开发者ID:zhaohuizhang,项目名称:DanMan,代码行数:49,代码来源:phCryptoRng_Sw.c


示例13: phKeyStore_Rc632_SetFullKeyEntry

phStatus_t phKeyStore_Rc632_SetFullKeyEntry(
    phKeyStore_Rc632_DataParams_t * pDataParams,
    uint16_t wNoOfKeys,
    uint16_t wKeyNo,
    uint16_t wNewRefNoKUC,
    uint16_t wNewKeyType,
    uint8_t * pNewKeys,
    uint16_t * pNewKeyVersionList
    )
{
    phStatus_t  PH_MEMLOC_REM statusTmp;
    uint16_t    PH_MEMLOC_REM wKeyVersion = 0;
    uint16_t    PH_MEMLOC_COUNT i;

    /* satisfy compiler */
    if (pNewKeyVersionList || wNewRefNoKUC);

    /* check wNoOfKeys */
    if (wNoOfKeys > PH_KEYSTORE_RC632_NUM_VERSIONS)
    {
        return PH_ADD_COMPCODE(PH_ERR_INVALID_PARAMETER, PH_COMP_KEYSTORE);
    }

    /* set keys */
    for (i = 0; i < wNoOfKeys; ++i)
    {
        PH_CHECK_SUCCESS_FCT(statusTmp, phKeyStore_Rc632_SetKeyAtPos(pDataParams, wKeyNo,  i, wNewKeyType, &pNewKeys[i*PH_KEYSTORE_KEY_TYPE_MIFARE_SIZE], wKeyVersion));
    }

    return PH_ADD_COMPCODE(PH_ERR_SUCCESS, PH_COMP_KEYSTORE);
}
开发者ID:GeorgN,项目名称:RealTime-NFC-Reader,代码行数:31,代码来源:phKeyStore_Rc632.c


示例14: phalVca_SamAV2_GetIidInfo

phStatus_t phalVca_SamAV2_GetIidInfo(
                                     phalVca_SamAV2_DataParams_t * pDataParams,
                                     uint16_t wValidIidIndex,
                                     uint16_t * pIidIndex,
                                     uint8_t * pVcUidSize,
                                     uint8_t * pVcUid,
                                     uint8_t * pInfo,
                                     uint8_t * pPdCapabilities
                                     )
{
    phStatus_t PH_MEMLOC_REM statusTmp;

    PH_CHECK_SUCCESS_FCT(statusTmp, phalVca_SamAV2_Int_ResolveValidIndex(
        pDataParams,
        wValidIidIndex,
        &wValidIidIndex));

    *pIidIndex = pDataParams->pCardTable[wValidIidIndex].wIidIndex;
    *pInfo = pDataParams->pCardTable[wValidIidIndex].pCardData[0];
    pPdCapabilities[0] = pDataParams->pCardTable[wValidIidIndex].pCardData[1];
    pPdCapabilities[1] = pDataParams->pCardTable[wValidIidIndex].pCardData[2];

    if (*pInfo & 0x80)
    {
        *pVcUidSize = 4;
        memcpy(pVcUid, &pDataParams->pCardTable[wValidIidIndex].pCardData[3], 4);  /* PRQA S 3200 */
    }
    else
    {
        *pVcUidSize = 7;
        memcpy(pVcUid, &pDataParams->pCardTable[wValidIidIndex].pCardData[3], 7);  /* PRQA S 3200 */
    }

    return PH_ADD_COMPCODE(PH_ERR_SUCCESS, PH_COMP_AL_VCA);
}
开发者ID:halilercikan,项目名称:DWMS,代码行数:35,代码来源:phalVca_SamAV2.c


示例15: phKeyStore_Sw_GetKeyEntry

phStatus_t phKeyStore_Sw_GetKeyEntry(
                                     phKeyStore_Sw_DataParams_t * pDataParams,    
                                     uint16_t wKeyNo,
                                     uint16_t wKeyVersionBufSize,
                                     uint16_t * wKeyVersion,
                                     uint16_t * wKeyVersionLength,
                                     uint16_t * pKeyType
                                     )
{
    phStatus_t statusTmp;
    uint16_t i;
    phKeyStore_Sw_KeyVersionPair_t * pKeyVersion;

    /* Check for overflow */
    if (wKeyVersionBufSize < (sizeof(uint16_t) * pDataParams->wNoOfVersions))
    {
        return PH_ADD_COMPCODE(PH_ERR_BUFFER_OVERFLOW, PH_COMP_KEYSTORE);
    }

    for (i = 0; i < pDataParams->wNoOfVersions; i++)
    {
        PH_CHECK_SUCCESS_FCT(statusTmp, phKeyStore_Sw_GetKeyValuePtrPos(pDataParams,wKeyNo,i,&pKeyVersion));
        wKeyVersion[i] = pKeyVersion->wVersion;
    }
    *wKeyVersionLength = pDataParams->wNoOfVersions;
    *pKeyType = pDataParams->pKeyEntries[wKeyNo].wKeyType;

    return PH_ADD_COMPCODE(PH_ERR_SUCCESS, PH_COMP_KEYSTORE);
}
开发者ID:idodoyo,项目名称:nxprdlib,代码行数:29,代码来源:phKeyStore_Sw.c


示例16: phKeyStore_Sw_SetKeyAtPos

phStatus_t phKeyStore_Sw_SetKeyAtPos(
                                     phKeyStore_Sw_DataParams_t * pDataParams,
                                     uint16_t wKeyNo,
                                     uint16_t wPos,
                                     uint16_t wKeyType,
                                     uint8_t * pNewKey,
                                     uint16_t wNewKeyVersion
                                     )
{

    phStatus_t statusTmp;
    phKeyStore_Sw_KeyVersionPair_t * pKeyVersion;
    PH_CHECK_SUCCESS_FCT(statusTmp, phKeyStore_Sw_GetKeyValuePtrPos(pDataParams,wKeyNo,wPos,&pKeyVersion));

    /* Check that Key type matches with current Key Type format */
    if (pDataParams->pKeyEntries[wKeyNo].wKeyType != wKeyType)
	{
        return PH_ADD_COMPCODE(PH_ERR_INVALID_PARAMETER, PH_COMP_KEYSTORE);
	}

	/* copy the key and version */
    memcpy(pKeyVersion->pKey, pNewKey, phKeyStore_GetKeySize(wKeyType)); /* PRQA S 3200 */
    pKeyVersion->wVersion = wNewKeyVersion;

    return PH_ADD_COMPCODE(PH_ERR_SUCCESS, PH_COMP_KEYSTORE);
}
开发者ID:idodoyo,项目名称:nxprdlib,代码行数:26,代码来源:phKeyStore_Sw.c


示例17: forceReadSector

phStatus_t forceReadSector(uint8_t sector_id, uint8_t ** keys, uint16_t nbKeys, uint8_t * data) {
  uint8_t bSak[1];
  uint8_t bUid[10];
  uint8_t bNbCards;
  uint8_t bLength;
  uint16_t i;
  PH_CHECK_SUCCESS_FCT(status, search_card(bUid, &bLength, bSak, &bNbCards));
  for (i = 0; i < nbKeys; i++) {
    if (readSector(sector_id, keys[i], PHAL_MFC_KEYA, bUid, data) == PH_ERR_SUCCESS)
      return PH_ERR_SUCCESS;
    PH_CHECK_SUCCESS_FCT(status, search_card(bUid, &bLength, bSak, &bNbCards));
    if (readSector(sector_id, keys[i], PHAL_MFC_KEYB, bUid, data) == PH_ERR_SUCCESS)
      return PH_ERR_SUCCESS;
    PH_CHECK_SUCCESS_FCT(status, search_card(bUid, &bLength, bSak, &bNbCards));
  }
  return PH_ERR_AUTH_ERROR;
}
开发者ID:TurpIF,项目名称:pi-nfc,代码行数:17,代码来源:old.c


示例18: phalI15693_Sw_Int_SetOptionBit

phStatus_t phalI15693_Sw_Int_SetOptionBit(
    phalI15693_Sw_DataParams_t * pDataParams,
    uint8_t bOption
    )
{
    phStatus_t  PH_MEMLOC_REM statusTmp;
    uint16_t    PH_MEMLOC_REM wFlagsCurrent;
    uint16_t    PH_MEMLOC_REM wFlagsNew;

    /* Next check if the Option Byte has a valid value */
    if ((bOption != PHAL_I15693_OPTION_OFF) &&(bOption != PHAL_I15693_OPTION_ON))
    {
        return PH_ADD_COMPCODE(PH_ERR_INVALID_PARAMETER, PH_COMP_AL_I15693);
    }

    /* retrieve the flags byte */
    PH_CHECK_SUCCESS_FCT(statusTmp, phpalSli15693_GetConfig(
        pDataParams->pPalSli15693DataParams,
        PHPAL_SLI15693_CONFIG_FLAGS,
        &wFlagsCurrent));

    /* Set Option bit */
    if (bOption != PHAL_I15693_OPTION_OFF)
    {
        wFlagsNew = wFlagsCurrent | PHPAL_SLI15693_FLAG_OPTION;
    }
    /* Clear option bit */
    else
    {
        wFlagsNew = wFlagsCurrent &(uint8_t)~(uint8_t)PHPAL_SLI15693_FLAG_OPTION;
    }

    /* update the flags byte */
    if (wFlagsNew != wFlagsCurrent)
    {
        PH_CHECK_SUCCESS_FCT(statusTmp, phpalSli15693_SetConfig(
            pDataParams->pPalSli15693DataParams,
            PHPAL_SLI15693_CONFIG_FLAGS,
            wFlagsNew));
    }

    return PH_ADD_COMPCODE(PH_ERR_SUCCESS, PH_COMP_AL_I15693);
}
开发者ID:zhaohuizhang,项目名称:DanMan,代码行数:43,代码来源:phalI15693_Sw.c


示例19: phalVca_Sw_ProximityCheck

phStatus_t phalVca_Sw_ProximityCheck(
                                     phalVca_Sw_DataParams_t * pDataParams,
                                     uint8_t     bGenerateRndC,
                                     uint8_t*    pRndC, 
                                     uint8_t     bPps1,
                                     uint8_t     bNumSteps,
                                     uint16_t    wKeyNumber,        
                                     uint16_t    wKeyVersion, 
                                     uint8_t * pUsedRndRC
                                     )
{
    phStatus_t  PH_MEMLOC_REM statusTmp;

    PH_CHECK_SUCCESS_FCT(statusTmp, phalVca_Sw_Cmd_PrepareProximityCheck(pDataParams));

    PH_CHECK_SUCCESS_FCT(statusTmp, phalVca_Sw_Cmd_ProximityCheck(pDataParams, bGenerateRndC, pRndC, bNumSteps, pUsedRndRC));

    return (phalVca_Sw_Cmd_VerifyProximityCheck(pDataParams, pUsedRndRC, bPps1, wKeyNumber, wKeyVersion));
}
开发者ID:halilercikan,项目名称:DWMS,代码行数:19,代码来源:phalVca_Sw.c


示例20: phhalHw_Pn512_Cmd_GenerateRandomId

phStatus_t phhalHw_Pn512_Cmd_GenerateRandomId(
        phhalHw_Pn512_DataParams_t * pDataParams
)
    {
    phStatus_t  PH_MEMLOC_REM statusTmp;
    uint8_t     PH_MEMLOC_REM bIrq0WaitFor = 0x0;
    uint8_t     PH_MEMLOC_REM bIrq1WaitFor = 0x0;
    uint8_t		PH_MEMLOC_REM bIrq0Rq;
    uint8_t		PH_MEMLOC_REM bIrq1Rq;

    /* start the command */
    PH_CHECK_SUCCESS_FCT(statusTmp, phhalHw_WriteRegister(pDataParams, PHHAL_HW_PN512_REG_COMMAND, PHHAL_HW_PN512_CMD_RANDOMIDS));

    /* wait until the command is finished */
    bIrq0WaitFor = PHHAL_HW_PN512_BIT_IDLEI;
    PH_CHECK_SUCCESS_FCT(statusTmp, phhalHw_Pn512_WaitIrq(pDataParams, bIrq0WaitFor,bIrq1WaitFor,&bIrq0Rq,&bIrq1Rq));

    return PH_ADD_COMPCODE(PH_ERR_SUCCESS, PH_COMP_HAL);
    }
开发者ID:VladiPeled,项目名称:NXP-EXPLORE-NFC-CardEmulation,代码行数:19,代码来源:phhalHw_Pn512_Cmd.c



注:本文中的PH_CHECK_SUCCESS_FCT函数示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C++ PH_GET_COMPCODE函数代码示例发布时间:2022-05-30
下一篇:
C++ PH_ASSERT_NULL函数代码示例发布时间:2022-05-30
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap