Dear Sir,

I tried implementing TAG_IFD_POLLING_THREAD_WITH_TIMEOUT as specified in http://pcsclite.alioth.debian.org/api/group__IFDHandler.html#ga799aa26945bbd3f61aaa57107f63ae0b

following is the code snippet of ifdhandler of my

RESPONSECODE foo_for_TIMEOUT(int Lun, int timeout)
{
     return IFD_ICC_NOT_PRESENT; /* or return IFD_ICC_NOT_PRESENT; */
}

RESPONSECODE IFDHGetCapabilities ( DWORD Lun, DWORD Tag, PDWORD Length, PUCHAR Value )
{
    switch (Tag)
     {
            /* There are many TAGS I am skipping all of them*/
            case TAG_IFD_POLLING_THREAD_WITH_TIMEOUT:
               *Length = 1;
*Value = foo_for_TIMEOUT(Lun, 5); /* 5 is taken in which measure by pcscd whether 5 seconds?? or 5 milliseconds or 5 microseconds??*/
               break;
    }
    return IFD_SUCCESS;
}

Please help me out if I am doing any silly mistake please excuse.

Thanks & Regards,
M.V.Raghavendhra Chowdary,

On Tuesday 07 August 2012 04:59 PM, Ludovic Rousseau wrote:
2012/8/7 Raghavendhra Chowdary MV <[email protected]>:
I am using PN512 contactless reader chip integrated on my device and wrote
our own IFD handler driver for that in which we are using serial
communication which is happenning in the IFD Handler level. As the continous
polling of IFDICCPresence() which will do serial communication continuously
until the pcscd is killed hence looking for reduction in polling or almost
stopping the polling during the idle time.
The best solution is to modify your driver to add support of
TAG_IFD_POLLING_THREAD_WITH_TIMEOUT [1].
pcscd will use a callback function in the driver. The driver will
return only after the timeout has expired or a card event occurred.

The other solution is to change the value of PCSCLITE_STATUS_POLL_RATE
in pcscd.h
The default value is 400ms.
If you increase the delay to 1 minute you will not be notified a new
card is present "immediately" but after 30 seconds on average. It is a
trade-off.

Bye

[1] 
http://pcsclite.alioth.debian.org/api/group__IFDHandler.html#ga799aa26945bbd3f61aaa57107f63ae0b


<<attachment: raghavendhra_chowdary.vcf>>

_______________________________________________
Muscle mailing list
[email protected]
http://lists.drizzle.com/mailman/listinfo/muscle

Reply via email to