FedmIscTagHandler_EPC_Class1_Gen2_IDS_SL900A.h
Go to the documentation of this file.
00001 /*-------------------------------------------------------
00002 |                                                       |
00003 |          FedmIscTagHandler_EPC_Class1_Gen2_IDS_SL900A.h   |
00004 |                                                       |
00005 ---------------------------------------------------------
00006 
00007 Copyright © 2011                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                   :       03.03.01 / 06.04.2011
00018 
00019 Version                 :       03.03.01 / 12.04.2011 / M. Hultsch
00020 
00021 Operation Systems       :       independent
00022 
00023 Function                        :       class for UHF transponder EPC Class 1 Generation 2 of manufacturer IDS Microchip 
00024                                                 specialized tag handler on top with custom specific commands
00025 
00026 NOTE                            :       this class supports only non-addressed or addressed mode in Host-Mode
00027 
00028 
00029 Trademarks:
00030 -----------
00031 OBID®, OBID i-scan® and OBID myAXXESS® are registered Trademarks of FEIG ELECTRONIC GmbH
00032 Other Trademarks: see FEDM.h
00033 */
00034 
00035 #if !defined(_FEDM_ISC_TAG_HANDLER_EPC_CLASS1_GEN2_IDS_SL900A_H_INCLUDED_)
00036 #define _FEDM_ISC_TAG_HANDLER_EPC_CLASS1_GEN2_IDS_SL900A_H_INCLUDED_
00037 
00038 #if !defined(_FEDM_NO_TAG_HANDLER_EPC_C1_G2)
00039 
00040 #include "../../FEDM.h"
00041 #include "FedmIscTagHandler_EPC_Class1_Gen2.h"
00042 
00043 class FEDM_ISOTabItem;
00044 
00045 
00046 //#####################################################################################
00047 // types
00048 //#####################################################################################
00049 
00050 
00051 
00052 
00053 //####################################################################
00054 // class FedmIscTagHandler_EPC_Class1_Gen2_IDS_SL900A
00055 // >> supports only ISO Host Commands <<
00056 //####################################################################
00057 
00064 class _FEDM_ISC_CORE_EXT_CLASS FedmIscTagHandler_EPC_Class1_Gen2_IDS_SL900A : public FedmIscTagHandler_EPC_Class1_Gen2
00065 {
00066 public:
00067 
00068         // friend classes have access rights to protected members
00069         friend class FEDM_ISCReaderModule;
00070         friend class FEDM_ISCReader;
00071         friend class FEDM_ISOTabItem;
00072 
00077         struct START_TIME
00078         {
00079                 unsigned char ucYear;
00080                 unsigned char ucMonth;
00081                 unsigned char ucDay;
00082                 unsigned char ucHour;
00083                 unsigned char ucMinute;
00084                 unsigned char ucSecond;
00085 
00086                 // initialization
00087                 void Init()
00088                 {
00089                         memset(&ucYear, 0, sizeof(START_TIME));
00090                 }
00091 
00092                 // initialization
00093                 START_TIME() :  ucYear(0),
00094                                                 ucMonth(0),
00095                                                 ucDay(0),
00096                                                 ucHour(0),
00097                                                 ucMinute(0),
00098                                                 ucSecond(0) {}
00099 
00100         };
00101 
00106         struct CALIBRATION
00107         {
00108                 unsigned char ucRefTc;
00109                 unsigned char ucOffInt;
00110                 unsigned char ucRingCall;
00111                 unsigned char ucIRLev;
00112                 unsigned char ucSelp22;
00113                 unsigned char ucDf;
00114                 unsigned char ucAdf;
00115                 unsigned char ucSelp12;
00116                 unsigned char ucCoars2;
00117                 unsigned char ucAd2;
00118                 unsigned char ucCoars1;
00119                 unsigned char ucAd1;
00120                 bool bSwExtEn;
00121                 bool bGndSwitch;
00122 
00123                 // initialization
00124                 void Init()
00125                 {
00126                         memset(&ucRefTc, 0, sizeof(CALIBRATION));
00127                 }
00128 
00129                 // initialization
00130                 CALIBRATION() : ucRefTc(0),
00131                                                 ucOffInt(0),
00132                                                 ucRingCall(0),
00133                                                 ucIRLev(0),
00134                                                 ucSelp22(0),
00135                                                 ucDf(0),
00136                                                 ucAdf(0),
00137                                                 ucSelp12(0),
00138                                                 ucCoars2(0),
00139                                                 ucAd2(0),
00140                                                 ucCoars1(0),
00141                                                 ucAd1(0),
00142                                                 bSwExtEn(false),
00143                                                 bGndSwitch(false) {}
00144 
00145         };
00146 
00151         struct SFE_PARAMETERS
00152         {
00153                 unsigned char ucVerifySensorID;
00154                 unsigned char ucSext2;
00155                 unsigned char ucSext1;
00156                 unsigned char ucSeti;
00157                 unsigned char ucRang;
00158                 bool bAutoRangePreset;
00159 
00161                 void Init()
00162                 {
00163                         memset(&ucVerifySensorID, 0, sizeof(SFE_PARAMETERS));
00164                 }
00165 
00167                 SFE_PARAMETERS() :      ucVerifySensorID(0),
00168                                                         ucSext2(0),
00169                                                         ucSext1(0),
00170                                                         ucSeti(0),
00171                                                         ucRang(0),
00172                                                         bAutoRangePreset(false) {}
00173 
00174         };
00175 
00180         struct LIMITS
00181         {
00182                 unsigned int uiExtremeUpperLimit;
00183                 unsigned int uiUpperLimit;
00184                 unsigned int uiLowerLimit;
00185                 unsigned int uiExtremeLowerLimit;
00186 
00188                 void Init()
00189                 {
00190                         memset(&uiExtremeUpperLimit, 0, sizeof(LIMITS));
00191                 }
00192 
00194                 LIMITS() :      uiExtremeUpperLimit(0),
00195                                         uiUpperLimit(0),
00196                                         uiLowerLimit(0),
00197                                         uiExtremeLowerLimit(0) {}
00198 
00199         };
00200 
00205         struct LIMITS_COUNTER
00206         {
00207                 unsigned char ucExtremeUpperLimitsCounter;
00208                 unsigned char ucUpperLimitsCounter;
00209                 unsigned char ucLowerLimitsCounter;
00210                 unsigned char ucExtremeLowerLimitsCounter;
00211 
00213                 void Init()
00214                 {
00215                         memset(&ucExtremeUpperLimitsCounter, 0, sizeof(LIMITS_COUNTER));
00216                 }
00217 
00219                 LIMITS_COUNTER() :      ucExtremeUpperLimitsCounter(0),
00220                                                         ucUpperLimitsCounter(0),
00221                                                         ucLowerLimitsCounter(0),
00222                                                         ucExtremeLowerLimitsCounter(0) {}
00223 
00224         };
00225 
00230         struct SYSTEM_STATUS
00231         {
00232                 bool bActive;
00233                 unsigned int uiNoOfMeasurements;
00234                 unsigned char ucNoOfMemoryReplacements;
00235                 unsigned int uiMeasurementAddressPointer;
00236 
00238                 void Init()
00239                 {
00240                         memset(&bActive, 0, sizeof(SYSTEM_STATUS));
00241                 }
00242 
00244                 SYSTEM_STATUS() :       bActive(false),
00245                                                         uiNoOfMeasurements(0),
00246                                                         ucNoOfMemoryReplacements(0),
00247                                                         uiMeasurementAddressPointer(0) {}
00248 
00249         };
00250 
00255         struct LOG_MODE
00256         {
00257                 bool bBatteryCheck;
00258                 bool bTemperatureSensor;
00259                 bool bExternalSensor1;
00260                 bool bExternalSensor2;
00261                 bool bStorageRule;
00262                 unsigned char ucLogginForm;
00263 
00265                 void Init()
00266                 {
00267                         memset(&bBatteryCheck, 0, sizeof(LOG_MODE));
00268                 }
00269 
00271                 LOG_MODE() :    bBatteryCheck(false),
00272                                                 bTemperatureSensor(false),
00273                                                 bExternalSensor1(false),
00274                                                 bExternalSensor2(false),
00275                                                 bStorageRule(false),
00276                                                 ucLogginForm(0) {}
00277 
00278         };
00279 
00284         struct LOG_INTERVAL
00285         {
00286                 unsigned int uiLogInterval;
00287 
00289                 void Init()
00290                 {
00291                         memset(&uiLogInterval, 0, sizeof(LOG_INTERVAL));
00292                 }
00293 
00295                 LOG_INTERVAL() :        uiLogInterval(0) {}
00296 
00297         };
00298 
00303         struct DELAY_TIME
00304         {
00305                 bool bTimer;
00306                 bool bDelayMode_External;
00307                 unsigned int uiDelayTime;
00308 
00310                 void Init()
00311                 {
00312                         memset(&bTimer, 0, sizeof(DELAY_TIME));
00313                 }
00314 
00316                 DELAY_TIME() :  bTimer(false),
00317                                                 bDelayMode_External(false),
00318                                                 uiDelayTime(0) {}
00319 
00320         };
00321 
00326         struct APP_DATA
00327         {
00328                 unsigned char ucBrokenWordPointer;
00329                 unsigned int uiNoOfWordsForAppData;
00330 
00332                 void Init()
00333                 {
00334                         memset(&ucBrokenWordPointer, 0, sizeof(APP_DATA));
00335                 }
00336 
00338                 APP_DATA() :    ucBrokenWordPointer(0),
00339                                                 uiNoOfWordsForAppData(0) {}
00340 
00341         };
00342 
00347         struct SHELF_LIFE_0
00348         {
00349                 unsigned char ucActivationEnergy;
00350                 unsigned char ucNormalTemperature;
00351                 unsigned char ucMinimalTemperature;
00352                 unsigned char ucMaximalTemperature;
00353 
00355                 void Init()
00356                 {
00357                         memset(&ucActivationEnergy, 0, sizeof(SHELF_LIFE_0));
00358                 }
00359 
00361                 SHELF_LIFE_0() :        ucActivationEnergy(0),
00362                                                         ucNormalTemperature(0),
00363                                                         ucMinimalTemperature(0),
00364                                                         ucMaximalTemperature(0) {}
00365 
00366         };
00367 
00372         struct SHELF_LIFE_1
00373         {
00374                 unsigned char ucSkipLog;
00375                 bool bEnableAlgorithm;
00376                 bool bEnableNegativeShelfLife;
00377                 unsigned char ucSensorID;
00378                 unsigned int uiTinit;
00379                 unsigned int uiSLinit;
00380 
00382                 void Init()
00383                 {
00384                         memset(&ucSkipLog, 0, sizeof(SHELF_LIFE_1));
00385                 }
00386 
00388                 SHELF_LIFE_1() :        ucSkipLog(0),
00389                                                         bEnableAlgorithm(false),
00390                                                         bEnableNegativeShelfLife(false),
00391                                                         ucSensorID(0),
00392                                                         uiTinit(0),
00393                                                         uiSLinit(0) {}
00394 
00395         };
00396 
00397 
00398 
00408         int SetPassword(        string sAccessPassword,
00409                                                 unsigned char ucPasswordLevel,
00410                                                 string sPassword );
00411 
00421         int SetLogMode(         string sAccessPassword,
00422                                                 LOG_MODE* pLogMode,
00423                                                 LOG_INTERVAL* pLogInterval );
00424 
00434         int SetLogLimits(       string sAccessPassword,
00435                                                 LIMITS* pLogLimits);
00436 
00446         int GetMeasurementSetup(string sAccessPassword,
00447                                                         START_TIME* pStartTime,
00448                                                         LIMITS* pLogLimits,
00449                                                         LOG_MODE* pLogMode,
00450                                                         LOG_INTERVAL* pLogInterval,
00451                                                         DELAY_TIME* pDelayTime,
00452                                                         APP_DATA* pUserData );
00453 
00463         int SetSFEData( string sAccessPassword,
00464                                         SFE_PARAMETERS* pSfeData );
00465 
00475         int SetCalibrationData( string sAccessPassword,
00476                                                         CALIBRATION* pCalData );
00477 
00487         int EndLog(     string sAccessPassword );
00488 
00498         int StartLog(   string sAccessPassword,
00499                                         START_TIME* pStartTime );
00500 
00510         int GetLogState(string sAccessPassword,
00511                                         LIMITS_COUNTER* pLimitsCounter,
00512                                         SYSTEM_STATUS* pSystemStatus,
00513                                         SHELF_LIFE_0* pSF0,
00514                                         SHELF_LIFE_1* pSF1,
00515                                         unsigned int& uiCurrentShelfLife,
00516                                         unsigned char& ucStatusFlags );
00517 
00527         int GetCalibrationData( string sAccessPassword,
00528                                                         CALIBRATION* pCalData,
00529                                                         SFE_PARAMETERS* pSfeData );
00530 
00540         int GetBatteryLevel(string sAccessPassword,
00541                                                 unsigned char ucBatteryRetrigger,
00542                                                 bool& bError,
00543                                                 unsigned char& ucBatteryType,
00544                                                 unsigned int& uiBatteryLevel );
00545 
00555         int SetShelfLife(       string sAccessPassword,
00556                                                 SHELF_LIFE_0* pSF0,
00557                                                 SHELF_LIFE_1* pSF1 );
00558 
00568         int Initialize( string sAccessPassword,
00569                                         DELAY_TIME* pDelayTime,
00570                                         APP_DATA* pUserData );
00571 
00581         int GetSensorValue(     string sAccessPassword,
00582                                                 unsigned char ucSensorType,
00583                                                 bool& bError,
00584                                                 unsigned char& ucRangeOrLimit,
00585                                                 unsigned int& uiSensorValue );
00586 
00596         int OpenArea(   string sAccessPassword,
00597                                         unsigned char ucPasswordLevel,
00598                                         string sPassword );
00599 
00609         int AccessFIFO( string sAccessPassword,
00610                                         unsigned char ucSubCommand,
00611                                         unsigned char ucNoOfBytes,
00612                                         unsigned char* pucBuffer );
00613 
00618         unsigned char GetTagError();
00619 
00624         virtual void Init();                                    // set all data members to 0
00625 
00626 #if _MSC_VER > 1200
00627 
00628 
00629 
00630         static const unsigned char PW_LEVEL_SYSTEM                      = 0x01;
00634         static const unsigned char PW_LEVEL_USER                        = 0x02;
00638         static const unsigned char PW_LEVEL_MEASUREMENT         = 0x03;
00639 
00643         static const unsigned char LOG_MODE_DENSE                                               = 0x00;
00647         static const unsigned char LOG_MODE_ALL_VALUES_OUT_OF_LIMITS    = 0x01;
00651         static const unsigned char LOG_MODE_LIMITS_CROSSING                             = 0x03;
00655         static const unsigned char LOG_MODE_IRQ_EXT1                                    = 0x05;
00659         static const unsigned char LOG_MODE_IRQ_EXT2                                    = 0x06;
00663         static const unsigned char LOG_MODE_IRQ_EXT1_EXT2                               = 0x07;
00664 
00668         static const unsigned char SUB_CMD_READ_FIFO            = 0x04;
00672         static const unsigned char SUB_CMD_WRITE_FIFO           = 0x05;
00676         static const unsigned char SUB_CMD_READ_STATUS          = 0x06;
00677 #else // for Visual Studio 6
00678         // constants for [0xA0] Set Password and [0xAE] Open Area
00679         static const unsigned char PW_LEVEL_SYSTEM;
00680         static const unsigned char PW_LEVEL_USER;
00681         static const unsigned char PW_LEVEL_MEASUREMENT;
00682         // constants for [0xA1] Set Log Mode
00683         static const unsigned char LOG_MODE_DENSE;
00684         static const unsigned char LOG_MODE_ALL_VALUES_OUT_OF_LIMITS;
00685         static const unsigned char LOG_MODE_LIMITS_CROSSING;
00686         static const unsigned char LOG_MODE_IRQ_EXT1;
00687         static const unsigned char LOG_MODE_IRQ_EXT2;
00688         static const unsigned char LOG_MODE_IRQ_EXT1_EXT2;
00689         // constants for [0xAF] Access FIFO
00690         static const unsigned char SUB_CMD_READ_FIFO;
00691         static const unsigned char SUB_CMD_WRITE_FIFO;
00692         static const unsigned char SUB_CMD_READ_STATUS;
00693 #endif
00694 
00695 protected:
00696         // constructor
00697         FedmIscTagHandler_EPC_Class1_Gen2_IDS_SL900A(FEDM_ISCReader* pReader, FEDM_ISOTabItem* pTabItem);
00698         // 2. constructor
00699         FedmIscTagHandler_EPC_Class1_Gen2_IDS_SL900A(FEDM_ISCReader* pReader, unsigned int uiTagHandlerType, FEDM_ISOTabItem* pTabItem);
00700         // destructor
00701         virtual ~FedmIscTagHandler_EPC_Class1_Gen2_IDS_SL900A();
00702 
00703         unsigned char   m_ucTagError;
00704 
00705 };
00706 
00707 #endif // #if !defined(_FEDM_NO_TAG_HANDLER_EPC_C1_G2)
00708 
00709 #endif // !defined(_FEDM_ISC_TAG_HANDLER_EPC_CLASS1_GEN2_IDS_SL900A_H_INCLUDED_)


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