Hello,
Here is an update on what is going on.
Ok, I wrote a CT-API driver writer HOW-TO last night and posted it up on the
site. It also includes skeleton code and has most everything else filled in.
I also released a new version of the CT-API for Reflex 62/64 that is CT-BCS
compliant. It currently doesn't support the PIN pad but that is an easy fix.
For more information please review the ctapi-howto.html. You will notice that
all new code will by default compile to shared libraries. This is so the new
modules will work with the resource manager. I just finished an upper level
API for the resource manager. Basically what I have done now handles:
1 Finds reader in config file returns library and dynamically loads it.
2. Sets up all the pointers to the function in that library.
3. Provides necessary reader/card functions.
Basically you have a few functions. Nevermind, I'll just include the
header file to this email.
#ifndef ctbcs_h
#define ctbcs_h
#ifdef __cplusplus
extern "C" {
#endif
/*
* NAME:
* ctbcs.h - Copyright (C) 1998 David Corcoran
* [EMAIL PROTECTED]
*
* DESCRIPTION:
* This calls the CT-BCS standard commands from the CT-API.
*
* AUTHOR:
* David Corcoran, 9/18/98
*
* LICENSE: See file LICENSE.
*
*/
#include "defines.h"
/* Dynamically loads the specified CT-API library */
int CTB_LoadCTLibrary ( char *pcConfigFile, // Config File Location.
char *pcReader // Reader Id.
);
/* Dynamically unloads the current CT-API library */
int CTB_CloseCTLibrary (
void
);
/* Initializes the port which the CT resides */
int CTB_Init ( int iTerminal, // Terminal Number.
int iPort // Port Number.
);
int CTB_Close ( int iTerminal // Terminal Number.
);
/* Resets the CT */
int CTB_ResetCT ( int iTerminal, // Terminal Number.
unsigned char cUnit, // Slot Number.
unsigned int *lr, // Length Atr.
unsigned char *Atr // Atr.
);
/* Powers the ICC and returns the Atr */
int CTB_RequestICC ( int iTerminal, // Terminal Number.
unsigned char cUnit, // Slot Number.
unsigned int *lr, // Length Atr.
unsigned char *Atr // Returned Atr.
);
/* Gets CT status such as Card in/out */
int CTB_GetStatus ( int iTerminal, // Terminal Number.
int *iStatus // Status.
);
/* Powers off the ICC and ejects if available */
int CTB_EjectICC ( int iTerminal // Terminal Number.
);
/* The heart of the CT-API */
int CTB_Data ( unsigned int ctn, // Terminal Number.
unsigned char *dad, // Destination.
unsigned char *sad, // Source.
unsigned int lc, // Length of Command.
unsigned char *cmd, // Command.
unsigned int *lr, // Length of Response.
unsigned char *rsp // Response.
);
/************ Some defines *****************************/
#define MAX_RDRID_SIZE (int)20 // Max reader id size.
#define MAX_RDRNAME_SIZE (int)50 // Max reader name size.
#define MAX_RDRLIB_SIZE (int)50 // Max reader libname size.
#define MAX_ATR_SIZE (int)50 // Max ATR size.
#define CTB_OK 0 // Everything is OK.
#define CTB_NOT_FOUND -201 // Reader Library not Found.
#define CTB_FILE_ERROR -202 // Config File not Found.
#define CTB_ERROR -203 // General Error.
#define CTB_CARD_IN -210 // Card Inserted.
#define CTB_CARD_OUT -211 // Card Removed.
#define CTB_CARD_NOPOWER -213 // Card Not Powered.
#ifdef __cplusplus
}
#endif
#endif
Enjoy,
Dave
--
******************************************************************
David Corcoran Internet Security/Smartcards
Work: School:
205 Industrial Blvd 2252 US Highway 52 West Apt C4
Sugar Land, TX 77478 West Lafayette, IN 47906
Suggestion: Use Linux, it is for IQ's higher than 95.
Quote:
If you can't make it work, at least make it look good.
~ Bill Gates
******************************************************************
***************************************************************
Linux Smart Card Developers - M.U.S.C.L.E.
(Movement for the Use of Smart Cards in a Linux Environment)
http://www.linuxnet.com/smartcard/index.html
***************************************************************