C# contactless smart cards
-
Hello there. I'm developing a C# application that interracts with a contactless smart card readers ( MiFare 1k and MiFare 2k readers), but since those kind of card readers dont support PS/SC the WinScard API won't help. (For a start ... i need a list of all connected contactless smart card readers ) So i suppose i should loop through all connected usb devices and send some APDU command so they can give their status ( identify them if they are contactless smart card readers ) Is that the right way to do that ? If someone has any information about this issue ... i'm opened to any suggestions I've been searching around the web for about 3 whole days and i'm nowhere .... Please help me
-
Hello there. I'm developing a C# application that interracts with a contactless smart card readers ( MiFare 1k and MiFare 2k readers), but since those kind of card readers dont support PS/SC the WinScard API won't help. (For a start ... i need a list of all connected contactless smart card readers ) So i suppose i should loop through all connected usb devices and send some APDU command so they can give their status ( identify them if they are contactless smart card readers ) Is that the right way to do that ? If someone has any information about this issue ... i'm opened to any suggestions I've been searching around the web for about 3 whole days and i'm nowhere .... Please help me
You'd normally go to the manufacturer and get the Software Development Kit to do this. I can't believe a manufacturer put out a piece of hardware and didn't supply an SDK so you can use it in your own code.
A guide to posting questions on CodeProject[^]
Dave Kreskowiak Microsoft MVP Visual Developer - Visual Basic
2006, 2007, 2008 -
You'd normally go to the manufacturer and get the Software Development Kit to do this. I can't believe a manufacturer put out a piece of hardware and didn't supply an SDK so you can use it in your own code.
A guide to posting questions on CodeProject[^]
Dave Kreskowiak Microsoft MVP Visual Developer - Visual Basic
2006, 2007, 2008Thank you for your response. Unfortunatly my task is to develope an access management system that interracts with all card readers in a specific building. And unfortunately the card readers in that building are not from the same manifacturer. ( The only thing in common between them is that they are conctactless card readers and reader MiFare 1k and MiFare 2k cards. ) Yes, i have a sdk which works fine with the specific reader provided to me, but ... i dont think it will "work" with the other devices. So I was thinking of a universal low level usb communication with the card readers, hoping they "work the same way behind the scenes". And folowing that logic i got stuck here http://www.codeproject.com/script/Forums/View.aspx?fid=1649&select=2906409&tid=2904097[^]
modified on Monday, February 2, 2009 3:37 AM
-
Thank you for your response. Unfortunatly my task is to develope an access management system that interracts with all card readers in a specific building. And unfortunately the card readers in that building are not from the same manifacturer. ( The only thing in common between them is that they are conctactless card readers and reader MiFare 1k and MiFare 2k cards. ) Yes, i have a sdk which works fine with the specific reader provided to me, but ... i dont think it will "work" with the other devices. So I was thinking of a universal low level usb communication with the card readers, hoping they "work the same way behind the scenes". And folowing that logic i got stuck here http://www.codeproject.com/script/Forums/View.aspx?fid=1649&select=2906409&tid=2904097[^]
modified on Monday, February 2, 2009 3:37 AM
Well, unfortunately for you, the commands, responses, and communication protocol between the different card readers are, more-than-likely, not the same. You're going to end up writing a seperate communication module for each card reader you have. The SDK for each of them is the only thing that's going to simplify this process.
A guide to posting questions on CodeProject[^]
Dave Kreskowiak Microsoft MVP Visual Developer - Visual Basic
2006, 2007, 2008 -
Well, unfortunately for you, the commands, responses, and communication protocol between the different card readers are, more-than-likely, not the same. You're going to end up writing a seperate communication module for each card reader you have. The SDK for each of them is the only thing that's going to simplify this process.
A guide to posting questions on CodeProject[^]
Dave Kreskowiak Microsoft MVP Visual Developer - Visual Basic
2006, 2007, 2008Thank you for your response! I was afraid , but not surpsised by your answer. Since those devices don't support PS/SC, there is no universal way to achieve my goal. However when i pass this hell, i'm going to write an article about contactless cards and contactless card readers i codeproject (actually ... as surprising as it sounds ... there is not even one GOOD article about that in the web - i've been researching like a whole week ) Thanks again for the information ! Best regards, Hristiyan ....
-
Thank you for your response! I was afraid , but not surpsised by your answer. Since those devices don't support PS/SC, there is no universal way to achieve my goal. However when i pass this hell, i'm going to write an article about contactless cards and contactless card readers i codeproject (actually ... as surprising as it sounds ... there is not even one GOOD article about that in the web - i've been researching like a whole week ) Thanks again for the information ! Best regards, Hristiyan ....
I have been through this hell, and it is possible to write a program that will process a couple of different cards. However, I have done it with C++ and not C#. I will try to give you an idea of how to do this in C#. What I did, was that I had a Mifare and a 15693 contactless mix. The readers were made by entirely different companies. Each reader has its own dll and there is unmanaged code to and from the reader, so in C# you must use delegates for you methods. You must also add the references (dlls to the project). Then you create a reader object for every kind of reader that you have dlls for. I had a dll which was able to read and code to differentiate the various RFID technologies, and using that bit of code snippet, I was able to determine what dlls and reader objects to use. The SDKs were fairly expensive, but I can give you a C++ code snippet on how to determine the various technologies: (you will notice that this can determine 1so15693, 14443A, 14443B, iso8000, felica
/////////////////////////////////////////////////////////////////////////////
// CIso_benchDlg dialogCIso_benchDlg::CIso_benchDlg(CWnd* pParent /*=NULL*/)
: CDialog(CIso_benchDlg::IDD, pParent)
{
//{{AFX_DATA_INIT(CIso_benchDlg)
m_tagid = _T("");
m_type = _T("");
m_iso15693 = FALSE;
m_iso14443A = FALSE;
m_iso14443B = FALSE;
m_iso18000 = FALSE;
m_felica = FALSE;
//}}AFX_DATA_INIT
// Note that LoadIcon does not require a subsequent DestroyIcon in Win32
m_hIcon = AfxGetApp()->LoadIcon(IDR_MAINFRAME);
}void CIso_benchDlg::DoDataExchange(CDataExchange* pDX)
{
CDialog::DoDataExchange(pDX);
//{{AFX_DATA_MAP(CIso_benchDlg)
DDX_Control(pDX, IDC_DETECT, m_button);
DDX_Text(pDX, IDC_TAGID, m_tagid);
DDX_Text(pDX, IDC_TYPE, m_type);
DDX_Check(pDX, IDC_CHECK1, m_iso15693);
DDX_Check(pDX, IDC_CHECK2, m_iso14443A);
DDX_Check(pDX, IDC_CHECK3, m_iso14443B);
DDX_Check(pDX, IDC_CHECK4, m_iso18000);
DDX_Check(pDX, IDC_CHECK5, m_felica);
//}}AFX_DATA_MAP
}BEGIN_MESSAGE_MAP(CIso_benchDlg, CDialog)
//{{AFX_MSG_MAP(CIso_benchDlg)
ON_WM_TIMER()
ON_BN_CLICKED(IDC_DETECT, OnDetect)
//}}AFX_MSG_MAP
END_MESSAGE_MAP()/////////////////////////////////////////////////////////////////////////////
// CIso_benchDlg message handlersBOOL CIso_benchDlg::OnInitDialog()
{
CDialog::OnInitDialog();// Set the icon for this dialog. The framework does this automatically // when the application's main window is not a dialog SetIcon(m\_hIcon, TRUE); // Set big icon