FedmIscPeripheralDevice.cpp
Go to the documentation of this file.
00001 /*-------------------------------------------------------
00002 |                                                       |
00003 |                 FedmIscPeripheralDevice.cpp           |
00004 |                                                       |
00005 ---------------------------------------------------------
00006 
00007 Copyright © 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                  :       Manuel Sahm
00017 Begin                   :       18.02.2010
00018 
00019 Version                 :       03.02.00 / 15.06.2010 / M. Sahm, M. Hultsch
00020 
00021 Operation Systems       :       independent
00022 
00023 Function                        :       classes for OBID i-scan® peripheral devices
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 #if !defined(_FEDM_NO_PD_SUPPORT)
00033 
00034 #include "FedmIscPeripheralDevice.h"
00035 #include "../FEDM_ISCReader.h"
00036 #include "feisc.h"
00037 
00038 
00039 //####################################################################
00040 // class FEDM_ISCPeripheralDevice
00041 //####################################################################
00042 
00044 // Constructor
00046 
00047 FedmIscPeripheralDevice::FedmIscPeripheralDevice(FEDM_ISCReader* pReader, 
00048                                                                                                  unsigned char ucBusAdr, 
00049                                                                                                  unsigned char ucPort, 
00050                                                                                                  int iPDType)
00051 {
00052         m_DeviceInfo.Init();
00053 
00054         // Bus Address of Peripheral Device
00055         m_ucBusAdr              = ucBusAdr;
00056         m_ucPort                = ucPort;
00057 
00058         // reader object for communication
00059         m_pReader               = pReader;
00060 
00061         m_iLastError    = 0;
00062         m_ucLastStatus  = 0;
00063 
00064         m_iPDType               = iPDType;
00065 
00066         
00067         // Reader Handle
00068         m_iReaderHnd    = 0;
00069 
00070 
00071         // Buffer for Data Transfer
00072         memset(&m_ucSendData[0], 0x00, sizeof(m_ucSendData));
00073         m_iSendDataLen  = 0;
00074         memset(&m_ucSendProt[0], 0x00, sizeof(m_ucSendProt));
00075         m_iSendProtLen  = 0 ;
00076         memset(&m_ucRspProt[0], 0x00, sizeof(m_ucRspProt));
00077         m_iRspProtLen   = 0;
00078         memset(&m_ucRspData[0], 0x00, sizeof(m_ucRspData));
00079         m_iRspDataLen   = 0;
00080 
00081         m_iReaderHnd = FEISC_NewReader(0);
00082         FEISC_SetReaderPara(m_iReaderHnd, "FrameSupport","Advanced");
00083 }
00084 
00086 // Destructor
00088 
00089 FedmIscPeripheralDevice::~FedmIscPeripheralDevice()
00090 {
00091         FEISC_DeleteReader(m_iReaderHnd);
00092 }
00093 
00094 
00095 /***************************************************************************
00096   Begin                 :       23.09.2010 / M. Hultsch
00097   
00098   Version               :       03.02.05 / 23.09.2010 / M. Hultsch
00099 
00100   Function                      :       controller reset
00101 
00102   Parameters            :       -
00103 
00104   Return value          :       0:              FEDM_OK
00105                                                 <0:             Error Code
00106 ***************************************************************************/
00107 int FedmIscPeripheralDevice::Reset()
00108 {
00109         int iBack = 0;
00110         unsigned char ucRecBusAddr = 0x00;
00111         unsigned char ucCmd = 0x00;
00112 
00113 
00114         // Build Protocol : CPU-Reset (0x63)
00115         m_iSendProtLen = FEISC_BuildSendProtocol(m_iReaderHnd, m_ucBusAdr, FEISC_CPU_RESET, m_ucSendData , 0, m_ucSendProt, 0);
00116         if(m_iSendProtLen <= 0)
00117         {
00118                 FEDM_RETURN(m_iSendProtLen);
00119         }
00120 
00121         // Send Protocol within Piggyback frame
00122         iBack = FEISC_0x9F_Piggyback_Command(m_pReader->GetReaderHnd(),m_pReader->GetBusAddress(), 0x00, FEDM_ISC_TYPE_ANT_GPC, FEDM_ISC_PD_PORT_TYPE_RS4XX, m_ucSendProt, m_iSendProtLen, m_ucRspProt, &m_iRspProtLen);
00123         if(iBack < 0)
00124         {
00125                 FEDM_RETURN(iBack);
00126         }
00127         else if(iBack == 0x20) // Reader: External Device communication error
00128         {
00129                 FEDM_RETURN(iBack);
00130         }
00131 
00132         // Get Response out of Answer from Protocol [0x63]
00133         iBack = FEISC_SplitRecProtocol(m_iReaderHnd, m_ucRspProt, m_iRspProtLen, &ucRecBusAddr, &ucCmd, m_ucRspData, &m_iRspDataLen, 0);
00134         if(iBack != 0)
00135         {
00136                 FEDM_RETURN(iBack);
00137         }
00138 
00139         FEDM_RETURN(FEDM_OK);
00140 }
00141 
00142 
00143 /***************************************************************************
00144   Begin                 :       18.02.2010 / M. Sahm
00145   
00146   Version               :       03.01.01 / 18.02.2010 / M. Sahm
00147 
00148   Function                      :       Read information out of the Device
00149                                                 [GetReaderInfo - Mode 0x00]
00150                                                 [GetReaderInfo - Mode 0x10]
00151                                                 [GetReaderInfo - Mode 0x40]
00152                                                 [GetReaderInfo - Mode 0x41]
00153                                                 [GetReaderInfo - Mode 0x60]
00154 
00155   Parameters            :       -
00156 
00157   Return value          :       Pointer to FEDM_ISC_PEOPLECOUNTER_INFO structure in case of success
00158                                                 NULL-Pointer in case of error
00159 ***************************************************************************/
00160 FEDM_ISC_PERIPHERAL_DEVICE_INFO* FedmIscPeripheralDevice::ReadInfo()
00161 {
00162         int iBack = 0;
00163         unsigned char ucRecBusAddr = 0x00;
00164         unsigned char ucCmd = 0x00;
00165         unsigned char ucDevice = 0x00;
00166 
00167         m_DeviceInfo.Init();
00168 
00169         switch(m_iPDType)
00170         {
00171                 case FEDM_ISC_PD_TYPE_PEOPLE_COUNTER:
00172                 case FEDM_ISC_PD_TYPE_EXTERNAL_IO:
00173                         ucDevice = FEDM_ISC_TYPE_ANT_GPC;
00174                 break;
00175                         SetLastError(FEDM_ERROR_UNKNOWN_READER_TYPE);
00176                         return NULL;
00177                 default:
00178 
00179                 break;
00180         }
00181 
00182         // ####################################################################################
00183         // new standard protocol - must have all newer readers implemented
00184         // mode: 0x00 - RFC firmware version
00185         // ####################################################################################
00186         //Build the "internal" protocol
00187         m_ucSendData[0] = 0x00;                         //Mode-Byte
00188         // Build Protocol : GetReaderInfo (0x66) and send Protocol within Piggyback frame
00189         FEDM_CHK7(m_iSendProtLen,FEISC_BuildSendProtocol(m_pReader->GetReaderHnd(), m_ucBusAdr, FEISC_READER_INFO, m_ucSendData , 1, m_ucSendProt, 0));
00190         FEDM_CHK7(iBack,FEISC_0x9F_Piggyback_Command(m_pReader->GetReaderHnd(),m_pReader->GetBusAddress(), 0x00, ucDevice, m_ucPort, m_ucSendProt, m_iSendProtLen, m_ucRspProt, &m_iRspProtLen));
00191         if(iBack==0x00 || iBack==0x84 || iBack==0xF1)
00192         {
00193                 // Get Response out of Piggyback frame and then Get Response out of Answer from Protocol 0x66 (GetReaderInfo)
00194                 FEDM_CHK7(iBack, FEISC_SplitRecProtocol(m_pReader->GetReaderHnd(), m_ucRspProt, m_iRspProtLen, &ucRecBusAddr, &ucCmd, m_ucRspData, &m_iRspDataLen, 0));
00195                 if(m_iRspDataLen > 0)
00196                 {
00197                         memcpy(m_DeviceInfo.ucSwVer, m_ucRspData, 13);
00198                         m_DeviceInfo.bIsMode0x00Read = true;
00199                 }
00200         }
00201         else if(iBack==0x19) // crypto processing error
00202         {
00203                 this->SetLastError(iBack);
00204                 return NULL;
00205         }
00206         else if(iBack == 0x20) // Reader: External Device communication error
00207         {
00208                 this->SetLastError(iBack);
00209                 return NULL;
00210         }
00211 
00212         // ####################################################################################
00213         // mode: 0x10 - additional hardware information
00214         // ####################################################################################
00215         //Build the "internal" protocol
00216         m_ucSendData[0] = 0x10;                         //Mode-Byte
00217         // Build Protocol : GetReaderInfo (0x66) and send Protocol within Piggyback frame
00218         FEDM_CHK7(m_iSendProtLen,FEISC_BuildSendProtocol(m_pReader->GetReaderHnd(), m_ucBusAdr, FEISC_READER_INFO, m_ucSendData , 1, m_ucSendProt, 0));
00219         FEDM_CHK7(iBack,FEISC_0x9F_Piggyback_Command(m_pReader->GetReaderHnd(),m_pReader->GetBusAddress(), 0x00, ucDevice, m_ucPort, m_ucSendProt, m_iSendProtLen, m_ucRspProt, &m_iRspProtLen));
00220         if(iBack==0x00 || iBack==0x84 || iBack==0xF1)
00221         {
00222                 // Get Response out of Piggyback frame and then Get Response out of Answer from Protocol 0x66 (GetReaderInfo)
00223                 FEDM_CHK7(iBack, FEISC_SplitRecProtocol(m_pReader->GetReaderHnd(), m_ucRspProt, m_iRspProtLen, &ucRecBusAddr, &ucCmd, m_ucRspData, &m_iRspDataLen, 0));
00224                 if(m_iRspDataLen > 0)
00225                 {
00226                         memcpy(m_DeviceInfo.ucHwInfo, m_ucRspData, 11);
00227                         m_DeviceInfo.bIsMode0x10Read = true;
00228                 }
00229         }
00230 
00231 
00232         // ####################################################################################
00233         // mode: 0x40 - CFG information with read permission (RFU)
00234         // ####################################################################################
00235         //Build the "internal" protocol
00236 /*      m_ucSendData[0] = 0x40;                         //Mode-Byte
00237         // Build Protocol : GetReaderInfo (0x66) and send Protocol within Piggyback frame
00238         FEDM_CHK7(m_iSendProtLen,FEISC_BuildSendProtocol(m_pReader->GetReaderHnd(), m_ucBusAdr, FEISC_READER_INFO, m_ucSendData , 1, m_ucSendProt, 0));
00239         FEDM_CHK7(iBack,FEISC_0x9F_Piggyback_Command(m_pReader->GetReaderHnd(),m_pReader->GetBusAddress(), 0x00, ucDevice, m_ucPort, m_ucSendProt, m_iSendProtLen, m_ucRspProt, &m_iRspProtLen));
00240         if(iBack==0x00 || iBack==0xF1)
00241         {
00242                 // Get Response out of Piggyback frame and then Get Response out of Answer from Protocol 0x66 (GetReaderInfo)
00243                 FEDM_CHK7(iBack, FEISC_SplitRecProtocol(m_pReader->GetReaderHnd(), m_ucRspProt, m_iRspProtLen, &ucRecBusAddr, &ucCmd, m_ucRspData, &m_iRspDataLen, 0));
00244                 if(m_iRspDataLen > 0)
00245                 {
00246                         memcpy(m_DeviceInfo.ucNoOfCfgPages, m_ucRspData, 2);
00247                         unsigned int uiPageCount = ((m_DeviceInfo.ucNoOfCfgPages[0]<<8) + m_DeviceInfo.ucNoOfCfgPages[1]) / 8;
00248                         if( ((m_DeviceInfo.ucNoOfCfgPages[0]<<8) + m_DeviceInfo.ucNoOfCfgPages[1]) % 8 )
00249                                 uiPageCount++;
00250                         memcpy(m_DeviceInfo.ucCfgReadPermissions, &m_ucRspData[2], uiPageCount);
00251                         m_DeviceInfo.bIsMode0x40Read = true;
00252                         }
00253         }*/
00254 
00255 
00256         // ####################################################################################
00257         // mode: 0x41 - CFG information with write permission (RFU)
00258         // ####################################################################################
00259         //Build the "internal" protocol
00260 /*      m_ucSendData[0] = 0x41;                         //Mode-Byte
00261         // Build Protocol : GetReaderInfo (0x66) and send Protocol within Piggyback frame
00262         FEDM_CHK7(m_iSendProtLen,FEISC_BuildSendProtocol(m_pReader->GetReaderHnd(), m_ucBusAdr, FEISC_READER_INFO, m_ucSendData , 1, m_ucSendProt, 0));
00263         FEDM_CHK7(iBack,FEISC_0x9F_Piggyback_Command(m_pReader->GetReaderHnd(),m_pReader->GetBusAddress(), 0x00, ucDevice, m_ucPort, m_ucSendProt, m_iSendProtLen, m_ucRspProt, &m_iRspProtLen));
00264         if(iBack==0x00 || iBack==0xF1)
00265         {
00266                 // Get Response out of Piggyback frame and then Get Response out of Answer from Protocol 0x66 (GetReaderInfo)
00267                 FEDM_CHK7(iBack, FEISC_SplitRecProtocol(m_pReader->GetReaderHnd(), m_ucRspProt, m_iRspProtLen, &ucRecBusAddr, &ucCmd, m_ucRspData, &m_iRspDataLen, 0));
00268                 if(m_iRspDataLen > 0)
00269                 {
00270                         memcpy(m_DeviceInfo.ucNoOfCfgPages, m_ucRspData, 2);
00271                         unsigned int uiPageCount = ((m_DeviceInfo.ucNoOfCfgPages[0]<<8) + m_DeviceInfo.ucNoOfCfgPages[1]) / 8;
00272                         if( ((m_DeviceInfo.ucNoOfCfgPages[0]<<8) + m_DeviceInfo.ucNoOfCfgPages[1]) % 8 )
00273                                 uiPageCount++;
00274                         memcpy(m_DeviceInfo.ucCfgWritePermissions, &m_ucRspData[2], uiPageCount);
00275                         m_DeviceInfo.bIsMode0x41Read = true;
00276                 }
00277         }*/
00278 
00279 
00280         // ####################################################################################
00281         // mode: 0x60 - input/output capabilities information
00282         // ####################################################################################
00283         //Build the "internal" protocol
00284         m_ucSendData[0] = 0x60;                         //Mode-Byte
00285         // Build Protocol : GetReaderInfo (0x66) and send Protocol within Piggyback frame
00286         FEDM_CHK7(m_iSendProtLen,FEISC_BuildSendProtocol(m_pReader->GetReaderHnd(), m_ucBusAdr, FEISC_READER_INFO, m_ucSendData , 1, m_ucSendProt, 0));
00287         FEDM_CHK7(iBack,FEISC_0x9F_Piggyback_Command(m_pReader->GetReaderHnd(),m_pReader->GetBusAddress(), 0x00, ucDevice, m_ucPort, m_ucSendProt, m_iSendProtLen, m_ucRspProt, &m_iRspProtLen));
00288         if(iBack==0x00 || iBack==0xF1)
00289         {
00290                 // Get Response out of Piggyback frame and then Get Response out of Answer from Protocol 0x66 (GetReaderInfo)
00291                 FEDM_CHK7(iBack, FEISC_SplitRecProtocol(m_pReader->GetReaderHnd(), m_ucRspProt, m_iRspProtLen, &ucRecBusAddr, &ucCmd, m_ucRspData, &m_iRspDataLen, 0));
00292                 if(m_iRspDataLen > 0)
00293                 {
00294                         memcpy(&m_DeviceInfo.ucNoOfInputs, m_ucRspData, 3);
00295                         m_DeviceInfo.bIsMode0x60Read = true;
00296                 }
00297         }
00298 
00299         SetLastError(FEDM_OK);
00300         return &m_DeviceInfo;
00301 }
00302 
00303 /***************************************************************************
00304   Begin                 :       18.02.2010 / M. Sahm
00305   
00306   Version               :       03.01.01 / 18.02.2010 / M. Sahm
00307 
00308   Function                      :       Return the type of the Peripheral Device
00309 
00310   Parameters            :       -
00311 
00312   Return value          :       <int> m_iPDType
00313 ***************************************************************************/
00314 int FedmIscPeripheralDevice::GetPDType()
00315 {
00316         return m_iPDType;
00317 }
00318 
00319 unsigned char FedmIscPeripheralDevice::GetBusAddress()
00320 {
00321         return m_ucBusAdr;
00322 }
00323 
00324 /***************************************************************************
00325   Begin                 :       18.02.2010 / M. Sahm
00326   
00327   Version               :       03.01.01 / 18.02.2010 / M. Sahm
00328 
00329   Function                      :       Get the Reader Object
00330 
00331   Parameters            :       -
00332 
00333   Return value          :       <FEDM_ISCReader> m_pReader
00334 ***************************************************************************/
00335 FEDM_ISCReader* FedmIscPeripheralDevice::GetReaderObject()
00336 {
00337         return m_pReader;
00338 }
00339 
00340 
00342 // miscellaneous functions
00344 
00345 /***************************************************************************
00346   Begin                 :       18.02.2010 / M. Sahm
00347   
00348   Version               :       03.01.01 / 18.02.2010 / M. Sahm
00349 
00350   Function                      :       Get the last error
00351 
00352   Parameters            :       -
00353 
00354   Return value          :       <int> m_iLastError
00355 ***************************************************************************/
00356 int FedmIscPeripheralDevice::GetLastError()
00357 {
00358         return m_iLastError;
00359 }
00360 
00361 
00362 /***************************************************************************
00363   Begin                 :       18.02.2010 / M. Sahm
00364   
00365   Version               :       03.01.01 / 18.02.2010 / M. Sahm
00366 
00367   Function                      :       Get the last status
00368 
00369   Parameters            :       -
00370 
00371   Return value          :       <unsigned char> m_ucLastStatus
00372 ***************************************************************************/
00373 unsigned char FedmIscPeripheralDevice::GetLastStatus()
00374 {
00375         return m_ucLastStatus;
00376 }
00377 
00378 
00379 /***************************************************************************
00380   Begin                 :       18.02.2010 / M. Sahm
00381   
00382   Version               :       03.01.01 / 18.02.2010 / M. Sahm
00383 
00384   Function                      :       Get Error Text from Error Code
00385 
00386   Parameters            :       <int> iErrorCode                        :       Error Code
00387 
00388   Return value          :       <const char*> "Error Text"
00389 ***************************************************************************/
00390 const char* FedmIscPeripheralDevice::GetErrorText(int iErrorCode)
00391 {
00392         if(iErrorCode == 0)
00393         {
00394                 return "OK";
00395         }
00396         else 
00397         {
00398                 // errors from reader controlled libraries
00399                 if(m_pReader != NULL)
00400                 {
00401                         return m_pReader->GetErrorText(iErrorCode);
00402                 }
00403         }
00404 
00405         return "";
00406 }
00407 
00408 
00409 /***************************************************************************
00410   Begin                 :       18.02.2010 / M. Sahm
00411   
00412   Version               :       03.01.01 / 18.02.2010 / M. Sahm
00413 
00414   Function                      :       Get Status Text from Status Code
00415 
00416   Parameters            :       <unsigned char> ucStatus        :       Status Value
00417 
00418   Return value          :       <const char*> "Status Text"
00419 ***************************************************************************/
00420 const char* FedmIscPeripheralDevice::GetStatusText(unsigned char ucStatus)
00421 {
00422         int iBack = 0 ;
00423         static char cStatusText[256];
00424 
00425         // status text from feisc library
00426         iBack = FEISC_GetStatusText(ucStatus, cStatusText);
00427         if(iBack == 0)
00428         {
00429                 return cStatusText;
00430         }
00431         else
00432         {
00433                 return "";
00434         }
00435 }
00436 
00437 
00439 // protected functions
00441 /***************************************************************************
00442   Begin                 :       18.02.2010 / M. Sahm
00443   
00444   Version               :       03.01.01 / 18.02.2010 / M. Sahm
00445 
00446   Function                      :       Set the last error
00447 
00448   Parameters            :       <int> iError                    :       Error Value
00449 
00450   Return value          :       -
00451 ***************************************************************************/
00452 void FedmIscPeripheralDevice::SetLastError(int iError)
00453 {
00454         if(iError < 0)
00455                 m_iLastError = iError;
00456         else
00457                 m_ucLastStatus = (unsigned char)iError;
00458 }
00459 
00460 /***************************************************************************
00461   Begin                 :       29.03.2010 / M. Hultsch
00462   
00463   Version               :       03.01.04 / 29.03.2010 / M. Hultsch
00464 
00465   Function                      :       build the report string after ReadInfo
00466 
00467   Parameters            :       <string&> sReport       :       reference to a string variable
00468 
00469   Return value          :       -
00470 ***************************************************************************/
00471 void FedmIscPeripheralDevice::BuildInfoReport(string& sReport)
00472 {
00473         if(m_DeviceInfo.bIsMode0x00Read)
00474                 Add0x00InfoText(sReport);
00475 
00476         if(m_DeviceInfo.bIsMode0x10Read)
00477                 Add0x10InfoText(sReport);
00478 
00479         if(m_DeviceInfo.bIsMode0x60Read)
00480                 Add0x60InfoText(sReport);
00481 }
00482 
00483 
00484 // version info like [0x65] Software Version
00485 void FedmIscPeripheralDevice::Add0x00InfoText(string& sReport)
00486 {
00487         char cBuffer[64];
00488         unsigned int uiRxBufLen = 0;
00489         unsigned int uiTxBufLen = 0;
00490 
00491         uiRxBufLen              = (m_DeviceInfo.ucRxBufferSize[0]<<8) + m_DeviceInfo.ucRxBufferSize[1];
00492         uiTxBufLen              = (m_DeviceInfo.ucTxBufferSize[0]<<8) + m_DeviceInfo.ucTxBufferSize[1];
00493 
00494 
00495         sReport += "Firmware Version of Peripheral Device:";
00496         sReport += "\r\n";
00497         sprintf(cBuffer, "%02d.%02d.%02d", m_DeviceInfo.ucSwVer[0], m_DeviceInfo.ucSwVer[1], m_DeviceInfo.ucDevVer);
00498 
00499         sReport += "\tSoftware Revision:.....";
00500         sReport += cBuffer;
00501         sReport += "\r\n";
00502         sprintf(cBuffer, "0x%02X", m_DeviceInfo.ucHwType);
00503         sReport += "\tHardware Type:.........";
00504         sReport += cBuffer;
00505         sReport += "\r\n";
00506 
00507         sprintf(cBuffer, "%02d", m_DeviceInfo.ucDeviceType);
00508         sReport += "\tDevice Type:...........";
00509         sReport += cBuffer;
00510         sReport += " (";
00511         switch(m_DeviceInfo.ucDeviceType)
00512         {
00513         case FEDM_ISC_TYPE_ANT_GPC:
00514                 sReport += "People Counter";
00515                 break;
00516 //      case :
00517 //              sReport += "External I/O";
00518 //              break;
00519         }
00520         sReport += ")";
00521         sReport += "\r\n";
00522 
00523         sprintf(cBuffer, "%05d", uiRxBufLen);
00524         sReport += "\tMax. Rx buffer size:...";
00525         sReport += cBuffer;
00526         sReport += "\r\n";
00527         sprintf(cBuffer, "%05d", uiTxBufLen);
00528         sReport += "\tMax. Tx buffer size:...";
00529         sReport += cBuffer;
00530         sReport += "\r\n";
00531 }
00532 
00533 void FedmIscPeripheralDevice::Add0x10InfoText(string& sReport)
00534 {
00535         char cBuffer[64];
00536 
00537         sReport += "\r\n";
00538         sReport += "Hardware Information:";
00539         sReport += "\r\n";
00540         sprintf(cBuffer, "\t0x%02X%02X - 0x%02X%02X - 0x%02X%02X",
00541                                 m_DeviceInfo.ucHwInfo[0],
00542                                 m_DeviceInfo.ucHwInfo[1],
00543                                 m_DeviceInfo.ucDHw[0],
00544                                 m_DeviceInfo.ucDHw[1],
00545                                 m_DeviceInfo.ucAHw[0],
00546                                 m_DeviceInfo.ucAHw[1]);
00547 
00548         sReport += cBuffer;
00549 
00550         sReport += "\r\n";
00551         sReport += "\tSupported Port Types:..";
00552         if(m_DeviceInfo.ucPortTypes & 0x01)
00553         {
00554                 sReport += "Serial";
00555                 if(m_DeviceInfo.ucPortTypes & 0xFE)
00556                         sReport += ", ";
00557         }
00558         if(m_DeviceInfo.ucPortTypes & 0x02)
00559         {
00560                 sReport += "RS4xx";
00561                 if(m_DeviceInfo.ucPortTypes & 0xFC)
00562                 sReport += ", ";
00563         }
00564         if(m_DeviceInfo.ucPortTypes & 0x04)
00565         {
00566                 sReport += "LAN";
00567                 if(m_DeviceInfo.ucPortTypes & 0xF8)
00568                         sReport += ", ";
00569         }
00570         if(m_DeviceInfo.ucPortTypes & 0x08)
00571         {
00572                 sReport += "WLAN";
00573                 if(m_DeviceInfo.ucPortTypes & 0xF0)
00574                         sReport += ", ";
00575         }
00576         if(m_DeviceInfo.ucPortTypes & 0x10)
00577         {
00578                 sReport += "USB";
00579                 if(m_DeviceInfo.ucPortTypes & 0xE0)
00580                         sReport += ", ";
00581         }
00582         if(m_DeviceInfo.ucPortTypes & 0x20)
00583         {
00584                 sReport += "Bluetooth";
00585                 if(m_DeviceInfo.ucPortTypes & 0xC0)
00586                         sReport += ", ";
00587         }
00588         if(m_DeviceInfo.ucPortTypes & 0x80)
00589         {
00590                 sReport += "Discovery";
00591         }
00592 
00593         sReport += "\r\n";
00594 }
00595 
00596 void FedmIscPeripheralDevice::Add0x60InfoText(string& sReport)
00597 {
00598         char cBuffer[64];
00599 
00600         sReport += "\r\n";
00601         sReport += "Input/Output capabilities";
00602         sReport += "\r\n";
00603 
00604         sReport += "\tNumber of Inputs:......";
00605         sprintf(cBuffer, "%d", m_DeviceInfo.ucNoOfInputs);
00606         sReport += cBuffer;
00607         sReport += "\r\n";
00608 
00609         sReport += "\tNumber of Outputs:.....";
00610         sprintf(cBuffer, "%d", m_DeviceInfo.ucNoOfOutputs);
00611         sReport += cBuffer;
00612         sReport += "\r\n";
00613 
00614         sReport += "\tNumber of Relays:......";
00615         sprintf(cBuffer, "%d", m_DeviceInfo.ucNoOfRelays);
00616         sReport += cBuffer;
00617         sReport += "\r\n";
00618 }
00619 
00620 #endif // #if !defined(_FEDM_NO_PD_SUPPORT)


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