嗨尤利西斯
谢谢您的回复。
是的,激活后我使用从tfalIsoDepDevice返回的参数
错误=
rfalIsoDepPollAHandleActivation(RFAL_COMPLIANCE_MODE_NFC_11,RFAL_ISODEP_FSXI_512,RFAL_ISODEP_NO_DID,RFAL_BR_424,
&安培; isoDepDevice
);
myParam.DID = RFAL_ISODEP_NO_DID;
//isoDepDevice.info.DID; //
myParam.FWT = isoDepDevice.info.FWT;
myParam.dFWT = isoDepDevice.info.dFWT;
myParam.FSx = isoDepDevice.info.FSx;
myParam.ourFSx = RFAL_ISODEP_FSX_KEEP;
myParam.txBuf =& apduCommand;
myParam.txBufLen = apduTxLen;
myParam.rxBufLen =& apduRxLen;
myParam.rxBuf =& apduResponse;在向卡发送第二个APDU时:
当我发送err = rfalIsoDepStartApduTransceive(myParam)时,我得到No error;
我使用'for'例程运行(35次。我后来将其更改为350次)以获得Transceive状态。
所以经过350次调用rfalWorker();和rfalIsoDepGetApduTransceiveStatus();
在350个循环后我仍然得到ERR_BUSY。 (我对第二个APDU命令的响应应该与我发送的第一个apdu命令的大小相同或更大)
我已经用HAL_Delay(1)的延迟改变了我的循环并且重试了2000(TIMEOUT = 2000)
for(int i = 0; i< TIMEOUT; i ++)
{
err = rfalIsoDepGetApduTransceiveStatus();
//检查APDU Transceive的状态
HAL_Delay(1);
//运行RFAL Worker
rfalWorker();
if(err == ERR_NONE)
{
logUsart('APDU Transceive Success r n');
rfalWorker();
HAL_Delay(1);
打破;
}
HAL_Delay(1);
if(err == ERR_BUSY)
{
// logUsart('。');
}
}
//用于循环结束
logUsart('AID接收缓冲区有%d字节 r n',apduRxLen);
if(apduRxLen> 0)
{
logUsart('Rx数据:%s r n',hex2Str(apduResponse.apdu,apduRxLen));
为了确保,我在发送第二个APDU命令之前在Param结构中再次编写了所有参数。
myParam.txBuf =& apduCommand; //& apduCommand;
myParam.txBufLen = apduTxLen;
myParam.rxBufLen =& apduRxLen;
myParam.rxBuf =& apduResponse;
myParam.DID = RFAL_ISODEP_NO_DID; // isoDepDevice.info.DID; //
myParam.FWT = isoDepDevice.info.FWT;
myParam.dFWT = isoDepDevice.info.dFWT;
myParam.FSx = isoDepDevice.info.FSx;
myParam.ourFSx = RFAL_ISODEP_FSX_KEEP;
但是仍然没有对第二个apdu命令做出响应(同样,我在时间问题的情况下从ERR_BUSY中删除了USART写入命令)但是仍然在ERR_BUSY上。
以上来自于谷歌翻译
以下为原文
HI Ulysses
Thank you for your reply.
Yes, After Activation I use the parameters returned from tfalIsoDepDevice
err =
rfalIsoDepPollAHandleActivation(RFAL_COMPLIANCE_MODE_NFC_11,RFAL_ISODEP_FSXI_512,RFAL_ISODEP_NO_DID,RFAL_BR_424,
&isoDepDevice
);
myParam.DID = RFAL_ISODEP_NO_DID;
//isoDepDevice.info.DID; //
myParam.FWT = isoDepDevice.info.FWT;
myParam.dFWT = isoDepDevice.info.dFWT;
myParam.FSx = isoDepDevice.info.FSx;
myParam.ourFSx = RFAL_ISODEP_FSX_KEEP ;
myParam.txBuf = &apduCommand;
myParam.txBufLen = apduTxLen;
myParam.rxBufLen = &apduRxLen;
myParam.rxBuf = &apduResponse;On Sending a Second APDU to the Card :
I get No error when I transmit err = rfalIsoDepStartApduTransceive(myParam);
I Use a 'for' routine that runs ( 35 times. I later changed it to 350 times) to get the Transceive status.
So after 350 times calling the rfalWorker(); and rfalIsoDepGetApduTransceiveStatus();
I still get ERR_BUSY after the 350 cycles. ( My response for the second APDU Command should be more or the same size as the first apdu command that I have sent)
I have changed my loop with a delay of HAL_Delay(1) and retries of 2000 ( TIMEOUT = 2000)
for (int i=0;i
{
err = rfalIsoDepGetApduTransceiveStatus();
//Check The Status of the APDU Transceive
HAL_Delay(1);
// Run the RFAL Worker
rfalWorker();
if (err == ERR_NONE)
{
logUsart('APDU Transceive Successrn');
rfalWorker();
HAL_Delay(1);
break;
}
HAL_Delay(1);
if (err == ERR_BUSY)
{
// logUsart('.');
}
}
// for loop end
logUsart('AID Receive Buffer have %d Bytesrn',apduRxLen);
if (apduRxLen > 0)
{
logUsart('Rx Data: %srn',hex2Str(apduResponse.apdu,apduRxLen));
}Just to be sure, I have written the all parameters again in the Param struct before sending the second APDU comand.
myParam.txBuf = &apduCommand;// &apduCommand;
myParam.txBufLen = apduTxLen;
myParam.rxBufLen = &apduRxLen;
myParam.rxBuf = &apduResponse;
myParam.DID = RFAL_ISODEP_NO_DID;//isoDepDevice.info.DID; //
myParam.FWT = isoDepDevice.info.FWT;
myParam.dFWT = isoDepDevice.info.dFWT;
myParam.FSx = isoDepDevice.info.FSx;
myParam.ourFSx = RFAL_ISODEP_FSX_KEEP ;
but still no response on the second apdu command, ( also,I removed the USART Write command from ERR_BUSY in case of timing issues) but stays on ERR_BUSY.