0
我正在使用ACS閱讀器和NFC標籤進行c#PC/SC實現。SCardTrasmit返回空接收字節數組
我都在原型的SCardTransmit如下:
而且我有以下代碼:
SCard.SCARD_IO_REQUEST ioRequest = new SCard.SCARD_IO_REQUEST();
ioRequest.dwProtocol = Protocol; // Is going to be T=1
ioRequest.cbPciLength = 8;
byte[] cmdBytes = new byte[] { 0xFF, 0xCA, 0x00, 0x00, 0x00 };
byte[] rcvBytes = new byte[10];
int rcvLenght = 0;
retCode = SCard.SCardTransmit(Handle,
ref ioRequest, cmdBytes, cmdBytes.Length,
ref ioRequest, rcvBytes, out rcvLenght);
if (retCode != SCard.SCARD_S_SUCCESS)
throw new Exception("Failed querying tag UID: " + retCode);
所有的(未顯示)init'ing東西似乎工作正常,我可以成功獲取標籤的ATR。
現在,運行此代碼我得到一個成功的返回碼,我收到一致的接收字節長度值,但對應的字節數組爲空(零)。
任何人都可以對此提出建議?
謝謝。