> On Tue, Jan 16, 2001 at 10:10:13AM -0000, Guillaume LAISNEY wrote:
> > You can access any memory card thru PCSC-lite sending APDU-like 
commands with SCardTransmit and ISO commands (look at ISO 7816-4).
> > Check that your reader's driver is compliant with the card you want to 
access to. If so, you can read/write bytes by sending these commands:
> Well, I think I'm sending Data correctly, but I always get the response
> "6e 00". :-( Nothing happens.
>
> A short example:
> BYTE s[7], r[10];
> s[0] = 0x00;s[1] = 0xA4;
> s[2] = 0x00;s[3] = 0x00;
> s[4] = 0x02;s[5] = 0x3f;
> s[6] = 0x00;
>
> rv=SCardBeginTransaction(hCard);
> rv=SCardTransmit(hCard,SCARD_PCI_RAW, s, 
dwSendLength,&sSendPci,r,&pcbRecvLength);
> for (int i=0; i<pcbRecvLength;i++)
>   printf("%02X ",r[i]);
>
> Having a look at the "Towitoko CT-API tester utility", I would expect "90
> 00" instead. BTW, SCARD_PCI_T0 and SCARD_PCI_T1 fail.
>
> Any ideas?
>
> --
> CU,
>    Patrick.
> "Never run on auto-pilot" - The Pragmatic Programmer
> << Fichier: ATT00001.att>>


Maybe you could try this to select master file:


 s[0] = 0x00;   s[1] = 0xA4;
 s[2] = 0x00;   s[3] = 0x00;
 s[4] = 0x02;   s[5] = 0x3f;
 s[6] = 0x00;
 dwSendLength = 7;
 dwRecvLength = s[4];

 rv = SCardTransmit( hCard, SCARD_PCI_RAW, s, dwSendLength, &sRecvPci, 
r,&dwRecvLength );


then, for exemple to read some piece of data:



s[0] = 0x00;   s[1] = 0xB0;
  s[2] = (unsigned char)(adresse>>8);   s[3] = (unsigned char)(adresse & 
0x00FF);
  s[4] = taille_lecture;

  dwSendLength = 5;
  dwRecvLength = taille_lecture+2;
  rv = SCardTransmit( hCard, SCARD_PCI_RAW, s, dwSendLength, 
&sRecvPci,r,&dwRecvLength );


It works fine with a towitoko chipdrive with GPM8K  or I2C memory cards


regards,

Guillaume


_________________________________

Guillaume LAISNEY
REALTRONIC  - service R&D logiciel

email: [EMAIL PROTECTED]

tel:    +33 (0) 2 33 50 98 00
fax:    +33 (0) 2 33 50 98 49

REALTRONIC
Z.I. Conillot
50400 Granville
FRANCE





   
***************************************************************
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
***************************************************************

Reply via email to