[Pcsclite-muscle] Registering virtual readers

Alexander May alexander.may at hjp-consulting.com
Mon Sep 22 07:55:05 UTC 2014


Am 20.09.2014 um 11:40 schrieb Ludovic Rousseau:
> 2014-09-19 15:27 GMT+02:00 Alexander May <alexander.may at hjp-consulting.com>:
>> Am 18.09.2014 um 11:55 schrieb Ludovic Rousseau:
>>>> - how can I register them as new readers during runtime?
>>>> - Is there a better point where I could start my server socket thread?
>>>> Doing this in IFDHCreateChannel requires a "server reder" that will
>>>> never connect to any card, which is a little ugly in my opinion.
>>> The serial configuration interface may the best you can use.
>>>
>>> pcsc-lite implements RFReCheckReaderConf() to recheck the serial
>>> configuration. This code is used in hotplug_libusb.c but has been
>>> removed from hotplug_libudev.c.
>>>
>>> The idea is to send a signal SIGUSR1 to pcscd to tell it to reload the
>>> serial configuration.
>>> You may have 10 virtual readers configured as 10 serial devices.
>>> IFDHCreateChannel() would fail for non existent readers.
>>> On the next SIGUSR1 signal each configured serial driver should be
>>> called again and IFDHCreateChannel() would succeed if the reader is
>>> now available.
>>>
>>> You can experiment on that idea.
>>>
>> That sounds very good. I changed my code accordingly, configured some
>> readers that return IFD_NO_SUCH_DEVICE on IFDHCreateChannel as long as
>> no connection is present and change their behavor when a client is
>> connect to return IFD_SUCCESS.
>> Unfortunately I semm to be unable to trigger the rescaning of the reader
>> configuration. I even tried sending SIGUSR1 manually from another shell
>> or calling pcscd -H. But neither worked. At least my IFDHCreateChannel
>> isn't called again.
>> Am I missing something? (In case it matters, I'm using Ubuntu 12.04 LTS
>> with default pcsc-lite 1.7.4)
> I was not clear enough in my previous answer.
>
> The use of SIGUSR1 is available when hotplug_libusb.c is used.
> Now the USB hotplug is done using hotplug_libudev.c and the use of
> SIGUSR1 is no more available.
Ok, I didn't get this detail. But does this mean that the call "pcscd
-H" does not work either? I guess so from my experiences and a (very
short)...

Is there a simple way to trigger the existing hotplug rescan using
hotplug_libudev?
Shouldn't the solution than be changing the code for pcscd -H to use
this mechanism?
> You can rebuild pcsc-lite using --enable-libusb so that
> hotplug_libusb.c and try/debug your code.
> If it works you can hack hotplug_libudev.c to add support of SIGUSR1
> so that you can use the standard pcsc-lite compilation.
Do I understand this correctly. You would like the signal handler to be
reintegrated within hotplug_libudev to be included in the next upstream
release if I provide an according patch?
Which one would be your preferred approach?

Bye,
Alexander


-- 
BSc Alexander May, Senior Software Engineer
HJP Consulting GmbH, Hauptstraße 35, 33178 Borchen, Germany
Handelsregister HRB 7553, Amtsgericht Paderborn
Geschäftsführer: Markus Hartmann
fon +49-5251 4177634, fax +49-5251 4177666

www.hjp-consulting.com
www.globaltester.org





More information about the Pcsclite-muscle mailing list