ข่าวสารและการฝึกอบรม
เทคนิค ถาม และ ตอบ
magnetic card reader device driver
- no.2326
- 2003-05-26
I have some question about device driver.
someone described it very well in microsoft.public.windowsce.embedded,
so I reposted it as my question.
Pszemol said:
I am quite new in device drivers developing but I need to design
a driver for a mag card reader connected to my device without any
standard interface like USB. My card reader will have just 2 pairs
of data/clock signal transmitting data with variable frequency,
depending of the speed of the card swipe. It will also have the
sensor output for "card in the reader" as just TTL 0/5V signal
and will be permanently connected to the Windows CE .NET device.
I understand the protocol and I see no hardware problems with
interfacing to the card reader directly through my CPU I/O ports...
As you can see, I just start from scratch - without any support in
terms of driver itself or even API from the reader manufacturer...
What I am looking for is some guidance in how to design driver
interface to the application itself. Are they any example drivers
for mag card readers in Windows CE I can use as a template? Any
publicly available standards in this matter? Maybe MDD driver layer?
My plan was just to create a "MAG:" device in my system, and let
the application open (CreateFile) the device and read (ReadFile)
card data from the device driver. But it is not enough - the app
cannot read this device in the loop - it need to know when the
card was swiped and when data is already decoded by the driver
and available for processing. I need the device to act something
like the serial port driver, sending an event similar to EV_RXCHAR.
Would it be reasonable to use a serial port driver as my template
for a mag card reader device driver? Or are there a better ways
to implement this functionality in smarter and more elegant way?
I know there is a whole Smart Card subsystem in Windows CE - would
it be good idea to use this subsystem for my mag card reader?
The first sight on the Smart Card reader documentation tells me
that it is way overkill for my simple mag card reader device.