FedmIscTagHandler_ISO14443_3_MIFARE_Plus_SL1.cpp
Go to the documentation of this file.
00001 /*-------------------------------------------------------
00002 |                                                       |
00003 |      FedmIscTagHandler_ISO14443_3_MIFARE_Plus_SL1.cpp |
00004 |                                                       |
00005 ---------------------------------------------------------
00006 
00007 Copyright © 2009-2010   FEIG ELECTRONIC GmbH, All Rights Reserved.
00008                                                 Lange Strasse 4
00009                                                 D-35781 Weilburg
00010                                                 Federal Republic of Germany
00011                                                 phone    : +49 6471 31090
00012                                                 fax      : +49 6471 310999
00013                                                 e-mail   : obid-support@feig.de
00014                                                 Internet : http://www.feig.de
00015                                         
00016 Author                  :       Markus Hultsch
00017 Begin                   :       24.08.2009
00018 
00019 Version                 :       03.01.00 / 10.02.2010 / M. Hultsch
00020 
00021 Operation Systems       :       independent
00022 
00023 Function                        :       class for OBID® classic-pro transponder ISO14443-3 MIFARE Plus in Security Level 1
00024 
00025 NOTE                            :       this class supports only selected or addressed mode in Host-Mode
00026 
00027 
00028 Trademarks:
00029 -----------
00030 OBID®, OBID i-scan® and OBID myAXXESS® are registered Trademarks of FEIG ELECTRONIC GmbH
00031 Other Trademarks: see FEDM.h
00032 */
00033 
00034 #if !defined(_FEDM_NO_TAG_HANDLER_ISO14443)
00035 
00036 #include "FedmIscTagHandler_ISO14443_3_MIFARE_Plus_SL1.h"
00037 #include "../FEDM_ISCReader.h"
00038 #include "../FEDM_ISOTabItem.h"
00039 #include "../FEDM_ISCReaderID.h"
00040 #include "../FEDM_ISC.h"
00041 
00042 
00043 #if _MSC_VER >= 1400
00044         #pragma warning(disable : 4996)
00045 #endif
00046 
00047 
00048 
00049 //####################################################################
00050 // class FedmIscTagHandler_ISO14443_3_MIFARE_Plus_SL1
00051 // >> supports only ISO Host Commands <<
00052 //####################################################################
00053 
00054 FedmIscTagHandler_ISO14443_3_MIFARE_Plus_SL1::FedmIscTagHandler_ISO14443_3_MIFARE_Plus_SL1(
00055         FEDM_ISCReader* pReader, 
00056         FEDM_ISOTabItem* pTabItem )
00057         : FedmIscTagHandler_ISO14443_3_MIFARE_Plus(pReader, FedmIscTagHandler::TYPE_ISO14443_3_MIFARE_PLUS_SL1, pTabItem)
00058 {
00059         m_sTagName = "ISO 14443-3 Type A : MIFARE Plus in Security Level 1";
00060 }
00061 
00062 FedmIscTagHandler_ISO14443_3_MIFARE_Plus_SL1::FedmIscTagHandler_ISO14443_3_MIFARE_Plus_SL1(
00063         FEDM_ISCReader* pReader, 
00064         unsigned int uiTagHandlerType,
00065         FEDM_ISOTabItem* pTabItem )
00066         : FedmIscTagHandler_ISO14443_3_MIFARE_Plus(pReader, uiTagHandlerType, pTabItem)
00067 {
00068         m_sTagName = "ISO 14443-3 Type A : MIFARE Plus in Security Level 1";
00069 }
00070 
00071 FedmIscTagHandler_ISO14443_3_MIFARE_Plus_SL1::~FedmIscTagHandler_ISO14443_3_MIFARE_Plus_SL1()
00072 {
00073 }
00074 
00075 // set all data members to 0
00076 /*void FedmIscTagHandler_ISO14443_3_MIFARE_Plus_SL1::Init()
00077 {
00078 }*/
00079 
00080 
00081 /***************************************************************************
00082   Begin                 :       24.08.2009 / M. Hultsch
00083 
00084   Version               :       03.01.00 / 25.08.2009 / M. Hultsch
00085 
00086   Function                      :       [0xC2][0x77] SL1 AES Authent with key from reader
00087 
00088                                                 NOTE: only for selected tags
00089 
00090   Parameters            :       unsigned char ucKeyIndex                        - [in] reader key index
00091 
00092   Return value          :       0                               - if tramsmission was successful
00093                                                 status byte (>1)- if the reader signals a problem
00094                                                 error code (<0) - if something goes wrong
00095 ***************************************************************************/
00096 int FedmIscTagHandler_ISO14443_3_MIFARE_Plus_SL1::AESAuthent(   
00097         unsigned char ucReaderKeyIndex )
00098 {
00099         int iErr = 0;
00100 
00101         FEDM_CHK1(iErr, m_pReader->SetData(FEDM_ISC_TMP_0xC2_CMD, (unsigned char)0x77));
00102         FEDM_CHK1(iErr, m_pReader->SetData(FEDM_ISC_TMP_0xC2_MODE, (unsigned char)0x00));
00103         FEDM_CHK1(iErr, m_pReader->SetData(FEDM_ISC_TMP_0xC2_KEY_INDEX, ucReaderKeyIndex));
00104 
00105         // ... and execute
00106         int iBack = m_pReader->SendProtocol(0xC2);
00107         if( iBack==0x00 )
00108         {
00109                 m_ucErrorSource = 0;
00110                 m_uiErrorCode = 0;
00111         }
00112         else if( iBack==0x97 )
00113         {
00114                 FEDM_CHK1(iErr, m_pReader->GetData(FEDM_ISC_TMP_0xC2_ERROR_SOURCE, &m_ucErrorSource));
00115                 FEDM_CHK1(iErr, m_pReader->GetData(FEDM_ISC_TMP_0xC2_ERROR_CODE, &m_uiErrorCode));
00116         }
00117 
00118         return iBack;
00119 }
00120 
00121 #endif // #if !defined(_FEDM_NO_TAG_HANDLER_ISO14443)


rfid_drivers
Author(s): Raul Perula-Martinez
autogenerated on Thu Apr 2 2015 03:06:14