Determining the type of expansion card currently in use

C

Chris

Hello all,

I'm working on a mobile application that uses an RFID chip reader, and
now has to support multiple readers. I've found the pattern example at
MSDN for bar code scanners to be an excellent analog (http://
msdn2.microsoft.com/en-us/library/aa446489.aspx), and intend to model
my solution after that. However, it requires the ability to
distinguish between the different types of cards that may be plugged
in to the device.

I've found multiple articles regarding detecting the insertion/removal
of cards, but I feel that won't be sufficient for my situation. The
card is likely to have been inserted when the application isn't
running, so I need to be able to determine the installed card after
the fact.

This post:
http://groups.google.com/group/micr...nk=gst&q=detect+card&rnum=11#d53e04dbcd13a987

....indicates that a potential source of information is the registry,
specifically the HKLM\Drivers\Active branch. I have confirmed that
there are two different entries that show up, one for each card. I
feel like this is probably workable, but as I'm very new to working
with hardware, I'm not sure if there are unforeseen pitfalls.

Is this the approach you'd take? Is there a better or more "proper"
way that I can determine the installed card?

The current version of my application supports a reader in a Compact
Flash form factor. The new card is Secure Digital. Neither have
storage, so they do not enumerate as directories.

I'm working on a Windows Mobile 5 PDA, using .NET Compact Framework
SP2.

Any help or advice is much appreciated!

Cheers,
Chris
 
P

Paul G. Tobey [eMVP]

The only way to know if this is the best answer would be to know all about
the RFID cards that you want to use and, perhaps more important, *how they
are connected to your device*. RFID could be handled via ordinary RS-232,
in which case there would be no difference in the registry between one and
the next, although you might be able, once you opened COM2 or whatever, to
send a message and get information about the reader. If the only ways to
connect a reader that you're going to support are SD and CF, yes, you're
probably safe checking how the Active key set in the registry changes.

Paul T.
 
C

Chris

Hi Paul,

Thanks for your insight. To my knowledge, there are no plans to
support RFID readers that aren't connected via CF or CD (of course, we
all know requirements change).

I've ran across mention of using the "Storage Manager" to query
devices attached to the PDA. Are there standard bits of information
that can be gleaned from attached devices? For instance, I'm aware
that most USB-connected peripherals on the desktop provide a "Device
ID," which I believe is part of the USB standard. Is there something
similar to a Device ID that I could get via the Storage Manager?

I haven't found any documentation on the Storage Manager, so I'm not
even sure where to start with it.


-Chris
 
P

Paul G. Tobey [eMVP]

CD?

The Storage Manager is for storage devices. I won't do anything unless
there's a filesystem on the device.

Since you can't settle on one interface, there's no one answer, nor is there
going to be an absolutely unique ID. If your CF slot is PCMCIA, there's the
device ID from the card and you might be able to get to that, if you knew
that a card was there, etc. by contacting the PCMCIA bus driver. I don't
have any experience with that, however, so I'm not sure that it would work.
SD cards have something similar for identifying what sort of a card they
are. There's no central API that I can bring to mind that would allow you
to say, find me an RFID reader and tell me what type it is. You have to
write the code that will do that.

Paul T.
 
C

Chris

Oops. CD == SD.

Thanks, Paul. I appreciate all your help. It looks like my best bet
for now will be to look in the Drivers\Active registry key; it may not
continue to work if we add additional readers, but we can't always
make everything 100% future-proof!


Best regards,
Chris
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top