Hi all,
I think i am writing to correct mailing list now.
Please read the my original email below.
I have also attached the additional pcscd log with
apdu information here. Can you please tell me why I am
getting this error 0x80100016 when sending the Get
Response APDU (00 C0 00 00 00 )

I am getting this error in Gentoo Linux distribution
only. In other linux distributions my code works
correctly.
Regards,
Kamal.

===============================================
pcscdaemon.c:259:main() pcscd set to foreground with
debug send to stderr
debuglog.c:236:DebugLogSetCategory() Debug options:
APDU
pcscdaemon.c:464:main() pcsc-lite 1.3.1 daemon ready.
hotplug_libusb.c:407:HPAddHotPluggable() Adding USB
device: 001:004
readerfactory.c:1095:RFInitializeReader() Attempting
startup of SCM SCR 331 (2000012F) 00 00.
readerfactory.c:967:RFBindFunctions() Loading IFD
Handler 3.0
ifdhandler.c:1155:init_driver() LogLevel: 0x0003
ifdhandler.c:1165:init_driver() DriverOptions: 0x0000
ifdhandler.c:76:IFDHCreateChannelByName() lun: 0,
device: usb:04e6/e001:libusb:001:004
ccid_usb.c:231:OpenUSBByName() Manufacturer: Ludovic
Rousseau ([EMAIL PROTECTED])
ccid_usb.c:241:OpenUSBByName() ProductString: Generic
CCID driver v1.0.1
ccid_usb.c:247:OpenUSBByName() Copyright: This driver
is protected by terms of the GNU General Public
License version 2, or (at your option) any later
version.
ccid_usb.c:395:OpenUSBByName() Found Vendor/Product:
04E6/E001 (SCM SCR 331)
ccid_usb.c:397:OpenUSBByName() Using USB bus/device:
001/004
ccid_usb.c:747:get_data_rates() IFD does not support
GET_DATA_RATES request: Broken pipe
ifdhandler.c:252:IFDHGetCapabilities() lun: 0, tag:
0xFAE
ifdhandler.c:294:IFDHGetCapabilities() Reader supports
1 slots
ifdhandler.c:787:IFDHPowerICC() lun: 0
Card ATR: 3B DB 96 00 81 B1 FE 45 1F 03 00 F9 A0 00 00
03 08 00 00 10 00 98 
prothandler.c:130:PHSetProtocol() Attempting PTS to
T=1
ifdhandler.c:377:IFDHSetProtocolParameters() lun: 0,
protocol T=1
ifdhandler.c:1260:extra_egt() Extra EGT patch applied
APDU: 00 CB 3F FF 05 5C 03 5F C1 07 
ifdhandler.c:894:IFDHTransmitToICC() lun: 0
SW: 61 47 
APDU: 00 C0 00 00 47 
ifdhandler.c:894:IFDHTransmitToICC() lun: 0
SW: 53 45 F0 10 73 6F 6D 65 20 63 63 63 20 63 61 72 64
20 69 64 F1 01 21 F2 01 21 F3 00 F4 01 11 F5 01 10 F6
11 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
F7 01 00 FA 01 00 FB 01 00 FC 01 00 FD 01 00 FE 01 00
90 00 
APDU: 00 CB 3F FF 05 5C 03 5F C1 02 
ifdhandler.c:894:IFDHTransmitToICC() lun: 0
SW: 61 00 
APDU: 00 C0 00 00 00 
ifdhandler.c:894:IFDHTransmitToICC() lun: 0
ccid_usb.c:508:ReadUSB() usb_bulk_read(001/004):
Resource temporarily unavailable
openct/proto-t1.c:218:t1_transceive() fatal:
transmit/receive failed
SW: 
ifdwrapper.c:735:IFDTransmit() Card not transacted:
612
winscard.c:1491:SCardTransmit() Card not transacted:
0x80100016
APDU: 00 A4 04 00 0A 00 00 00 00 00 00 00 00 00 00 
ccid_usb.c:474:WriteUSB() usb_bulk_write(001/004):
Resource temporarily unavailable
ifdwrapper.c:484:IFDStatusICC() Card not transacted:
612
eventhandler.c:301:EHStatusHandlerThread() Error
communicating to: SCM SCR 331 (2000012F) 00 00
ifdhandler.c:894:IFDHTransmitToICC() lun: 0
SW: 
ifdwrapper.c:735:IFDTransmit() Card not transacted:
612
winscard.c:1491:SCardTransmit() Card not transacted:
0x80100016
ccid_usb.c:474:WriteUSB() usb_bulk_write(001/004):
Resource temporarily unavailable
ifdwrapper.c:484:IFDStatusICC() Card not transacted:
612
ifdhandler.c:787:IFDHPowerICC() lun: 0
ccid_usb.c:474:WriteUSB() usb_bulk_write(001/004):
Resource temporarily unavailable
ifdhandler.c:823:IFDHPowerICC() PowerUp failed
winscard.c:771:SCardDisconnect() Error resetting card.
pcscdaemon.c:529:signal_trap() Preparing for suicide
hotplug_libusb.c:361:HPEstablishUSBNotifications()
Hotplug stopped
readerfactory.c:1350:RFCleanupReaders() entering
cleaning function
readerfactory.c:1359:RFCleanupReaders() Stopping
reader: SCM SCR 331 (2000012F) 00 00
eventhandler.c:121:EHDestroyEventHandler() Stomping
thread.
ccid_usb.c:474:WriteUSB() usb_bulk_write(001/004):
Resource temporarily unavailable
ifdwrapper.c:484:IFDStatusICC() Card not transacted:
612
eventhandler.c:301:EHStatusHandlerThread() Error
communicating to: SCM SCR 331 (2000012F) 00 00
eventhandler.c:150:EHDestroyEventHandler() Thread
stomped.
readerfactory.c:1142:RFUnInitializeReader() Attempting
shutdown of SCM SCR 331 (2000012F) 00 00.
ifdhandler.c:203:IFDHCloseChannel() lun: 0
ccid_usb.c:474:WriteUSB() usb_bulk_write(001/004):
Resource temporarily unavailable
readerfactory.c:1012:RFUnloadReader() Unloading reader
driver.
pcscdaemon.c:489:at_exit() cleaning /var/run
===========================================

