How to signal smart card activity at the PC/SC level? Using D-Bus? HAL?

Stanislav Brabec sbrabec at suse.cz
Mon Aug 31 06:51:52 PDT 2009


Stanislav Brabec wrote:
> Ludovic Rousseau wrote:

> > I need a one-way only event mechanism to signal events. Maybe D-Bus is
> > too complex and HAL is the correct answer to my problem?

> D-Bus is a good generic mechanism to transport signals from the daemon
> (running as root) to user space and vice versa without providing access
> permissions to the device node. For an uni-directional code you can use
> minimalistic signalling code (based on dbus-send or similar utility).

Thinking about it again, you need a bi-directional communication,
otherwise you will not be able to get information about an initial state
when applet starts. So you have to use main loop, pselect() or threads.

Here is an example of things that the daemon will provide at

interface: org.debian.alioth.pcsclite
path: /org/debian/alioth/pcsclite/reader0/slot0

signal: CardPresence
Signal sends DBUS_TYPE_BOOLEAN

method: GetCardPresence
Method gets no argument (just a path) and returns DBUS_TYPE_BOOLEAN.


The same may be used with CardActive, or you may use say DBUS_TYPE_BYTE
prototyped as enum {empty, present, active}.

-- 
Best Regards / S pozdravem,

Stanislav Brabec
software developer
---------------------------------------------------------------------
SUSE LINUX, s. r. o.                          e-mail: sbrabec at suse.cz
Lihovarská 1060/12           tel: +420 284 028 966, +49 911 740538747
190 00 Praha 9                                  fax: +420 284 028 951
Czech Republic                                    http://www.suse.cz/



More information about the xdg mailing list