Hi

> I'm following this structure in my Towitoko CT-API driver:
>
> - serial.c, .h: Functions for reading and writing serial port. This code
> is plataform dependent but reader independent. I'm planing add support for
> Win32 (with a new define CPU_WIN32_OS) so the CT-API would work on Linux,
> Macintosh and Win32.

Yes. From my understanding (which is still really basic) there could be a
serial library, a parallel library and a PCMCIA library for low level
communication with the device. This could be completely independent by the
reader itself (BTW, we could even borrow existing libraries for performing
this function).

> - towitoko.c, .h: Functions that handle reader protocol. The code is
> reader specific and plataform independent, as I use serial.c functions to
> comunicate with the reader. Following this schema, there could be a
> reflex.c, a mct.c or an argus.c  module.

> - ctapi.c, .h: CT-API. This should be reader dependent, and plataform
> independent, but providing the same interface for all readers.
>

I agree with you that driver.c and driver.h should be reader dependent.
More, it would be probably more clear to put reader specific constants inside
the reader.h file.

ctapi.h dont't need to be reader dependent: it has to contain only constants
that are specific to the ctapi standard. Any data specific to the driver
should go in the driver.h file It would be probably nice to add a btcts.h, in
order to define constant and macros for bcs commands

I am not really sure that also ctapi.c has to be platform dependent.  More
thinking is needed.

Sorry if I sound sometime silly. I am just starting to understand the ins and
outs of the things.

Regards

Paolo Bizzarri
Technical Manager
I3 Icube  Srl


***************************************************************
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
***************************************************************

Reply via email to