> 
> kamal kumar a écrit :
> > Hi all,
> > I am developing one module that interacts with PIV
> > smartcard. All the APDUs are working well and
> > returning response. But when i send Get Response
> APDU
> > to retrieve data more than 255 bytes I am getting
> > error. SCardTransmit function return 80100016
> error
> > code. I have also attached the PCSCD log also with
> > this. This error is occuring only in Gentoo 2006.1
> > Linux distribution I installed. It is working
> > correctly in other Linux distributions I used.
> > 
> > And working with SCR 331 reader. I have given the
> code
> > that send the Get Response APDU here.
> >
>
=================================================================
> > LONG SCardHookExchangeAPDU( SCARDHANDLE hCard,
> DWORD
> > dwActiveProtocol, PCSCLPTransmitBuffer
> transmitBuffer
> > ) {
> >   LONG rv;
> >   unsigned long originalLength;
> > 
> >  
> >     if (dwActiveProtocol == SCARD_PROTOCOL_T0)
> >     {
> >         transmitBuffer->ioType =
> > (LPSCARD_IO_REQUEST)SCARD_PCI_T0;
> >     }
> >     else if (dwActiveProtocol ==
> SCARD_PROTOCOL_T1)
> >     {
> >         transmitBuffer->ioType =
> > (LPSCARD_IO_REQUEST)SCARD_PCI_T1;
> >     }
> >     else
> >     {
> >         throw
> > SCardException(SCARD_E_UNSUPPORTED_FEATURE);
> >     }
> > 
> >   originalLength =
> transmitBuffer->apduResponseSize;
> >           
> > 
> >   rv = SCardTransmit(hCard, 
> >           transmitBuffer->ioType,
> >               transmitBuffer->buffer, 
> >               transmitBuffer->bufferSize,
> >               0,
> >               transmitBuffer->apduResponse, 
> >               &transmitBuffer->apduResponseSize );
> > 
> >       if (rv != SCARD_S_SUCCESS) {  
> >               printf("SCardTransmit exited with error code =
> > %d",rv);
> >               throw SCardException(rv);
> >       }
> > 
> >     
> >   return rv;
> > }
> > 
> > 
> > StatusWord GetResponse (SCARDHANDLE cardHandle,
> > PIV_Byte le, DWORD dwActiveProtocol, PIV_Byte
> *buffer,
> > PIV_ULong32 *pBufferLength) {
> > 
> >     LONG rv;
> >     PCSCTransmitBuffer transmitBuffer;
> >     StatusWord sw=0;
> >     transmitBuffer.apduResponseSize = 260;
> > 
> >     /* Select Applet APDU */
> >     transmitBuffer.buffer[APDU_CLA] = 0x00;
> >     transmitBuffer.buffer[APDU_INS] = 0xC0;
> >     transmitBuffer.buffer[APDU_P1]  = 0x00;
> >     transmitBuffer.buffer[APDU_P2]  = 0x00;
> >     transmitBuffer.buffer[APDU_P3]  = le;
> > 
> >     transmitBuffer.bufferSize = 5;
> > 
> > 
> SCardHookExchangeAPDU(cardHandle,dwActiveProtocol,
> > &transmitBuffer);
> > 
> >     sw = ReadStatusWord(&transmitBuffer);
> > 
> >     if (sw != 0x9000 && (sw & 0xFF00) != 0x6100)
> throw
> > APDUException(sw);
> > 
> >     memcpy (buffer,
> &(transmitBuffer.apduResponse[0]),
> > transmitBuffer.apduResponseSize-2);
> >     return sw;
> > }
> >
>
=============================================================
> > 
> > pcscd log
> > 
> >
>
=============================================================
> > pcscdaemon.c:259:main() pcscd set to foreground
> with
> > debug send to stderr
> > pcscdaemon.c:464:main() pcsc-lite 1.3.1 daemon
> ready.
> > hotplug_libusb.c:407:HPAddHotPluggable() Adding
> USB
> > device: 001:003
> > readerfactory.c:1095:RFInitializeReader()
> Attempting
> > startup of SCM SCR 331 (2000012F) 00 00.
> > readerfactory.c:967:RFBindFunctions() Loading IFD
> > Handler 3.0
> > ifdhandler.c:1155:init_driver() LogLevel: 0x0003
> > ifdhandler.c:1165:init_driver() DriverOptions:
> 0x0000
> > ifdhandler.c:76:IFDHCreateChannelByName() lun: 0,
> > device: usb:04e6/e001:libusb:001:003
> > ccid_usb.c:231:OpenUSBByName() Manufacturer:
> Ludovic
> > Rousseau ([EMAIL PROTECTED])
> > ccid_usb.c:241:OpenUSBByName() ProductString:
> Generic
> > CCID driver v1.0.1
> > ccid_usb.c:247:OpenUSBByName() Copyright: This
> driver
> > is protected by terms of the GNU General Public
> > License version 2, or (at your option) any later
> > version.
> > ccid_usb.c:395:OpenUSBByName() Found
> Vendor/Product:
> > 04E6/E001 (SCM SCR 331)
> > ccid_usb.c:397:OpenUSBByName() Using USB
> bus/device:
> > 001/003
> > ccid_usb.c:747:get_data_rates() IFD does not
> support
> > GET_DATA_RATES request: Broken pipe
> > ifdhandler.c:252:IFDHGetCapabilities() lun: 0,
> tag:
> > 0xFAE
> > ifdhandler.c:294:IFDHGetCapabilities() Reader
> supports
> > 1 slots
> > ifdhandler.c:787:IFDHPowerICC() lun: 0
> > Card ATR: 3B DB 96 00 81 B1 FE 45 1F 03 80 F9 A0
> 00 00
> > 03 08 00 00 10 00 18 
> > prothandler.c:130:PHSetProtocol() Attempting PTS
> to
> > T=1
> > ifdhandler.c:377:IFDHSetProtocolParameters() lun:
> 0,
> > protocol T=1
> > ifdhandler.c:1260:extra_egt() Extra EGT patch
> applied
> > ifdhandler.c:894:IFDHTransmitToICC() lun: 0
> > ifdhandler.c:894:IFDHTransmitToICC() lun: 0
> > ccid_usb.c:508:ReadUSB() usb_bulk_read(001/003):
> > Resource temporarily unavailable
> > openct/proto-t1.c:218:t1_transceive() fatal:
> > transmit/receive failed
> > ifdwrapper.c:735:IFDTransmit() Card not
> transacted:
> > 612
> > winscard.c:1491:SCardTransmit() Card not
> transacted:
> > 0x80100016
> > ccid_usb.c:474:WriteUSB() usb_bulk_write(001/003):
> > Resource temporarily unavailable
> > ifdwrapper.c:484:IFDStatusICC() Card not
> transacted:
> > 612
> > eventhandler.c:301:EHStatusHandlerThread() Error
> > communicating to: SCM SCR 331 (2000012F) 00 00
> > ccid_usb.c:474:WriteUSB() usb_bulk_write(001/003):
> > Resource temporarily unavailable
> > ifdwrapper.c:484:IFDStatusICC() Card not
> transacted:
> 
=== message truncated ===



 
____________________________________________________________________________________
Food fight? Enjoy some healthy debate 
in the Yahoo! Answers Food & Drink Q&A.
http://answers.yahoo.com/dir/?link=list&sid=396545367
_______________________________________________
Muscle mailing list
[email protected]
http://lists.drizzle.com/mailman/listinfo/muscle

Reply via email to