2011/9/2 Florian Echtler <[email protected]>:
> Hello everyone,
Hello,
> a while ago, there was a discussion in xdg [1] about DBus support for
> smartcard activity. I've hacked together a bash script for that purpose:
>
> #!/bin/bash
> pcsc_scan -n | { while read RESULT; do
>
> ATR=$(echo $RESULT | perlgrep "ATR: ..35m(.*)\e")
> [ "$ATR" ] && dbus-send --session
> --type=signal /org/debian/alioth/pcsclite/reader0/slot0
> org.debian.alioth.pcsclite.CardPresence string:"$ATR"
>
> RMV=$(echo $RESULT | grep "removed")
> [ "$RMV" ] && dbus-send --session
> --type=signal /org/debian/alioth/pcsclite/reader0/slot0
> org.debian.alioth.pcsclite.CardPresence boolean:false
>
> done }
>
> However, I think it would be a bit smoother to directly integrate this
> into pcsc-lite. The best to add support would be in eventhandler.c,
> correct?
I don't think it is a good idea to add that inside pcsc-lite.
You should be able to to the same as in your bash script using Python
to link pyscard [2] on one side and dbus-python on the other side.
If you provide such a script I may include it in the pcsc-lite project
in contrib [3].
You can get information like card insertion or removal, reader
insertion or removal.
But you will not get events like "an APDU exchange is ongoing". This
could be a security issue if anyone could spy at this level. But that
would be great to implement a software blinking LED for readers
without this feature.
Bye
> [1] http://lists.freedesktop.org/archives/xdg/2009-August/011008.html
[2] http://pyscard.sourceforge.net/
[3] http://anonscm.debian.org/viewvc/pcsclite/trunk/contrib/
--
Dr. Ludovic Rousseau
_______________________________________________
Muscle mailing list
[email protected]
http://lists.drizzle.com/mailman/listinfo/muscle