LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

pc/sc Scardtransmit

hi,

I have a problem to interface pc/sc smartcard reader using pc/sc with the windscard.dll. The function ScardTransmit sends me an error message wrong parameter.

LONG SCardTransmit(
__in SCARDHANDLE hCard,
__in LPCSCARD_IO_REQUEST pioSendPci,
__in LPCBYTE pbSendBuffer,
__in DWORD cbSendLength,
__inout LPSCARD_IO_REQUEST pioRecvPci,
__out LPBYTE pbRecvBuffer,
__inout LPDWORD pcbRecvLength
);

 more detail in http://msdn.microsoft.com/en-us/library/aa379804.aspx. I don't try to pass a correct format for the 2 parameters. I have seen an old post about it, but without the final solution. 

 

typedef struct _SCARD_IO_REQUEST{
    DWORD dwProtocol;   // Protocol identifier
    DWORD cbPciLength;  // Protocol Control Information Length

} SCARD_IO_REQUEST, *PSCARD_IO_REQUEST, *LPSCARD_IO_REQUEST;

 

 Can you help me, please.

Thanks

emmanuel

 

0 Kudos
Message 1 of 51
(8,358 Views)

Dear Emmanuel,

 

Hope you are fine.

 


I have seen an old post about it, but without the final solution. 

I think you are mentioning about the post i involved in the discussion here.

 

What you have done till now? Post your work. That will help sorting out the problems easily. I think i might help you.

 

Mathan

0 Kudos
Message 2 of 51
(8,335 Views)

thank you for your rapidity,

So for the moment, i have the ScardListReadersA, the Scardestablishcontext,  Scardconnect and ScardStatus ok ( i have the ATR of my smartcard). But now, i don't understand how to  formate the input of the ScardTransmit ( i have the response wrong parameter 0x80100004).

I have seen your post, but i can't open the VI, because of my labview version.  So could you please send me pictue of your VI, and specially the structure of LPCSCARD_I0_REQUEST, and the different input using in the ScardTransmit.

 

thanks,

manu

0 Kudos
Message 3 of 51
(8,325 Views)

Hi Elmanou and Mathan,

 

I happen to find your post here, and realise that you guys were discussing the same issue that I am currently facing. Let me briefly explain what I had done so far. I manage to get the response from the smart card reader, same here, I stuck at the point on how to formate the input for SCarddTransmit. Please help, If possible please send me the vi or the print  screen which would be really helpful. I am reacable thru eitys@hotmail.com

 . Thank you so much

 

Best Regards,

Shien Eit.

0 Kudos
Message 4 of 51
(7,920 Views)

Hai all,

 

I did managed to made it work. But give me some hours. I need to search in my PC for the file and attach here in another 4 to 5 hours (that is at lunch time). Sorry for the delay.

 

Thanks,

Mathan

0 Kudos
Message 5 of 51
(7,905 Views)

Thanks Mathan,

 

Looking forward to your reply.

 

Best Regards,

Eit 

0 Kudos
Message 6 of 51
(7,902 Views)

Hai,

 

Am very sorry for the late reply. Unable to locate the file. I can do onething. I don't want to start again since i have no readers or cards to check with. So can you please post the vi you did as of now so that i can help you from there. I am sure we can sort out this.

 

Mathan

0 Kudos
Message 7 of 51
(7,879 Views)

Hi Mathan,

 

Attached is my VI,a read text sub-VI. With these VIs, I am able to get a ATR reply from the card reader. However, I have problem in formulate a correct input to the "SCardTransmit' CLN. There is always a error "6" return.

 

The commands to be input are as follow,

1.   


0x00

0xA4

0x04

0x00

 

 

0x00

2.

0x80

0xCA

0x9F

0x7F

 

 

0x2D

 

 

Kindly, give me a solution, many thanks.

 

Best Regards,

Eit 

Download All
0 Kudos
Message 8 of 51
(7,871 Views)

Hai Eit,

 

I have downloaded your vi's. Let me give me some time. Ill have a look at it and post before this evening.

0 Kudos
Message 9 of 51
(7,867 Views)

Hi Mathan,

 

How was my program, do you have any clue why the scardtransmit is not working? Hope to hear from you, thanks.

 

Eit. 

0 Kudos
Message 10 of 51
(7,839 Views)