Show
Ignore:
Timestamp:
04/29/08 19:01:19 (7 months ago)
Author:
alonbl
Message:

Plug&Play support

This is not the best solution, but focus on smallest code change.

Changes:

1. Add detect_readers() to reader opts, this adds new readers to the end

of the readers list until list is full.

2. Add sc_ctx_detect_readers() that calls readers' detect_readers().

3. Fixup pcsc_lock() so that it reconnect to the card and report proper

error so caller may be notified if session was lost.

4. Allow context to be created without readers.

5. Call sc_ctx_detect_readers() from PKCS#11 C_GetSlotList with NULL_PTR.

6. Allow no reader at detect_card, as reader my be removed.

7. Since I broke ABI, I updated the external module version requirement

to match OpenSC version. In the future a separate version should be
maintained for each interface, this should be unrelated to the package
version.

Alon

---

svn merge -r 3480:3505 https://www.opensc-project.org/svn/opensc/branches/alonbl/pnp

M src/tools/opensc-tool.c
M src/pkcs11/pkcs11-global.c
M src/pkcs11/slot.c
M src/libopensc/reader-pcsc.c
M src/libopensc/internal-winscard.h
M src/libopensc/ctx.c
M src/libopensc/reader-ctapi.c
M src/libopensc/libopensc.exports
M src/libopensc/reader-openct.c
M src/libopensc/opensc.h

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • trunk/src/libopensc/opensc.h

    r3304 r3506  
    374374         * deallocate the private data and any resources. */ 
    375375        int (*finish)(struct sc_context *ctx, void *priv_data); 
     376        /* Called when library wish to detect new readers 
     377         * should add only new readers. */ 
     378        int (*detect_readers)(struct sc_context *ctx, void *priv_data); 
    376379        /* Called when releasing a reader.  release() has to 
    377380         * deallocate the private data.  Other fields will be 
     
    726729 */ 
    727730int sc_release_context(sc_context_t *ctx); 
     731 
     732/** 
     733 * Detect new readers available on system. 
     734 * @param  ctx  OpenSC context 
     735 * @return SC_SUCCESS on success and an error code otherwise. 
     736 */ 
     737int sc_ctx_detect_readers(sc_context_t *ctx); 
    728738 
    729739/**