验证密码的这个函数返回-2 MI_ERR[mw_shl_code=c,true]PcdAuthState(PICC_AUTHENT1A, 1, DefaultKey, g_ucTempbuf);//验证卡片密码[/mw_shl_code]
单步调试发现是此函数下
[mw_shl_code=c,true]char PcdAuthState(unsigned char auth_mode,unsigned char addr,unsigned char *pKey,unsigned char *pSnr)
{
char status;
unsigned int unLen;
unsigned char i,ucComMF522Buf[MAXRLEN];
ucComMF522Buf[0] = auth_mode;
ucComMF522Buf[1] = addr;
// for (i=0; i<6; i++)
// { ucComMF522Buf[i+2] = *(pKey+i); }
// for (i=0; i<6; i++)
// { ucComMF522Buf[i+8] = *(pSnr+i); }
memcpy(&ucComMF522Buf[2], pKey, 6);
memcpy(&ucComMF522Buf[8], pSnr, 4);
status = PcdComMF522(PCD_AUTHENT,ucComMF522Buf,12,ucComMF522Buf,&unLen);
if ((status != MI_OK) || (!(ReadRawRC(Status2Reg) & 0x08)))
{
status = MI_ERR;
u4_printf("MI_ERR");
}
return status;
}[/mw_shl_code]
的[mw_shl_code=c,true](!(ReadRawRC(Status2Reg) & 0x08))[/mw_shl_code]这个没有成功
查看手册,没大明白哪里的问题
请帮忙看一看
一周热门 更多>