#include <PCSC/ifdhandler.h>
RESPONSECODE IFDHCreateChannel(DWORD Lun,
DWORD Channel);
| Lun | IN | Logical Unit Number |
| Channel | IN | Channel ID |
This function is required to open a communications channel to the port listed by Channel. For example, the first serial reader on COM1 would link to /dev/pcsc/1 which would be a symbolic link to /dev/ttyS0 on some machines This is used to help with inter-machine independence.
On machines with no /dev directory the driver writer may choose to map their Channel to whatever they feel is appropriate.
Once the channel is opened the reader must be in a state in which it is possible to query IFDHICCPresence() for card status.
Use this for multiple card slots or multiple readers. 0xXXXXYYYY - XXXX multiple readers, YYYY multiple slots. The resource manager will set these automatically. By default the resource manager loads a new instance of the driver so if your reader does not have more than one smart card slot then ignore the Lun in all the functions.
PC/SC supports the loading of multiple readers through one instance of the driver in which XXXX is important. XXXX identifies the unique reader in which the driver communicates to. The driver should set up an array of structures that associate this XXXX with the underlying details of the particular reader.
This is denoted by the following:
| 0x000001 | /dev/pcsc/1 |
| 0x000002 | /dev/pcsc/2 |
| 0x000003 | /dev/pcsc/3 |
| 0x000004 | /dev/pcsc/4 |
USB readers can ignore the Channel parameter and query the USB bus for the particular reader by manufacturer and product id.
| IFD_SUCCESS | Successful |
| IFD_COMMUNICATION_ERROR | Error has occurred |
| IFD_NO_SUCH_DEVICE | The reader is no more present |
Ludovic Rousseau 2008-01-18