Hello,
Actually Carlos and I were discussing this last night. I will probably get
rid of the SCardReadMemory and SCardWriteMemory functions and use the Mct
specs for communicating to the card. Basically the driver will be
responsible for everything. The IFD Handler will get the standard read
binary APDU but the driver will have to know what type of card it is
connected to. If the card is a processor card then it will send the T0/T1
command like usual. If the current card is I2c, 2wire, 3wire it must send
it appropriately. This will take no changes to the pcsc-lite API or
infrastructure since all the brains will be in the driver. The IFD Handler
must perform the IFD_Power_Icc which will detect the card type and set some
variable in the IFD Handler. When transmit calls come in it must look at
this card type variable to determine how to send the command. I hope this
makes sense.......
For the T=4 APDU what I will also do is make this a function of the IFD
Handler also. Instead of returnlength = send[4] + 2
I will look at the length of the command. If the command is the following:
c0 a4 00 00 02 3f 00 02
I will know there is a trailing byte for length. I will then take that as
the return length.
Let me know if this works for all of you and I will add that to the changes
for the next release.
Dave
***************************************************************
Linux Smart Card Developers - M.U.S.C.L.E.
(Movement for the Use of Smart Cards in a Linux Environment)
http://www.linuxnet.com/smartcard/index.html
***************************************************************