FEDM_ISCFunctionUnit.cpp
Go to the documentation of this file.
00001 /*-------------------------------------------------------
00002 |                                                       |
00003 |                 FEDM_ISCFunctionUnit.cpp              |
00004 |                                                       |
00005 ---------------------------------------------------------
00006 
00007 Copyright © 2005-2008   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                   :       05.01.2005
00018 
00019 Version                 :       03.00.00 / 04.04.2008 / M. Hultsch
00020 
00021 Operation Systems       :       Windows 9x/ME/NT/2000/XP/Linux/WindowsCE
00022 
00023 Function                        :       classes for OBID i-scan® function units
00024 
00025 
00026 Trademarks:
00027 -----------
00028 OBID®, OBID i-scan® and OBID myAXXESS® are registered Trademarks of FEIG ELECTRONIC GmbH
00029 Other Trademarks: see FEDM.h
00030 */
00031 
00032 
00033 
00034 #if !defined(_FEDM_NO_FU_SUPPORT)
00035 
00036 #include "FEDM_ISCFunctionUnit.h"
00037 #include "FEDM_ISCFunctionUnitID.h"
00038 #include "../FEDM_ISCReader.h"
00039 #include "../../FEDM_Functions.h"
00040 #include "feisc.h"
00041 #include "fefu.h"
00042 
00043 
00044 
00045 
00046 //####################################################################
00047 // class FEDM_ISCFunctionUnit
00048 //####################################################################
00049 
00051 // Construction/Destruction
00053 
00054 FEDM_ISCFunctionUnit::FEDM_ISCFunctionUnit(FEDM_ISCReader* pReader, int iFUType)
00055 {
00056         // memory for temporary data
00057         TmpData.reserve(FEDM_ISC_FU_MAX_TMPDATA_MEM);
00058         TmpData.resize(FEDM_ISC_FU_MAX_TMPDATA_MEM);
00059 
00060         // initialize memories with 0x00
00061         for( int i=0; i<FEDM_ISC_FU_MAX_TMPDATA_MEM; i++ )      { TmpData[i] = 0x00; }
00062 
00063         m_iReaderHnd    = 0;
00064         m_ucBusAdr              = 0;
00065         m_pReader               = pReader;
00066 
00067         m_iLastError    = 0;
00068         m_ucLastStatus  = 0;
00069 
00070         m_bManageChilds = true;
00071 
00072         m_iFUType               = iFUType;
00073 
00074         m_uiAntNo               = 0;
00075 
00076         m_iModuleHandle = 0;
00077 
00078         if( (m_iFUType == FEDM_ISC_FU_TYPE_MUX) || (m_iFUType == FEDM_ISC_FU_TYPE_UMUX) )
00079         {
00080                 m_ChildList.resize(8);
00081                 for(int i=0; i<8; ++i)  { m_ChildList[i] = NULL; }
00082         }
00083 }
00084 
00085 
00086 FEDM_ISCFunctionUnit::~FEDM_ISCFunctionUnit()
00087 {
00088         TmpData.clear();
00089         DelChildList();
00090         m_ChildList.clear();
00091 }
00092 
00093 /***************************************************************************
00094   Begin                 :       27.07.2005 / M. Hultsch
00095   
00096   Version               :       02.03.00 / 27.07.2005 / M. Hultsch
00097 
00098   Function                      :       function to control the child management, whether the child(s) are physically
00099                                                 deleted internally under control of the FU or the child(s) must be physically 
00100                                                 deleted by the application.
00101 
00102   Parameters            :       bool bDeleteInternal
00103                                                 - true (default): the parent FU can physically delete the child FUs
00104                                                 - false                 : the application must physically delete the child FUs
00105 
00106   Return value          :       -
00107 ***************************************************************************/
00108 void FEDM_ISCFunctionUnit::SetManageChildMode(bool bDeleteInternal)
00109 {
00110         m_bManageChilds = bDeleteInternal;
00111 }
00112 
00113 int FEDM_ISCFunctionUnit::GetFUType()
00114 {
00115         return m_iFUType;
00116 }
00117 
00118 int FEDM_ISCFunctionUnit::SetFUType(int iFUType)
00119 {
00120         switch(m_iFUType)
00121         {
00122         case FEDM_ISC_FU_TYPE_NONE:
00123                 m_iFUType = iFUType;
00124                 break;
00125 
00126         case FEDM_ISC_FU_TYPE_ANT:
00127                 m_iFUType = iFUType;
00128                 break;
00129         
00130         case FEDM_ISC_FU_TYPE_MUX:
00131         case FEDM_ISC_FU_TYPE_UMUX:
00132                 if(m_iFUType == iFUType)
00133                 {
00134                         DelChildList();
00135                         FEDM_RETURN(FEDM_OK);
00136                 }
00137 
00138                 DelChildList();
00139                 m_iFUType = iFUType;
00140                 break;
00141         
00142         case FEDM_ISC_FU_TYPE_DAT:
00143                 m_iFUType = iFUType;
00144                 break;
00145 
00146         default:
00147                 FEDM_RETURN(FEDM_ERROR_PARAMETER);
00148         }
00149 
00150         if( (m_iFUType == FEDM_ISC_FU_TYPE_MUX)||(m_iFUType == FEDM_ISC_FU_TYPE_UMUX) )
00151         {
00152                 m_ChildList.clear();
00153                 m_ChildList.resize(8);
00154                 for(int i=0; i<8; ++i)  { m_ChildList[i]  = NULL; }
00155         }
00156 
00157         FEDM_RETURN(FEDM_OK);
00158 }
00159 
00160 unsigned int FEDM_ISCFunctionUnit::GetAntNo()
00161 {
00162         return m_uiAntNo;
00163 }
00164 
00165 void FEDM_ISCFunctionUnit::SetAntNo(unsigned int uiAntNo)
00166 {
00167         if(uiAntNo > 0)
00168                 m_uiAntNo = uiAntNo;
00169 }
00170 
00171 
00172 int FEDM_ISCFunctionUnit::SetModuleHnd(int iHandle)
00173 {
00174         if(iHandle <= 0)
00175                 FEDM_RETURN(FEDM_ERROR_PARAMETER);
00176 
00177         m_iModuleHandle = iHandle;
00178         
00179         FEDM_RETURN(FEDM_OK);
00180 }
00181 
00182 int FEDM_ISCFunctionUnit::GetModuleHnd()
00183 {
00184         return m_iModuleHandle;
00185 }
00186 
00187 FEDM_ISCReader* FEDM_ISCFunctionUnit::GetReader()
00188 {
00189         return m_pReader;
00190 }
00191 
00192 
00194 // Communication
00196 
00197 /***************************************************************************
00198   Begin                 :       05.01.2005 / M. Hultsch
00199   
00200   Version                       :       02.06.00 / 28.03.2008 / M. Hultsch
00201 
00202   Function                      :       main function for communication with i-scan function unint
00203 
00204   Parameters            :       unsigned char ucCmdByte         -       command byte
00205 
00206   Return value          :       status byte (>=0) or error code (<0)
00207 ***************************************************************************/
00208 int FEDM_ISCFunctionUnit::SendProtocol(unsigned char ucCmdByte)
00209 {
00210         int             iErr = 0;
00211         int             iBack = 0;
00212         unsigned char   ucFUAdr = 0;    // function unit address
00213         unsigned char   ucValue[32];    memset( ucValue, '\0', 32);
00214         unsigned char   ucUHFFlags;
00215 
00216         if(m_pReader != NULL)
00217         {
00218                 m_iReaderHnd    = m_pReader->GetReaderHnd();
00219                 m_ucBusAdr              = m_pReader->GetBusAddress();
00220         }
00221         else
00222         {
00223                 FEDM_RETURN(FEDM_ERROR_NULL_POINTER);
00224         }
00225 
00226         // no reader handle -> no communication
00227         if( m_iReaderHnd == 0)
00228                 FEDM_RETURN(FEDM_ERROR_NO_READER_HANDLE);
00229 
00230         switch(ucCmdByte)
00231         {
00232         case 0xC0: // DAT: Get Firmware Version
00233                 FEDM_CHK2(iErr, GetData(FEDM_ISC_FU_TMP_DAT_ADR, &ucFUAdr));
00234                 iBack = FEFU_DAT_SoftVersion(m_iReaderHnd, m_ucBusAdr, ucFUAdr, &ucValue[0]);
00235                 if(iBack != 0)
00236                         FEDM_RETURN(iBack);
00237 
00238                 FEDM_CHK2(iErr, SetData(FEDM_ISC_FU_TMP_SOFTVER, &ucValue[0], 7));
00239                 break;
00240 
00241         case 0xC1: // DAT: CPU Reset
00242                 FEDM_CHK2(iErr, GetData(FEDM_ISC_FU_TMP_DAT_ADR, &ucFUAdr));
00243                 iBack = FEFU_DAT_CPUReset(m_iReaderHnd, m_ucBusAdr, ucFUAdr);
00244                 break;
00245 
00246         case 0xC2: // DAT: Set Capacities
00247                 FEDM_CHK2(iErr, GetData(FEDM_ISC_FU_TMP_DAT_ADR, &ucFUAdr));
00248                 FEDM_CHK2(iErr, GetData(FEDM_ISC_FU_TMP_DAT_ANT_VAL_C1, &ucValue[0]));
00249                 FEDM_CHK2(iErr, GetData(FEDM_ISC_FU_TMP_DAT_ANT_VAL_C2, &ucValue[1]));
00250                 iBack = FEFU_DAT_SetCapacities(m_iReaderHnd, m_ucBusAdr, ucFUAdr, ucValue[0], ucValue[1]);
00251                 break;
00252 
00253         case 0xC3: // DAT: Get Antenna Values
00254                 FEDM_CHK2(iErr, GetData(FEDM_ISC_FU_TMP_DAT_ADR, &ucFUAdr));
00255                 iBack = FEFU_DAT_GetValues(m_iReaderHnd, m_ucBusAdr, ucFUAdr, &ucValue[0]);
00256                 if(iBack != 0)
00257                         FEDM_RETURN(iBack);
00258 
00259                 FEDM_CHK2(iErr, SetData(FEDM_ISC_FU_TMP_DAT_ANT_VAL, &ucValue[0], 6));
00260                 break;
00261 
00262         case 0xC4: // DAT: Set Outputs
00263                 FEDM_CHK2(iErr, GetData(FEDM_ISC_FU_TMP_DAT_ADR, &ucFUAdr));
00264                 FEDM_CHK2(iErr, GetData(FEDM_ISC_FU_TMP_DAT_OUT, &ucValue[0]));
00265                 iBack = FEFU_DAT_SetOutput(m_iReaderHnd, m_ucBusAdr, ucFUAdr, ucValue[0]);
00266                 break;
00267 
00268         case 0xC5: // DAT: Re-Tuning
00269                 FEDM_CHK2(iErr, GetData(FEDM_ISC_FU_TMP_DAT_ADR, &ucFUAdr));
00270                 iBack = FEFU_DAT_ReTuning(m_iReaderHnd, m_ucBusAdr, ucFUAdr);
00271                 break;
00272 
00273         case 0xC6: // DAT: Start Tuning
00274                 FEDM_CHK2(iErr, GetData(FEDM_ISC_FU_TMP_DAT_ADR, &ucFUAdr));
00275                 iBack = FEFU_DAT_StartTuning(m_iReaderHnd, m_ucBusAdr, ucFUAdr);
00276                 break;
00277 
00278         case 0xC8: // DAT: Store Settings
00279                 FEDM_CHK2(iErr, GetData(FEDM_ISC_FU_TMP_DAT_ADR, &ucFUAdr));
00280                 iBack = FEFU_DAT_StoreSettings(m_iReaderHnd, m_ucBusAdr, ucFUAdr);
00281                 break;
00282 
00283         case 0xC9: // DAT: Detect
00284                 FEDM_CHK2(iErr, GetData(FEDM_ISC_FU_TMP_DAT_ADR, &ucFUAdr));
00285                 iBack = FEFU_DAT_Detect(m_iReaderHnd, m_ucBusAdr, ucFUAdr);
00286                 break;
00287 
00288         case 0xCA: // DAT: Set Address
00289                 FEDM_CHK2(iErr, GetData(FEDM_ISC_FU_TMP_DAT_ADR, &ucFUAdr));
00290                 FEDM_CHK2(iErr, GetData(FEDM_ISC_FU_TMP_DAT_NEW_ADR, &ucValue[0]));
00291                 iBack = FEFU_DAT_SetAddress(m_iReaderHnd, m_ucBusAdr, ucFUAdr, ucValue[0]);
00292                 break;
00293 
00294         case 0xCB: // DAT: Set Mode
00295                 FEDM_CHK2(iErr, GetData(FEDM_ISC_FU_TMP_DAT_ADR, &ucFUAdr));
00296                 FEDM_CHK2(iErr, GetData(FEDM_ISC_FU_TMP_DAT_MODE, &ucValue[0]));
00297                 iBack = FEFU_DAT_SetMode(m_iReaderHnd, m_ucBusAdr, ucFUAdr, ucValue[0]);
00298                 break;
00299 
00300         case 0xDC: // MUX or UMUX: Detect
00301                 FEDM_CHK2(iErr, GetData(FEDM_ISC_FU_TMP_MUX_ADR, &ucFUAdr));
00302 
00303                 if ( m_iFUType == FEDM_ISC_FU_TYPE_MUX )
00304                 {
00305                         iBack = FEFU_MUX_Detect(m_iReaderHnd, m_ucBusAdr, ucFUAdr);
00306                 }
00307                 else if ( m_iFUType == FEDM_ISC_FU_TYPE_UMUX )
00308                 {
00309                         FEDM_CHK2(iErr, GetData(FEDM_ISC_FU_TMP_FLAGS, &ucUHFFlags));
00310                         iBack = FEFU_UMUX_Detect_GetPower(m_iReaderHnd, m_ucBusAdr, ucFUAdr, ucUHFFlags, &m_ucLastStatus, &ucValue[0]);
00311                         FEDM_CHK2(iErr, SetData(FEDM_ISC_FU_TMP_UMUX_POWER, &ucValue[0], 5));
00312                         FEDM_CHK2(iErr, SetData(FEDM_ISC_FU_TMP_UMUX_LAST_STATE, m_ucLastStatus));
00313                 }
00314                 break;
00315 
00316         case 0xDD: // MUX or UMUX: Select Channel
00317                 FEDM_CHK2(iErr, GetData(FEDM_ISC_FU_TMP_MUX_ADR, &ucFUAdr));
00318                 FEDM_CHK2(iErr, GetData(FEDM_ISC_FU_TMP_MUX_OUT_CH1, &ucValue[0]));
00319 
00320                 if ( m_iFUType == FEDM_ISC_FU_TYPE_MUX )
00321                 {
00322                         FEDM_CHK2(iErr, GetData(FEDM_ISC_FU_TMP_MUX_OUT_CH2, &ucValue[1]));
00323                         iBack = FEFU_MUX_SelectChannel(m_iReaderHnd, m_ucBusAdr, ucFUAdr, ucValue[0], ucValue[1]);
00324                 }
00325                 else if ( m_iFUType == FEDM_ISC_FU_TYPE_UMUX )
00326                 {
00327                         FEDM_CHK2(iErr, GetData(FEDM_ISC_FU_TMP_FLAGS, &ucUHFFlags));
00328                         iBack = FEFU_UMUX_SelectChannel(m_iReaderHnd, m_ucBusAdr, ucFUAdr, ucUHFFlags, ucValue[0], &m_ucLastStatus);
00329                         FEDM_CHK2(iErr, SetData(FEDM_ISC_FU_TMP_UMUX_LAST_STATE, m_ucLastStatus));
00330                 }
00331                 break;
00332 
00333         case 0xDE: // MUX or UMUX: CPU Reset
00334                 FEDM_CHK2(iErr, GetData(FEDM_ISC_FU_TMP_MUX_ADR, &ucFUAdr));
00335 
00336                 if ( m_iFUType == FEDM_ISC_FU_TYPE_MUX )
00337                 {
00338                         iBack = FEFU_MUX_CPUReset(m_iReaderHnd, m_ucBusAdr, ucFUAdr);
00339                 }
00340                 else if ( m_iFUType == FEDM_ISC_FU_TYPE_UMUX )
00341                 {
00342                         FEDM_CHK2(iErr, GetData(FEDM_ISC_FU_TMP_FLAGS, &ucUHFFlags));
00343                         iBack = FEFU_UMUX_CPUReset(m_iReaderHnd, m_ucBusAdr, ucFUAdr, ucUHFFlags, &m_ucLastStatus);
00344                         FEDM_CHK2(iErr, SetData(FEDM_ISC_FU_TMP_UMUX_LAST_STATE, m_ucLastStatus));
00345                 }
00346                 break;
00347 
00348         case 0xDF: // MUX or UMUX: Get Firmware Version
00349                 FEDM_CHK2(iErr, GetData(FEDM_ISC_FU_TMP_MUX_ADR, &ucFUAdr));
00350 
00351                 if ( m_iFUType == FEDM_ISC_FU_TYPE_MUX )
00352                 {
00353                         iBack = FEFU_MUX_SoftVersion(m_iReaderHnd, m_ucBusAdr, ucFUAdr, &ucValue[0]);
00354                 }
00355                 else if ( m_iFUType == FEDM_ISC_FU_TYPE_UMUX )
00356                 {
00357                         FEDM_CHK2(iErr, GetData(FEDM_ISC_FU_TMP_FLAGS, &ucUHFFlags));
00358                         iBack = FEFU_UMUX_SoftVersion(m_iReaderHnd, m_ucBusAdr, ucFUAdr, ucUHFFlags, &m_ucLastStatus, &ucValue[0]);
00359                         FEDM_CHK2(iErr, SetData(FEDM_ISC_FU_TMP_UMUX_LAST_STATE, m_ucLastStatus));
00360                 }
00361 
00362                 if(iBack != 0)
00363                         FEDM_RETURN(iBack);
00364 
00365                 FEDM_CHK2(iErr, SetData(FEDM_ISC_FU_TMP_SOFTVER, &ucValue[0], 7));
00366                 break;
00367 
00368         default:
00369                 FEDM_RETURN(FEDM_ERROR_UNKNOWN_CONTROL_BYTE);
00370         }
00371 
00372         FEDM_RETURN(iBack);
00373 }
00374 
00375 
00377 // miscellaneous functions
00379 
00380 int FEDM_ISCFunctionUnit::GetLastError()
00381 {
00382         return m_iLastError;
00383 }
00384 
00385 unsigned char FEDM_ISCFunctionUnit::GetLastStatus()
00386 {
00387         return m_ucLastStatus;
00388 }
00389         
00390 int FEDM_ISCFunctionUnit::GetErrorText(char* cErrorText, int iErrorCode)
00391 {
00392         FEDM_CHK5(cErrorText);
00393 
00394         if(iErrorCode == 0)
00395         {
00396                 strcpy(cErrorText, "OK");
00397                 return FEDM_OK;
00398         }
00399         else if(iErrorCode > -1000 && iErrorCode <= -100)
00400         {
00401                 // errors from FEDM
00402                 return FEDM_Base::GetErrorText(cErrorText, iErrorCode);
00403         }
00404         else if(iErrorCode > -4100 && iErrorCode < -1000)
00405         {
00406                 // errors from reader controlled libraries
00407                 if(m_pReader != NULL)
00408                 {
00409                         return m_pReader->GetErrorText(cErrorText, iErrorCode);
00410                 }
00411                 else
00412                 {
00413                         return FEDM_Base::GetErrorText(cErrorText, FEDM_ERROR_NULL_POINTER);
00414                 }
00415         }
00416         else if(iErrorCode > -4200 && iErrorCode < -4100)
00417         {
00418                 // errors from fefu library
00419                 return FEFU_GetErrorText(iErrorCode, cErrorText);
00420         }
00421         else
00422         {
00423                 return FEDM_Base::GetErrorText(cErrorText, iErrorCode);
00424         }
00425 
00426         return FEDM_ERROR_UNKNOWN_ERROR_CODE;
00427 }
00428 
00429 int FEDM_ISCFunctionUnit::GetStatusText(char* cStatusText, unsigned char ucStatus)
00430 {
00431         FEDM_CHK5(cStatusText);
00432 
00433         // status text from fefu library
00434         return FEFU_GetStatusText(ucStatus, cStatusText);
00435 }
00436 
00437 
00439 // main access functions
00441 
00442 /***************************************************************************
00443   Begin         :       05.01.2005 / M. Hultsch
00444   Version       :       02.00.01 / 05.01.2005 / M. Hultsch
00445 
00446   Function              :       read a value from specified memory
00447 
00448   Parameter             :       char* ID        -       parameter identifier
00449                                         bool* Data      -       pointer to value
00450 
00451   Return Value  :       FEDM_OK (0) or error code (<0)
00452 ***************************************************************************/
00453 int FEDM_ISCFunctionUnit::GetData( char* ID, bool* Data )
00454 {
00455         FEDM_CHK5(ID);
00456         FEDM_CHK5(Data);
00457 
00458         // extract MemID
00459         int MemID = FEDM_GetMemIDOfID(ID);
00460         
00461         switch( MemID )
00462         {
00463         case FEDM_TMPDATA_MEM:
00464                 return FEDM_Base::GetData(ID, Data, TmpData, 16);
00465         case FEDM_RFC_EEDATA_MEM:
00466         case FEDM_RFC_RAMDATA_MEM:
00467         case FEDM_MJPDATA_MEM:
00468         case FEDM_SN_MEM:
00469         case FEDM_ID_MEM:
00470         case FEDM_AC_MEM:
00471         case FEDM_PUB_MEM:
00472         case FEDM_SEC_MEM:
00473         case FEDM_CONF_MEM:
00474         case FEDM_DATE_MEM:
00475                 FEDM_RETURN(FEDM_ERROR_UNSUPPORTED);
00476         default:
00477                 FEDM_RETURN(FEDM_ERROR_UNKNOWN_MEM_ID);
00478         }
00479 
00480         FEDM_RETURN(FEDM_OK);
00481 }
00482 
00483 /***************************************************************************
00484   Begin         :       05.01.2005 / M. Hultsch
00485   Version       :       02.00.01 / 05.01.2005 / M. Hultsch
00486 
00487   Function              :       read a value from specified memory
00488 
00489   Parameter             :       char* ID        -       parameter identifier
00490                                         BOOL* Data      -       pointer to value
00491 
00492   Return Value  :       FEDM_OK (0) or error code (<0)
00493 ***************************************************************************/
00494 #if defined(_FEDM_MFC_SUPPORT) //|| defined(__BORLANDC__)
00495 int FEDM_ISCFunctionUnit::GetData( char* ID, BOOL* Data )
00496 {
00497         FEDM_CHK5(ID);
00498         FEDM_CHK5(Data);
00499 
00500         // extract MemID
00501         int MemID = FEDM_GetMemIDOfID(ID);
00502         
00503         switch( MemID )
00504         {
00505         case FEDM_TMPDATA_MEM:
00506                 return FEDM_Base::GetData(ID, Data, TmpData, 16);
00507         case FEDM_RFC_EEDATA_MEM:
00508         case FEDM_RFC_RAMDATA_MEM:
00509         case FEDM_MJPDATA_MEM:
00510         case FEDM_SN_MEM:
00511         case FEDM_ID_MEM:
00512         case FEDM_AC_MEM:
00513         case FEDM_PUB_MEM:
00514         case FEDM_SEC_MEM:
00515         case FEDM_CONF_MEM:
00516         case FEDM_DATE_MEM:
00517                 FEDM_RETURN(FEDM_ERROR_UNSUPPORTED);
00518         default:
00519                 FEDM_RETURN(FEDM_ERROR_UNKNOWN_MEM_ID);
00520         }
00521 
00522         FEDM_RETURN(FEDM_OK);
00523 }
00524 #endif
00525 
00526 /***************************************************************************
00527   Begin         :       05.01.2005 / M. Hultsch
00528   Version       :       02.00.01 / 05.01.2005 / M. Hultsch
00529 
00530   Function              :       read a value from specified memory
00531 
00532   Parameter             :       char* ID        -       parameter identifier
00533                                         unsigned char* Data     -       pointer to value
00534 
00535   Return Value  :       FEDM_OK (0) or error code (<0)
00536 ***************************************************************************/
00537 int FEDM_ISCFunctionUnit::GetData( char* ID, unsigned char* Data )
00538 {
00539         FEDM_CHK5(ID);
00540         FEDM_CHK5(Data);
00541 
00542         // extract MemID
00543         int MemID = FEDM_GetMemIDOfID(ID);
00544         
00545         switch( MemID )
00546         {
00547         case FEDM_TMPDATA_MEM:
00548                 return FEDM_Base::GetData(ID, Data, TmpData, 16);
00549         case FEDM_RFC_EEDATA_MEM:
00550         case FEDM_RFC_RAMDATA_MEM:
00551         case FEDM_MJPDATA_MEM:
00552         case FEDM_SN_MEM:
00553         case FEDM_ID_MEM:
00554         case FEDM_AC_MEM:
00555         case FEDM_PUB_MEM:
00556         case FEDM_SEC_MEM:
00557         case FEDM_CONF_MEM:
00558         case FEDM_DATE_MEM:
00559                 FEDM_RETURN(FEDM_ERROR_UNSUPPORTED);
00560         default:
00561                 FEDM_RETURN(FEDM_ERROR_UNKNOWN_MEM_ID);
00562         }
00563 
00564         FEDM_RETURN(FEDM_OK);
00565 }
00566 
00567 /***************************************************************************
00568   Begin         :       05.01.2005 / M. Hultsch
00569   Version       :       02.00.01 / 05.01.2005 / M. Hultsch
00570 
00571   Function              :       read a value from specified memory
00572 
00573   Parameter             :       char* ID        -       parameter identifier
00574                                         unsigned char* Data     -       pointer to value
00575                                         int Cnt         -       length of Data
00576 
00577   Return Value  :       FEDM_OK (0) or error code (<0)
00578 ***************************************************************************/
00579 int FEDM_ISCFunctionUnit::GetData( char* ID, unsigned char* Data, int Cnt )
00580 {
00581         FEDM_CHK5(ID);
00582         FEDM_CHK5(Data);
00583 
00584         // extract MemID
00585         int MemID = FEDM_GetMemIDOfID(ID);
00586         
00587         switch( MemID )
00588         {
00589         case FEDM_TMPDATA_MEM:
00590                 return FEDM_Base::GetData(ID, Data, Cnt, TmpData, 16);
00591         case FEDM_RFC_EEDATA_MEM:
00592         case FEDM_RFC_RAMDATA_MEM:
00593         case FEDM_MJPDATA_MEM:
00594         case FEDM_SN_MEM:
00595         case FEDM_ID_MEM:
00596         case FEDM_AC_MEM:
00597         case FEDM_PUB_MEM:
00598         case FEDM_SEC_MEM:
00599         case FEDM_CONF_MEM:
00600         case FEDM_DATE_MEM:
00601                 FEDM_RETURN(FEDM_ERROR_UNSUPPORTED);
00602         default:
00603                 FEDM_RETURN(FEDM_ERROR_UNKNOWN_MEM_ID);
00604         }
00605 
00606         FEDM_RETURN(FEDM_OK);
00607 }
00608 
00609 /***************************************************************************
00610   Begin         :       05.01.2005 / M. Hultsch
00611   Version       :       02.00.01 / 05.01.2005 / M. Hultsch
00612 
00613   Function              :       read a value from specified memory
00614 
00615   Parameter             :       char* ID        -       parameter identifier
00616                                         unsigned int* Data      -       pointer to value
00617 
00618   Return Value  :       FEDM_OK (0) or error code (<0)
00619 ***************************************************************************/
00620 int FEDM_ISCFunctionUnit::GetData( char* ID, unsigned int* Data )
00621 {
00622         FEDM_CHK5(ID);
00623         FEDM_CHK5(Data);
00624 
00625         // extract MemID
00626         int MemID = FEDM_GetMemIDOfID(ID);
00627         
00628         switch( MemID )
00629         {
00630         case FEDM_TMPDATA_MEM:
00631                 return FEDM_Base::GetData(ID, Data, TmpData, 16);
00632         case FEDM_RFC_EEDATA_MEM:
00633         case FEDM_RFC_RAMDATA_MEM:
00634         case FEDM_MJPDATA_MEM:
00635         case FEDM_SN_MEM:
00636         case FEDM_ID_MEM:
00637         case FEDM_AC_MEM:
00638         case FEDM_PUB_MEM:
00639         case FEDM_SEC_MEM:
00640         case FEDM_CONF_MEM:
00641         case FEDM_DATE_MEM:
00642                 FEDM_RETURN(FEDM_ERROR_UNSUPPORTED);
00643         default:
00644                 FEDM_RETURN(FEDM_ERROR_UNKNOWN_MEM_ID);
00645         }
00646 
00647         FEDM_RETURN(FEDM_OK);
00648 }
00649 
00650 /***************************************************************************
00651   Begin         :       05.01.2005 / M. Hultsch
00652   Version       :       02.00.01 / 05.01.2005 / M. Hultsch
00653 
00654   Function              :       read a value from specified memory
00655 
00656   Parameter             :       char* ID                -       parameter identifier
00657                                         __int64* Data   -       pointer to value
00658 
00659   Return Value  :       FEDM_OK (0) or error code (<0)
00660 ***************************************************************************/
00661 int FEDM_ISCFunctionUnit::GetData( char* ID, __int64* Data)
00662 {
00663         FEDM_CHK5(ID);
00664         FEDM_CHK5(Data);
00665 
00666         // extract MemID
00667         int MemID = FEDM_GetMemIDOfID(ID);
00668         
00669         switch( MemID )
00670         {
00671         case FEDM_TMPDATA_MEM:
00672                 return FEDM_Base::GetData(ID, Data, TmpData, 16);
00673         case FEDM_RFC_EEDATA_MEM:
00674         case FEDM_RFC_RAMDATA_MEM:
00675         case FEDM_MJPDATA_MEM:
00676         case FEDM_SN_MEM:
00677         case FEDM_ID_MEM:
00678         case FEDM_AC_MEM:
00679         case FEDM_PUB_MEM:
00680         case FEDM_SEC_MEM:
00681         case FEDM_CONF_MEM:
00682         case FEDM_DATE_MEM:
00683                 FEDM_RETURN(FEDM_ERROR_UNSUPPORTED);
00684         default:
00685                 FEDM_RETURN(FEDM_ERROR_UNKNOWN_MEM_ID);
00686         }
00687 
00688         FEDM_RETURN(FEDM_OK);
00689 }
00690 
00691 /***************************************************************************
00692   Begin         :       05.01.2005 / M. Hultsch
00693   Version       :       02.00.01 / 05.01.2005 / M. Hultsch
00694 
00695   Function              :       read a value from specified memory
00696 
00697   Parameter             :       char* ID                -       parameter identifier
00698                                         CString& Data   -       reference of value
00699 
00700   Return Value  :       FEDM_OK (0) or error code (<0)
00701 ***************************************************************************/
00702 #if defined(_FEDM_MFC_SUPPORT) //|| defined(__BORLANDC__)
00703 int FEDM_ISCFunctionUnit::GetData( char* ID, CString& Data )
00704 {
00705         FEDM_CHK5(ID);
00706 
00707         // extract MemID
00708         int MemID = FEDM_GetMemIDOfID(ID);
00709         
00710         switch( MemID )
00711         {
00712         case FEDM_TMPDATA_MEM:
00713                 return FEDM_Base::GetData(ID, Data, TmpData, 16);
00714         case FEDM_RFC_EEDATA_MEM:
00715         case FEDM_RFC_RAMDATA_MEM:
00716         case FEDM_MJPDATA_MEM:
00717         case FEDM_SN_MEM:
00718         case FEDM_ID_MEM:
00719         case FEDM_AC_MEM:
00720         case FEDM_PUB_MEM:
00721         case FEDM_SEC_MEM:
00722         case FEDM_CONF_MEM:
00723         case FEDM_DATE_MEM:
00724                 FEDM_RETURN(FEDM_ERROR_UNSUPPORTED);
00725         default:
00726                 FEDM_RETURN(FEDM_ERROR_UNKNOWN_MEM_ID);
00727         }
00728 
00729         FEDM_RETURN(FEDM_OK);
00730 }
00731 #endif
00732 
00733 /***************************************************************************
00734   Begin         :       05.01.2005 / M. Hultsch
00735   Version       :       02.00.01 / 05.01.2005 / M. Hultsch
00736 
00737   Function              :       read a value from specified memory
00738 
00739   Parameter             :       char* ID                -       parameter identifier
00740                                         string& Data    -       reference of value
00741 
00742   Return Value  :       FEDM_OK (0) or error code (<0)
00743 ***************************************************************************/
00744 int FEDM_ISCFunctionUnit::GetData( char* ID, string& Data )
00745 {
00746         FEDM_CHK5(ID);
00747 
00748         // extract MemID
00749         int MemID = FEDM_GetMemIDOfID(ID);
00750         
00751         switch( MemID )
00752         {
00753         case FEDM_TMPDATA_MEM:
00754                 return FEDM_Base::GetData(ID, Data, TmpData, 16);
00755         case FEDM_RFC_EEDATA_MEM:
00756         case FEDM_RFC_RAMDATA_MEM:
00757         case FEDM_MJPDATA_MEM:
00758         case FEDM_SN_MEM:
00759         case FEDM_ID_MEM:
00760         case FEDM_AC_MEM:
00761         case FEDM_PUB_MEM:
00762         case FEDM_SEC_MEM:
00763         case FEDM_CONF_MEM:
00764         case FEDM_DATE_MEM:
00765                 FEDM_RETURN(FEDM_ERROR_UNSUPPORTED);
00766         default:
00767                 FEDM_RETURN(FEDM_ERROR_UNKNOWN_MEM_ID);
00768         }
00769 
00770         FEDM_RETURN(FEDM_OK);
00771 }
00772 
00773 /***************************************************************************
00774   Begin         :       05.01.2005 / M. Hultsch
00775   Version       :       02.00.01 / 05.01.2005 / M. Hultsch
00776 
00777   Function              :       read a value from specified memory
00778 
00779   Parameter             :       char* ID        -       parameter identifier
00780                                         char* Data      -       pointer to value
00781                                         int DataLen     -       length of Data
00782 
00783   Return Value  :       FEDM_OK (0) or error code (<0)
00784 ***************************************************************************/
00785 int FEDM_ISCFunctionUnit::GetData( char* ID, char* Data, int DataLen )
00786 {
00787         FEDM_CHK5(ID);
00788         FEDM_CHK5(Data);
00789 
00790         // extract MemID
00791         int MemID = FEDM_GetMemIDOfID(ID);
00792         
00793         switch( MemID )
00794         {
00795         case FEDM_TMPDATA_MEM:
00796                 return FEDM_Base::GetData(ID, Data, DataLen, TmpData, 16);
00797         case FEDM_RFC_EEDATA_MEM:
00798         case FEDM_RFC_RAMDATA_MEM:
00799         case FEDM_MJPDATA_MEM:
00800         case FEDM_SN_MEM:
00801         case FEDM_ID_MEM:
00802         case FEDM_AC_MEM:
00803         case FEDM_PUB_MEM:
00804         case FEDM_SEC_MEM:
00805         case FEDM_CONF_MEM:
00806         case FEDM_DATE_MEM:
00807                 FEDM_RETURN(FEDM_ERROR_UNSUPPORTED);
00808         default:
00809                 FEDM_RETURN(FEDM_ERROR_UNKNOWN_MEM_ID);
00810         }
00811 
00812         FEDM_RETURN(FEDM_OK);
00813 }
00814 
00815         
00816 /***************************************************************************
00817   Begin         :       05.01.2005 / M. Hultsch
00818   Version       :       02.00.01 / 05.01.2005 / M. Hultsch
00819 
00820   Function              :       write a value in specified memory
00821 
00822   Parameter             :       char* ID        -       parameter identifier
00823                                         bool Data       -       value
00824 
00825   Return Value  :       FEDM_OK (0) or error code (<0)
00826 ***************************************************************************/
00827 int FEDM_ISCFunctionUnit::SetData( char* ID, bool Data )
00828 {
00829         FEDM_CHK5(ID);
00830 
00831         // extract MemID
00832         int MemID = FEDM_GetMemIDOfID(ID);
00833         
00834         switch( MemID )
00835         {
00836         case FEDM_TMPDATA_MEM:
00837                 return FEDM_Base::SetData(ID, Data, TmpData, 16);
00838         case FEDM_RFC_EEDATA_MEM:               
00839         case FEDM_RFC_RAMDATA_MEM:              
00840         case FEDM_MJPDATA_MEM:
00841         case FEDM_SN_MEM:
00842         case FEDM_ID_MEM:
00843         case FEDM_AC_MEM:                       
00844         case FEDM_PUB_MEM:                      
00845         case FEDM_SEC_MEM:                      
00846         case FEDM_CONF_MEM:             
00847         case FEDM_DATE_MEM:
00848                 FEDM_RETURN(FEDM_ERROR_UNSUPPORTED);
00849         default:
00850                 FEDM_RETURN(FEDM_ERROR_UNKNOWN_MEM_ID);
00851         }
00852 
00853         FEDM_RETURN(FEDM_OK);
00854 }
00855 
00856 /***************************************************************************
00857   Begin         :       05.01.2005 / M. Hultsch
00858   Version       :       02.00.01 / 05.01.2005 / M. Hultsch
00859 
00860   Function              :       write a value in specified memory
00861 
00862   Parameter             :       char* ID        -       parameter identifier
00863                                         BOOL Data       -       value
00864 
00865   Return Value  :       FEDM_OK (0) or error code (<0)
00866 ***************************************************************************/
00867 #if defined(_FEDM_MFC_SUPPORT) //|| defined(__BORLANDC__)
00868 int FEDM_ISCFunctionUnit::SetData( char* ID, BOOL Data )
00869 {
00870         FEDM_CHK5(ID);
00871 
00872         // extract MemID
00873         int MemID = FEDM_GetMemIDOfID(ID);
00874         
00875         switch( MemID )
00876         {
00877         case FEDM_TMPDATA_MEM:
00878                 return FEDM_Base::SetData(ID, Data, TmpData, 16);
00879         case FEDM_RFC_EEDATA_MEM:               
00880         case FEDM_RFC_RAMDATA_MEM:              
00881         case FEDM_MJPDATA_MEM:
00882         case FEDM_SN_MEM:
00883         case FEDM_ID_MEM:
00884         case FEDM_AC_MEM:                       
00885         case FEDM_PUB_MEM:                      
00886         case FEDM_SEC_MEM:                      
00887         case FEDM_CONF_MEM:             
00888         case FEDM_DATE_MEM:
00889                 FEDM_RETURN(FEDM_ERROR_UNSUPPORTED);
00890         default:
00891                 FEDM_RETURN(FEDM_ERROR_UNKNOWN_MEM_ID);
00892         }
00893 
00894         FEDM_RETURN(FEDM_OK);
00895 }
00896 #endif
00897 
00898 /***************************************************************************
00899   Begin         :       05.01.2005 / M. Hultsch
00900   Version       :       02.00.01 / 05.01.2005 / M. Hultsch
00901 
00902   Function              :       write a value in specified memory
00903 
00904   Parameter             :       char* ID        -       parameter identifier
00905                                         unsigned char Data      -       value
00906 
00907   Return Value  :       FEDM_OK (0) or error code (<0)
00908 ***************************************************************************/
00909 int FEDM_ISCFunctionUnit::SetData( char* ID, unsigned char Data )
00910 {
00911         FEDM_CHK5(ID);
00912 
00913         // extract MemID
00914         int MemID = FEDM_GetMemIDOfID(ID);
00915         
00916         switch( MemID )
00917         {
00918         case FEDM_TMPDATA_MEM:
00919                 return FEDM_Base::SetData(ID, Data, TmpData, 16);
00920         case FEDM_RFC_EEDATA_MEM:               
00921         case FEDM_RFC_RAMDATA_MEM:              
00922         case FEDM_MJPDATA_MEM:
00923         case FEDM_SN_MEM:
00924         case FEDM_ID_MEM:
00925         case FEDM_AC_MEM:                       
00926         case FEDM_PUB_MEM:                      
00927         case FEDM_SEC_MEM:                      
00928         case FEDM_CONF_MEM:             
00929         case FEDM_DATE_MEM:
00930                 FEDM_RETURN(FEDM_ERROR_UNSUPPORTED);
00931         default:
00932                 FEDM_RETURN(FEDM_ERROR_UNKNOWN_MEM_ID);
00933         }
00934 
00935         FEDM_RETURN(FEDM_OK);
00936 }
00937 
00938 /***************************************************************************
00939   Begin         :       05.01.2005 / M. Hultsch
00940   Version       :       02.00.01 / 05.01.2005 / M. Hultsch
00941 
00942   Function              :       write a value in specified memory
00943 
00944   Parameter             :       char* ID        -       parameter identifier
00945                                         unsigned char* Data     -       pointer to value
00946                                         int Cnt         -       length of Data
00947 
00948   Return Value  :       FEDM_OK (0) or error code (<0)
00949 ***************************************************************************/
00950 int FEDM_ISCFunctionUnit::SetData( char* ID, unsigned char* Data, int Cnt )
00951 {
00952         FEDM_CHK5(ID);
00953 
00954         // extract MemID
00955         int MemID = FEDM_GetMemIDOfID(ID);
00956         
00957         switch( MemID )
00958         {
00959         case FEDM_TMPDATA_MEM:
00960                 return FEDM_Base::SetData(ID, Data, Cnt, TmpData, 16);
00961         case FEDM_RFC_EEDATA_MEM:               
00962         case FEDM_RFC_RAMDATA_MEM:              
00963         case FEDM_MJPDATA_MEM:
00964         case FEDM_SN_MEM:
00965         case FEDM_ID_MEM:
00966         case FEDM_AC_MEM:                       
00967         case FEDM_PUB_MEM:                      
00968         case FEDM_SEC_MEM:                      
00969         case FEDM_CONF_MEM:             
00970         case FEDM_DATE_MEM:
00971                 FEDM_RETURN(FEDM_ERROR_UNSUPPORTED);
00972         default:
00973                 FEDM_RETURN(FEDM_ERROR_UNKNOWN_MEM_ID);
00974         }
00975 
00976         FEDM_RETURN(FEDM_OK);
00977 }
00978 
00979 /***************************************************************************
00980   Begin         :       05.01.2005 / M. Hultsch
00981   Version       :       02.00.01 / 05.01.2005 / M. Hultsch
00982 
00983   Function              :       write a value in specified memory
00984 
00985   Parameter             :       char* ID        -       parameter identifier
00986                                         unsigned int Data       -       value
00987 
00988   Return Value  :       FEDM_OK (0) or error code (<0)
00989 ***************************************************************************/
00990 int FEDM_ISCFunctionUnit::SetData( char* ID, unsigned int Data )
00991 {
00992         FEDM_CHK5(ID);
00993 
00994         // extract MemID
00995         int MemID = FEDM_GetMemIDOfID(ID);
00996         
00997         switch( MemID )
00998         {
00999         case FEDM_TMPDATA_MEM:
01000                 return FEDM_Base::SetData(ID, Data, TmpData, 16);
01001         case FEDM_RFC_EEDATA_MEM:               
01002         case FEDM_RFC_RAMDATA_MEM:              
01003         case FEDM_MJPDATA_MEM:
01004         case FEDM_SN_MEM:
01005         case FEDM_ID_MEM:
01006         case FEDM_AC_MEM:                       
01007         case FEDM_PUB_MEM:                      
01008         case FEDM_SEC_MEM:                      
01009         case FEDM_CONF_MEM:             
01010         case FEDM_DATE_MEM:
01011                 FEDM_RETURN(FEDM_ERROR_UNSUPPORTED);
01012         default:
01013                 FEDM_RETURN(FEDM_ERROR_UNKNOWN_MEM_ID);
01014         }
01015 
01016         FEDM_RETURN(FEDM_OK);
01017 }
01018 
01019 /***************************************************************************
01020   Begin         :       05.01.2005 / M. Hultsch
01021   Version       :       02.00.01 / 05.01.2005 / M. Hultsch
01022 
01023   Function              :       write a value in specified memory
01024 
01025   Parameter             :       char* ID                -       parameter identifier
01026                                         __int64 Data    -       value
01027 
01028   Return Value  :       FEDM_OK (0) or error code (<0)
01029 ***************************************************************************/
01030 int FEDM_ISCFunctionUnit::SetData( char* ID, __int64 Data)
01031 {
01032         FEDM_CHK5(ID);
01033 
01034         // extract MemID
01035         int MemID = FEDM_GetMemIDOfID(ID);
01036         
01037         switch( MemID )
01038         {
01039         case FEDM_TMPDATA_MEM:
01040                 return FEDM_Base::SetData(ID, Data, TmpData, 16);
01041         case FEDM_RFC_EEDATA_MEM:               
01042         case FEDM_RFC_RAMDATA_MEM:              
01043         case FEDM_MJPDATA_MEM:
01044         case FEDM_SN_MEM:
01045         case FEDM_ID_MEM:
01046         case FEDM_AC_MEM:                       
01047         case FEDM_PUB_MEM:                      
01048         case FEDM_SEC_MEM:                      
01049         case FEDM_CONF_MEM:             
01050         case FEDM_DATE_MEM:
01051                 FEDM_RETURN(FEDM_ERROR_UNSUPPORTED);
01052         default:
01053                 FEDM_RETURN(FEDM_ERROR_UNKNOWN_MEM_ID);
01054         }
01055 
01056         FEDM_RETURN(FEDM_OK);
01057 }
01058 
01059 /***************************************************************************
01060   Begin         :       05.01.2005 / M. Hultsch
01061   Version       :       02.00.01 / 05.01.2005 / M. Hultsch
01062 
01063   Function              :       write a value in specified memory
01064 
01065   Parameter             :       char* ID                -       parameter identifier
01066                                         CString Data    -       value
01067 
01068   Return Value  :       FEDM_OK (0) or error code (<0)
01069 ***************************************************************************/
01070 #if defined(_FEDM_MFC_SUPPORT) //|| defined(__BORLANDC__)
01071 int FEDM_ISCFunctionUnit::SetData( char* ID, CString Data )
01072 {
01073         FEDM_CHK5(ID);
01074 
01075         // extract MemID
01076         int MemID = FEDM_GetMemIDOfID(ID);
01077         
01078         switch( MemID )
01079         {
01080         case FEDM_TMPDATA_MEM:
01081                 return FEDM_Base::SetData(ID, Data, TmpData, 16);
01082         case FEDM_RFC_EEDATA_MEM:               
01083         case FEDM_RFC_RAMDATA_MEM:              
01084         case FEDM_MJPDATA_MEM:
01085         case FEDM_SN_MEM:
01086         case FEDM_ID_MEM:
01087         case FEDM_AC_MEM:                       
01088         case FEDM_PUB_MEM:                      
01089         case FEDM_SEC_MEM:                      
01090         case FEDM_CONF_MEM:             
01091         case FEDM_DATE_MEM:
01092                 FEDM_RETURN(FEDM_ERROR_UNSUPPORTED);
01093         default:
01094                 FEDM_RETURN(FEDM_ERROR_UNKNOWN_MEM_ID);
01095         }
01096 
01097         FEDM_RETURN(FEDM_OK);
01098 }
01099 #endif
01100 
01101 /***************************************************************************
01102   Begin         :       05.01.2005 / M. Hultsch
01103   Version       :       02.00.01 / 05.01.2005 / M. Hultsch
01104 
01105   Function              :       write a value in specified memory
01106 
01107   Parameter             :       char* ID        -       parameter identifier
01108                                         string Data     -       value
01109 
01110   Return Value  :       FEDM_OK (0) or error code (<0)
01111 ***************************************************************************/
01112 int FEDM_ISCFunctionUnit::SetData( char* ID, string Data )
01113 {
01114         FEDM_CHK5(ID);
01115 
01116         // extract MemID
01117         int MemID = FEDM_GetMemIDOfID(ID);
01118         
01119         switch( MemID )
01120         {
01121         case FEDM_TMPDATA_MEM:
01122                 return FEDM_Base::SetData(ID, Data, TmpData, 16);
01123         case FEDM_RFC_EEDATA_MEM:               
01124         case FEDM_RFC_RAMDATA_MEM:              
01125         case FEDM_MJPDATA_MEM:
01126         case FEDM_SN_MEM:
01127         case FEDM_ID_MEM:
01128         case FEDM_AC_MEM:                       
01129         case FEDM_PUB_MEM:                      
01130         case FEDM_SEC_MEM:                      
01131         case FEDM_CONF_MEM:             
01132         case FEDM_DATE_MEM:
01133                 FEDM_RETURN(FEDM_ERROR_UNSUPPORTED);
01134         default:
01135                 FEDM_RETURN(FEDM_ERROR_UNKNOWN_MEM_ID);
01136         }
01137 
01138         FEDM_RETURN(FEDM_OK);
01139 }
01140 
01141 /***************************************************************************
01142   Begin         :       05.01.2005 / M. Hultsch
01143   Version       :       02.00.01 / 05.01.2005 / M. Hultsch
01144 
01145   Function              :       write a value in specified memory
01146 
01147   Parameter             :       char* ID        -       parameter identifier
01148                                         char* Data      -       pointer to value
01149                                         int DataLen     -       length of Data
01150 
01151   Return Value  :       FEDM_OK (0) or error code (<0)
01152 ***************************************************************************/
01153 int FEDM_ISCFunctionUnit::SetData( char* ID, char* Data, int DataLen )
01154 {
01155         FEDM_CHK5(ID);
01156 
01157         // extract MemID
01158         int MemID = FEDM_GetMemIDOfID(ID);
01159         
01160         switch( MemID )
01161         {
01162         case FEDM_TMPDATA_MEM:
01163                 return FEDM_Base::SetData(ID, Data, DataLen, TmpData, 16);
01164         case FEDM_RFC_EEDATA_MEM:               
01165         case FEDM_RFC_RAMDATA_MEM:              
01166         case FEDM_MJPDATA_MEM:
01167         case FEDM_SN_MEM:
01168         case FEDM_ID_MEM:
01169         case FEDM_AC_MEM:                       
01170         case FEDM_PUB_MEM:                      
01171         case FEDM_SEC_MEM:                      
01172         case FEDM_CONF_MEM:             
01173         case FEDM_DATE_MEM:
01174                 FEDM_RETURN(FEDM_ERROR_UNSUPPORTED);
01175         default:
01176                 FEDM_RETURN(FEDM_ERROR_UNKNOWN_MEM_ID);
01177         }
01178 
01179         FEDM_RETURN(FEDM_OK);
01180 }
01181 
01182 
01184 // functions for child list
01186 
01187 /***************************************************************************
01188   Begin         :       07.01.2005 / M. Hultsch
01189   Version       :       02.06.00 / 28.03.2008 / M. Hultsch
01190 
01191   Function              :       adds a new function unit object to the child list
01192 
01193   Parameter             :       int iOutNo                                      -       output number of function unit
01194                                         FEDM_ISCFunctionUnit* pFU       -       function unit object to be add
01195 
01196   Return Value  :       FEDM_OK (0) or error code (<0)
01197 ***************************************************************************/
01198 int FEDM_ISCFunctionUnit::AddChild(int iOutNo, FEDM_ISCFunctionUnit* pFU)
01199 {
01200         FEDM_CHK5(pFU);
01201 
01202         int iSize = 0;
01203 
01204         switch(m_iFUType)
01205         {
01206         case FEDM_ISC_FU_TYPE_NONE:
01207         case FEDM_ISC_FU_TYPE_ANT:
01208         case FEDM_ISC_FU_TYPE_DAT:
01209                 FEDM_RETURN(FEDM_ERROR_UNSUPPORTED);
01210                 
01211         case FEDM_ISC_FU_TYPE_MUX:
01212         case FEDM_ISC_FU_TYPE_UMUX:
01213                 iSize = (int)m_ChildList.size();
01214                 if(iSize != 8)
01215                         FEDM_RETURN(FEDM_ERROR_NO_TABLE_SIZE);
01216 
01217                 if(iOutNo<1 || iOutNo>8)
01218                         FEDM_RETURN(FEDM_ERROR_PARAMETER);
01219 
01220                 m_ChildList[iOutNo-1] = pFU;
01221                 break;
01222         }
01223 
01224         FEDM_RETURN(FEDM_OK);
01225 }
01226 
01227 /***************************************************************************
01228   Begin         :       07.01.2005 / M. Hultsch
01229   Version       :       02.06.00 / 28.03.2008 / M. Hultsch
01230 
01231   Function              :       removes a function unit object from the child list
01232                                         and deletes the object
01233 
01234   Parameter             :       int iOutNo                                      -       output number of function unit
01235 
01236   Return Value  :       FEDM_OK (0) or error code (<0)
01237 ***************************************************************************/
01238 int FEDM_ISCFunctionUnit::DelChild(int iOutNo)
01239 {
01240         switch(m_iFUType)
01241         {
01242         case FEDM_ISC_FU_TYPE_NONE:
01243         case FEDM_ISC_FU_TYPE_ANT:
01244         case FEDM_ISC_FU_TYPE_DAT:
01245                 FEDM_RETURN(FEDM_ERROR_UNSUPPORTED);
01246                 
01247         case FEDM_ISC_FU_TYPE_MUX:
01248         case FEDM_ISC_FU_TYPE_UMUX:
01249                 if(m_ChildList.size() != 8)
01250                         FEDM_RETURN(FEDM_ERROR_NO_TABLE_SIZE);
01251 
01252                 if(iOutNo<1 || iOutNo>8)
01253                         FEDM_RETURN(FEDM_ERROR_PARAMETER);
01254 
01255                 if(m_ChildList[iOutNo-1] != NULL)
01256                 {
01257                         m_ChildList[iOutNo-1]->DelChildList();
01258                         if(m_bManageChilds)
01259                                 delete m_ChildList[iOutNo-1];
01260                         m_ChildList[iOutNo-1] = NULL;
01261                 }
01262 
01263                 break;
01264         }
01265 
01266         FEDM_RETURN(FEDM_OK);
01267 }
01268 
01269 /***************************************************************************
01270   Begin         :       07.01.2005 / M. Hultsch
01271   Version       :       02.06.00 / 28.03.2008 / M. Hultsch
01272 
01273   Function              :       clears the child list and frees the memory
01274                                         ## recursive function ##
01275 
01276   Parameter             :       -
01277 
01278   Return Value  :       FEDM_OK (0) or error code (<0)
01279 ***************************************************************************/
01280 int FEDM_ISCFunctionUnit::DelChildList()
01281 {
01282         int cnt;
01283 
01284         switch(m_iFUType)
01285         {
01286         case FEDM_ISC_FU_TYPE_NONE:
01287         case FEDM_ISC_FU_TYPE_ANT:
01288         case FEDM_ISC_FU_TYPE_DAT:
01289                 break;
01290                 
01291         case FEDM_ISC_FU_TYPE_MUX:
01292         case FEDM_ISC_FU_TYPE_UMUX:
01293                 if(m_ChildList.size() != 8)
01294                         FEDM_RETURN(FEDM_ERROR_NO_TABLE_SIZE);
01295 
01296                 for(cnt=1; cnt<=8; ++cnt)
01297                         DelChild(cnt);
01298 
01299                 break;
01300         }
01301 
01302         FEDM_RETURN(FEDM_OK);
01303 }
01304 
01305 /***************************************************************************
01306   Begin         :       07.01.2005 / M. Hultsch
01307   Version       :       02.06.00 / 28.03.2008 / M. Hultsch
01308 
01309   Function              :       counts the number of members in the child list
01310 
01311   Parameter             :       -
01312 
01313   Return Value  :       FEDM_OK (0) or error code (<0)
01314 ***************************************************************************/
01315 int FEDM_ISCFunctionUnit::GetChildCount()
01316 {
01317         switch(m_iFUType)
01318         {
01319         case FEDM_ISC_FU_TYPE_NONE:
01320         case FEDM_ISC_FU_TYPE_ANT:
01321         case FEDM_ISC_FU_TYPE_DAT:
01322                 break;
01323                 
01324         case FEDM_ISC_FU_TYPE_MUX:
01325         case FEDM_ISC_FU_TYPE_UMUX:
01326                 if(m_ChildList.size() == 8)
01327                         return 8;
01328 
01329                 break;
01330         }
01331 
01332         return 0;
01333 }
01334 
01335 /***************************************************************************
01336   Begin         :       07.01.2005 / M. Hultsch
01337   Version       :       02.06.00 / 28.03.2008 / M. Hultsch
01338 
01339   Function              :       get a child from the child list
01340 
01341   Parameter             :       int iOutNo      -       output number of function unit
01342 
01343   Return Value  :       pointer to child or NULL
01344 ***************************************************************************/
01345 FEDM_ISCFunctionUnit* FEDM_ISCFunctionUnit::GetChild(int iOutNo)
01346 {
01347         FEDM_ISCFunctionUnit* pFU = NULL;
01348 
01349         switch(m_iFUType)
01350         {
01351         case FEDM_ISC_FU_TYPE_NONE:
01352         case FEDM_ISC_FU_TYPE_ANT:
01353         case FEDM_ISC_FU_TYPE_DAT:
01354                 break;
01355         
01356         case FEDM_ISC_FU_TYPE_MUX:
01357         case FEDM_ISC_FU_TYPE_UMUX:
01358                 if(iOutNo<1 || iOutNo>8)
01359                         return NULL;
01360 
01361                 if(m_ChildList.size() == 8)
01362                         pFU = m_ChildList[iOutNo-1];
01363 
01364                 break;
01365         }
01366 
01367         return pFU;
01368 }
01369 
01370 
01371 
01373 // protected functions
01375 
01376 void FEDM_ISCFunctionUnit::SetLastError(int iError)
01377 {
01378         m_iLastError = iError;
01379 }
01380 
01381 
01382 #endif // #if !defined(_FEDM_NO_FU_SUPPORT)


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