case SC_RESET_LOW:
if(SC_ADPU->Header.INS == SC_GET_A2R)
{
/* If card is detected then Power ON, Card Reset and wait for an answer) */
//if (SC_Detect())
if (SC_Detect()==0)
{
while(((*SCState) != SC_POWER_OFF) && ((*SCState) != SC_ACTIVE))
{
SC_AnswerReq(SCState, &SC_ATR_Table[0], 40); /* Check for answer to reset */
}
}
else
{
(*SCState) = SC_POWER_OFF;
}
}
我进到红色的那个函数里,参数是40个数据:
static void SC_AnswerReq(SC_State *SCState, uint8_t *card, uint8_t length)
{
uint8_t Data = 0;
uint32_t i = 0;
switch(*SCState)
{
case SC_RESET_LOW:
//GPIO_ResetBits(GPIOB, GPIO_Pin_15);
/* Check responce with reset low ---------------------------------------*/
for (i = 0; i < length; i++)
{
if((USART_ByteReceive(&Data, SC_RECEIVE_TIMEOUT)) == SUCCESS)
{
card = Data;
}
}
for (i = 0; i < length; i++)
{
USART_SendData(USART1,card); //在这里我把数据通过串口打印出来
for(ii=0;ii<3000;ii++);
}
while(1);
if(card[0])
{
(*SCState) = SC_ACTIVE;
SC_Reset(SC_Reset_H);
}
else
{
(*SCState) = SC_RESET_HIGH;
}
//GPIO_SetBits(GPIOB, GPIO_Pin_15);
break;
3B 1A 11 D1 00 33 00 53 49 4D 20 9F 16 00 00 00 00 00 00 00 00 00 00
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
四十个数据如上所示。苦于不知道什么意思。大神指教,有什么问题?谢谢!
|