| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866 |
- #include "stdafx.h"
- #include "UpsNxr.h"
- #include "CommProcess.h"
- CUPSNxr::CUPSNxr(char *szPath,char *szIniName,int nCommPort, int nAddr,int nRate, int nDataBit,int nStopBit, int nParity,int nInterval)
- {
- #if IS_USE_READMSG_CS
- InitializeCriticalSection( &m_csReadMsg ); //初始化一个临界资源对象
- #endif
- MTVERIFY( m_hSemComm = CreateEvent( NULL, TRUE, TRUE, 0 ) ); //创建或打开一个命名的或无名的事件对象
- for( int i = 0; i < MAX_ADDR; i++ )
- {
- memset(m_szNxr_41Msg[i], 0, sizeof(m_szNxr_41Msg[i]));
- memset(m_szNxr_43Msg[i], 0, sizeof(m_szNxr_43Msg[i]));
- memset(m_szNxr_44Msg[i], 0, sizeof(m_szNxr_44Msg[i]));
- memset(m_szNxr_E1Msg[i], 0, sizeof(m_szNxr_E1Msg[i]));
- memset(m_szNxr_E2Msg[i], 0, sizeof(m_szNxr_E2Msg[i]));
- memset(m_szNxr_E3Msg[i], 0, sizeof(m_szNxr_E3Msg[i]));
- memset(m_szNxr_E7Msg[i], 0, sizeof(m_szNxr_E7Msg[i]));
- m_devOnline[i] = TRUE;
- m_dwOnlineTick[i] = 0;
- }
- }
- CUPSNxr::~CUPSNxr()
- {
- #if IS_USE_READMSG_CS
- DeleteCriticalSection( &m_csReadMsg );
- #endif
- MTVERIFY( CloseHandle( m_hSemComm ) );
- CloseComm();
- }
- BOOL CUPSNxr::NxrOpenComm(int nCommPort, int nAddr, int nRate, int nDataBit, int nStopBit, int nParity, int nInterval)
- {
- BOOL bResult = FALSE;
- bResult = OpenComm( nCommPort, nAddr, nRate, nDataBit, nStopBit, nParity, nInterval );
- //LOG4C((LOG_NOTICE," CUPSNxr::NxrOpenComm"));
- return bResult;
- }
- int CUPSNxr::SendReadRequest(
- char *szPath,
- char *szIniName,
- int nCommPort,
- int nAddr,
- char *szCmd,
- char *szMsg,
- int nReversed1,
- int nReversed2,
- int nReversed3,
- int nReversed4,
- int nReversed5,
- float fReversed1,
- float fReversed2,
- float fReversed3,
- char *szReversed1,
- char *szReversed2,
- char *szReversed3,
- char *szReversed4,
- char *szReversed5 )
- {
- CCommProcess *pComm = FindComm(nCommPort);
- if( pComm == NULL ) return -1;
- int nRet = -1;
- int nIndex(0), nLen(0), IniSendlen(0),iSBit(0), iEBit(0);
- char IniSendCMD[MAX_CMD] = {0}, szDataType[CMD_TYPE] = {0};
- GetIniInfo(szPath,szIniName,szCmd,IniSendCMD,IniSendlen,szDataType,nIndex,nLen,iSBit,iEBit);
- int iCmd = atoi(szCmd + 4);
- if( (strlen(m_szNxr_41Msg[nAddr - 1]) == 0 && (iCmd >= 1 && iCmd <=15)) || iCmd == 1 || //获取系统模拟量量化数据(浮点数)
- ( strlen(m_szNxr_43Msg[nAddr - 1]) == 0 && (iCmd >= 16 && iCmd <=40)) || iCmd == 16 || //获取开关输入状态
- ( strlen(m_szNxr_44Msg[nAddr - 1]) == 0 && (iCmd >= 41 && iCmd <=127)) || iCmd == 41 || //报警量
- (strlen(m_szNxr_E1Msg[nAddr - 1]) == 0 && (iCmd >= 128 && iCmd <=143)) || iCmd == 130 || //E1获取自定义模拟量量化数据1(浮点数,厂家扩展模拟量1)
- (strlen(m_szNxr_E2Msg[nAddr - 1]) == 0 && (iCmd >= 144 && iCmd <=163)) || iCmd == 146 || //获取自定义模拟量量化数据2(浮点数,厂家扩展模拟量2)
- (strlen(m_szNxr_E3Msg[nAddr - 1]) == 0 && (iCmd >= 164 && iCmd <=173)) || iCmd == 164 || //获取自定义模拟量量化数据3(浮点数,厂家扩展模拟量3)
- (strlen(m_szNxr_E7Msg[nAddr - 1]) == 0 && (iCmd >= 174 && iCmd <=183)) || iCmd == 176 //获取自定义模拟量量化数据4(浮点数,厂家扩展模拟量4)
- )
- {
- nRet = GetDeviceParam( nAddr,pComm,szCmd,IniSendCMD,IniSendlen );
- if( nRet != 0 ) return nRet;
- }
- if( GetTickCount() - m_dwOnlineTick[nAddr - 1] > 60 *1000 && m_dwOnlineTick[nAddr - 1] > 0 )
- m_devOnline[nAddr - 1] = FALSE;
- else if( GetTickCount() - m_dwOnlineTick[nAddr - 1] < 60 *1000 && m_dwOnlineTick[nAddr - 1] > 0 )
- m_devOnline[nAddr - 1] = TRUE;
- if( m_devOnline[nAddr - 1] == FALSE )
- return -1;
- nRet = GetNxr_41VarMsg(nAddr, szCmd, szMsg, nIndex, nLen, szDataType, iSBit, iEBit);
- nRet = GetNxr_43VarMsg(nAddr, szCmd, szMsg, nIndex, nLen, szDataType, iSBit, iEBit);
- nRet = GetNxr_44VarMsg(nAddr, szCmd, szMsg, nIndex, nLen, szDataType, iSBit, iEBit);
- nRet = GetNxr_E1VarMsg(nAddr, szCmd, szMsg, nIndex, nLen, szDataType, iSBit, iEBit);
- nRet = GetNxr_E2VarMsg(nAddr, szCmd, szMsg, nIndex, nLen, szDataType, iSBit, iEBit);
- nRet = GetNxr_E3VarMsg(nAddr, szCmd, szMsg, nIndex, nLen, szDataType, iSBit, iEBit);
- nRet = GetNxr_E7VarMsg(nAddr, szCmd, szMsg, nIndex, nLen, szDataType, iSBit, iEBit);
-
- // if (iCmd == 43)
- // LOG4C((LOG_NOTICE, "%s = %s", szCmd, szMsg));
- return nRet;
- }
- int CUPSNxr::GetDeviceParam(int nAddr,CCommProcess *pComm,char *szCmd,char *IniSendCMD, const int &IniSendlen)
- {
- int nRet = -1;
- nRet = Send_ReadDeviceData(nAddr,pComm,szCmd,IniSendCMD,IniSendlen);
- if( nRet != 0 )
- {
- LOG4C((LOG_NOTICE,"RequestStatus::Error"));
- return nRet;
- }
- nRet = Recv_ReadDeviceData(nAddr,pComm,szCmd);
- return nRet;
- }
- int CUPSNxr::Send_ReadDeviceData(int nAddr,CCommProcess *pComm,char *szCmd, const char *IniSendCMD,const int &IniSendlen)
- {
- int nRet = -1;
- #if DEBUG_NXR
- char chLength[4] = {0};
- char chChkSum[5] = {0};
- if ((strcmp(IniSendCMD, "43") == 0) || (strcmp(IniSendCMD, "44") == 0) || (strcmp(IniSendCMD, "E3") == 0))
- {
- int iLen = sizeof(REQUESTNOCOMMD);
- REQUESTNOCOMMD RequestPara;
- memset( &RequestPara, 0, iLen );
- //起始位
- RequestPara.Start = 0x7E;
- //通讯协议版本
- RequestPara.Version[0] = 0x31;
- RequestPara.Version[1] = 0x30;
- //RequestPara.Version[1] = 0x32;
- //设备地址描述
- RequestPara.Address[0] = ByteToAscii((nAddr>>4) & 0x0f);
- RequestPara.Address[1] = ByteToAscii(nAddr & 0x0f);
- //Cid1
- RequestPara.Cid1[0] = 0x32;
- RequestPara.Cid1[1] = 0x41;
- //Cid2
- memcpy(RequestPara.Cid2, IniSendCMD, 2);
-
- RequestPara.Lenth[1] = 0x30;
- RequestPara.Lenth[2] = 0x30;
- RequestPara.Lenth[3] = 0x30;
- RequestPara.Lenth[0] = ByteToAscii(GetLengthSum(RequestPara.Lenth));
- BYTE *pDataBuf = new BYTE[ iLen - sizeof(RequestPara.chkSum) - 1 ];
- memset(pDataBuf, 0, iLen - sizeof(RequestPara.chkSum) - 1 );
- memcpy(pDataBuf, &RequestPara, iLen - sizeof(RequestPara.chkSum) - 1 );
- GetCheckSum((char *)pDataBuf + 1, chChkSum, iLen - sizeof(RequestPara.chkSum) - 2 );
- RequestPara.chkSum[0] = chChkSum[0];
- RequestPara.chkSum[1] = chChkSum[1];
- RequestPara.chkSum[2] = chChkSum[2];
- RequestPara.chkSum[3] = chChkSum[3];
- //结束符
- RequestPara.End = 0x0D;
- if( WaitForSingleObject( m_hSemComm, 0 ) == WAIT_OBJECT_0 ) // 有信号才写串口
- {
- int nDataLen = (int)sizeof(RequestPara);
- ResetEvent( m_hSemComm );
- int nResult = pComm->Write((BYTE *)&RequestPara, nDataLen);
- if( nResult == nDataLen )
- {
- }
- else
- {
- delete []pDataBuf;
- SetEvent( m_hSemComm );
- return EER_CODE_NXR_COM_WRITE_DATA;
- }
- }
- else
- {
- //LOG4C((LOG_NOTICE, "m_hSemComm no single"));
- delete []pDataBuf;
- return ERR_CODE_NXR_COM_BUSY;
- }
- delete[]pDataBuf;
- }
- else if ((strcmp(IniSendCMD, "41") == 0) || (strcmp(IniSendCMD, "E1") == 0) || (strcmp(IniSendCMD, "E2") == 0) )
- {
- int iLen = sizeof(REQUESTTWOCOMMD);
- REQUESTTWOCOMMD RequestPara;
- memset( &RequestPara, 0, iLen );
- //起始位
- RequestPara.Start = 0x7E;
- //通讯协议版本
- RequestPara.Version[0] = 0x31;
- RequestPara.Version[1] = 0x30;
- //设备地址描述
- RequestPara.Address[0] = ByteToAscii((nAddr>>4) & 0x0f);
- RequestPara.Address[1] = ByteToAscii(nAddr & 0x0f);
- //Cid1
- RequestPara.Cid1[0] = 0x32;
- RequestPara.Cid1[1] = 0x41;
- //Cid2
- memcpy(RequestPara.Cid2, IniSendCMD, 2);
- RequestPara.Lenth[1] = 0x30;
- RequestPara.Lenth[2] = 0x30;
- RequestPara.Lenth[3] = 0x32;
- RequestPara.Lenth[0] = ByteToAscii(GetLengthSum(RequestPara.Lenth));
- RequestPara.GroupInfo[0] = 0x30;
- RequestPara.GroupInfo[1] = 0x30;
- BYTE *pDataBuf = new BYTE[ iLen - sizeof(RequestPara.chkSum) - 1 ];
- memset(pDataBuf, 0, iLen - sizeof(RequestPara.chkSum) - 1 );
- memcpy(pDataBuf, &RequestPara, iLen - sizeof(RequestPara.chkSum) - 1 );
- GetCheckSum((char *)pDataBuf + 1, chChkSum, iLen - sizeof(RequestPara.chkSum) - 2 );
- RequestPara.chkSum[0] = chChkSum[0];
- RequestPara.chkSum[1] = chChkSum[1];
- RequestPara.chkSum[2] = chChkSum[2];
- RequestPara.chkSum[3] = chChkSum[3];
- //结束符
- RequestPara.End = 0x0D;
- //LOG4C_HEX_DUMP((LOG_NOTICE, (char *)&RequestPara, sizeof(RequestPara)));
- if( WaitForSingleObject( m_hSemComm, 0 ) == WAIT_OBJECT_0 ) // 有信号才写串口
- {
- int nDataLen = (int)sizeof(RequestPara);
- ResetEvent( m_hSemComm );
- int nResult = pComm->Write((BYTE *)&RequestPara, nDataLen);
- if( nResult == nDataLen )
- {
- }
- else
- {
- delete []pDataBuf;
- SetEvent( m_hSemComm );
- return EER_CODE_NXR_COM_WRITE_DATA;
- }
- }
- else
- {
- //LOG4C((LOG_NOTICE, "m_hSemComm no single"));
- delete []pDataBuf;
- return ERR_CODE_NXR_COM_BUSY;
- }
- delete[]pDataBuf;
- }
- else if (strcmp(IniSendCMD, "E7") == 0)
- {
- int iLen = sizeof(REQUESTFOURCOMMD);
- REQUESTFOURCOMMD RequestPara;
- memset( &RequestPara, 0, iLen );
- //起始位
- RequestPara.Start = 0x7E;
- //通讯协议版本
- RequestPara.Version[0] = 0x31;
- RequestPara.Version[1] = 0x30;
- //设备地址描述
- RequestPara.Address[0] = ByteToAscii((nAddr>>4) & 0x0f);
- RequestPara.Address[1] = ByteToAscii(nAddr & 0x0f);
- //Cid1
- RequestPara.Cid1[0] = 0x32;
- RequestPara.Cid1[1] = 0x41;
- //Cid2
- memcpy(RequestPara.Cid2, IniSendCMD, 2);
- RequestPara.Lenth[1] = 0x30;
- RequestPara.Lenth[2] = 0x30;
- RequestPara.Lenth[3] = 0x34;
- RequestPara.Lenth[0] = ByteToAscii(GetLengthSum(RequestPara.Lenth));
-
- RequestPara.GroupInfo[0] = 0x30;
- RequestPara.GroupInfo[1] = 0x31;
- RequestPara.GroupInfo[2] = 0x30;
- RequestPara.GroupInfo[3] = 0x30;
- BYTE *pDataBuf = new BYTE[ iLen - sizeof(RequestPara.chkSum) - 1 ];
- memset(pDataBuf, 0, iLen - sizeof(RequestPara.chkSum) - 1 );
- memcpy(pDataBuf, &RequestPara, iLen - sizeof(RequestPara.chkSum) - 1 );
- GetCheckSum((char *)pDataBuf + 1, chChkSum, iLen - sizeof(RequestPara.chkSum) - 2 );
- RequestPara.chkSum[0] = chChkSum[0];
- RequestPara.chkSum[1] = chChkSum[1];
- RequestPara.chkSum[2] = chChkSum[2];
- RequestPara.chkSum[3] = chChkSum[3];
- //结束符
- RequestPara.End = 0x0D;
- //LOG4C_HEX_DUMP((LOG_NOTICE, (char *)&RequestPara, sizeof(RequestPara)));
- if( WaitForSingleObject( m_hSemComm, 0 ) == WAIT_OBJECT_0 ) // 有信号才写串口
- {
- int nDataLen = (int)sizeof(RequestPara);
- ResetEvent( m_hSemComm );
- int nResult = pComm->Write((BYTE *)&RequestPara, nDataLen);
- if( nResult == nDataLen )
- {
- }
- else
- {
- delete []pDataBuf;
- SetEvent( m_hSemComm );
- return EER_CODE_NXR_COM_WRITE_DATA;
- }
- }
- else
- {
- //LOG4C((LOG_NOTICE, "m_hSemComm no single"));
- delete []pDataBuf;
- return ERR_CODE_NXR_COM_BUSY;
- }
- delete[]pDataBuf;
- }
- #endif
- return 0;
- }
- int CUPSNxr::Recv_ReadDeviceData(int nAddr,CCommProcess *pComm,char *szCmd)
- {
- #if DEBUG_NXR
- int nReceiveLen = 0;
- int nProcessLen = 0;
- int nReadLen = 0;
- RESPONSE_STRUCT structResponse;
- memset( &structResponse, 0, sizeof(RESPONSE_STRUCT) );
- nReceiveLen = sizeof(RESPONSE_STRUCT);
- char *pBuffer = new char[ nReceiveLen ];
- memset(pBuffer, 0, nReceiveLen);
- nReadLen = pComm->Read((BYTE *)pBuffer,nReceiveLen);
- //if ( strcmp(szCmd, "cmd-41") == 0)
- //{
- // LOG4C((LOG_NOTICE,"UPS-Nxr : %s",pBuffer));
- //}
-
- if( nReadLen <= 0)
- {
- SetEvent( m_hSemComm );
- if( pBuffer != NULL)
- {
- delete[] pBuffer;
- pBuffer = NULL;
- }
- return ERR_CODE_NXR_COM_READ_NO_DATA;
- }
- if (LengthCheck(pBuffer) != 0)
- {
- SetEvent(m_hSemComm);
- if (pBuffer != NULL)
- {
- delete [] pBuffer;
- pBuffer = NULL;
- }
- return ERR_CODE_RTN_LCHKSUM_ERROR;
- }
- if (!ChkSumCheck(pBuffer, nReadLen))
- {
- SetEvent(m_hSemComm);
- if (pBuffer != NULL)
- {
- delete [] pBuffer;
- pBuffer = NULL;
- }
- return ERR_CODE_RTN_CHKSUM_ERROR; //校验码校验出错
- }
- if (RtnCheck(pBuffer) != 0)
- {
- SetEvent(m_hSemComm);
- if (pBuffer != NULL)
- {
- delete [] pBuffer;
- pBuffer = NULL;
- }
- return ERR_CODE_RTN_CHKSUM_RTN_ERROR; //RTN校验出错
- }
- SetNxr_41VarMsg(nAddr, szCmd, pBuffer);
- SetNxr_43VarMsg(nAddr, szCmd, pBuffer);
- SetNxr_44VarMsg(nAddr, szCmd, pBuffer);
- SetNxr_E1VarMsg(nAddr, szCmd, pBuffer);
- SetNxr_E2VarMsg(nAddr, szCmd, pBuffer);
- SetNxr_E3VarMsg(nAddr, szCmd, pBuffer);
- SetNxr_E7VarMsg(nAddr, szCmd, pBuffer);
- m_dwOnlineTick[nAddr - 1] = GetTickCount();
- // 设置串口等待事件为有信号
- SetEvent( m_hSemComm );
- if( pBuffer != NULL)
- {
- delete[] pBuffer;
- pBuffer = NULL;
- }
- #else
- SimulationCommData(nAddr);
- #endif
- return 0;
- }
- int CUPSNxr::GetNxr_41VarMsg(int nAddr,char *szCmd,char *szMsg,int &nIndex,int &nLen,char *szType,int iSBit,int iEBit)
- {
- int nRet = 0;
- int iCmd = atoi(szCmd + 4);
- if( iCmd >= 1 && iCmd <= 15)
- {
- #if IS_USE_READMSG_CS
- EnterCriticalSection( &m_csReadMsg );
- #endif
- DataConversion(szType, m_szNxr_41Msg[nAddr - 1] + nIndex, szMsg, nLen, iSBit, iEBit);
- #if IS_USE_READMSG_CS
- LeaveCriticalSection(&m_csReadMsg);
- #endif
- nRet = 0;
- }
- return nRet;
- }
- int CUPSNxr::GetNxr_43VarMsg(int nAddr,char *szCmd,char *szMsg,int &nIndex,int &nLen,char *szType,int iSBit,int iEBit)
- {
- int nRet = 0;
- int iCmd = atoi(szCmd + 4);
- if( iCmd >= 16 && iCmd <= 40)
- {
- #if IS_USE_READMSG_CS
- EnterCriticalSection( &m_csReadMsg );
- #endif
- DataConversion(szType, m_szNxr_43Msg[nAddr - 1] + nIndex, szMsg, nLen, 0, 0);
- #if IS_USE_READMSG_CS
- LeaveCriticalSection(&m_csReadMsg);
- #endif
- nRet = 0;
- }
- return nRet;
- }
- int CUPSNxr::GetNxr_44VarMsg(int nAddr,char *szCmd,char *szMsg,int &nIndex,int &nLen,char *szType,int iSBit,int iEBit)
- {
- int nRet = 0;
- int iCmd = atoi(szCmd + 4);
- if( iCmd >= 41 && iCmd <= 127)
- {
- #if IS_USE_READMSG_CS
- EnterCriticalSection( &m_csReadMsg );
- #endif
- DataConversion(szType, m_szNxr_44Msg[nAddr - 1] + nIndex, szMsg, nLen, 0, 0);
- #if IS_USE_READMSG_CS
- LeaveCriticalSection(&m_csReadMsg);
- #endif
- nRet = 0;
- }
- return nRet;
- }
- int CUPSNxr::GetNxr_E1VarMsg(int nAddr,char *szCmd,char *szMsg,int &nIndex,int &nLen,char *szType,int iSBit,int iEBit)
- {
- int nRet = 0;
- int iCmd = atoi(szCmd + 4);
- if( iCmd >= 128 && iCmd <= 143)
- {
- #if IS_USE_READMSG_CS
- EnterCriticalSection( &m_csReadMsg );
- #endif
- DataConversion(szType, m_szNxr_E1Msg[nAddr - 1] + nIndex, szMsg, nLen, 0, 0);
- #if IS_USE_READMSG_CS
- LeaveCriticalSection(&m_csReadMsg);
- #endif
- nRet = 0;
- }
- return nRet;
- }
- int CUPSNxr::GetNxr_E2VarMsg(int nAddr,char *szCmd,char *szMsg,int &nIndex,int &nLen,char *szType,int iSBit,int iEBit)
- {
- int nRet = 0;
- int iCmd = atoi(szCmd + 4);
- if( iCmd >= 144 && iCmd <= 163)
- {
- #if IS_USE_READMSG_CS
- EnterCriticalSection( &m_csReadMsg );
- #endif
- DataConversion(szType, m_szNxr_E2Msg[nAddr - 1] + nIndex, szMsg, nLen, 0, 0);
- #if IS_USE_READMSG_CS
- LeaveCriticalSection(&m_csReadMsg);
- #endif
- nRet = 0;
- }
- return nRet;
- }
- int CUPSNxr::GetNxr_E3VarMsg(int nAddr,char *szCmd,char *szMsg,int &nIndex,int &nLen,char *szType,int iSBit,int iEBit)
- {
- int nRet = 0;
- int iCmd = atoi(szCmd + 4);
- if( iCmd >= 164 && iCmd <= 173)
- {
- #if IS_USE_READMSG_CS
- EnterCriticalSection( &m_csReadMsg );
- #endif
- DataConversion(szType, m_szNxr_E3Msg[nAddr - 1] + nIndex, szMsg, nLen, 0, 0);
- #if IS_USE_READMSG_CS
- LeaveCriticalSection(&m_csReadMsg);
- #endif
- nRet = 0;
- }
- return nRet;
- }
- int CUPSNxr::GetNxr_E7VarMsg(int nAddr,char *szCmd,char *szMsg,int &nIndex,int &nLen,char *szType,int iSBit,int iEBit)
- {
- int nRet = 0;
- int iCmd = atoi(szCmd + 4);
- if( iCmd >= 174 && iCmd <= 183)
- {
- #if IS_USE_READMSG_CS
- EnterCriticalSection( &m_csReadMsg );
- #endif
- DataConversion(szType, m_szNxr_E7Msg[nAddr - 1] + nIndex, szMsg, nLen, 0, 0);
- #if IS_USE_READMSG_CS
- LeaveCriticalSection(&m_csReadMsg);
- #endif
- nRet = 0;
- }
- return nRet;
- }
- void CUPSNxr::SetNxr_41VarMsg( int nAddr, char *szCmd, char *pBuffer)
- {
- int iCmd = atoi(szCmd + 4);
- if( iCmd >= 1 && iCmd <= 15)
- {
- #if IS_USE_READMSG_CS
- EnterCriticalSection( &m_csReadMsg );
- #endif
- memcpy(m_szNxr_41Msg[nAddr - 1], pBuffer, sizeof(m_szNxr_41Msg[nAddr - 1]));
- #if IS_USE_READMSG_CS
- LeaveCriticalSection(&m_csReadMsg);
- #endif
- }
- }
- void CUPSNxr::SetNxr_43VarMsg( int nAddr, char *szCmd, char *pBuffer)
- {
- int iCmd = atoi(szCmd + 4);
- if( iCmd >= 16 && iCmd <= 40)
- {
- #if IS_USE_READMSG_CS
- EnterCriticalSection( &m_csReadMsg );
- #endif
- memcpy(m_szNxr_43Msg[nAddr - 1], pBuffer, sizeof(m_szNxr_43Msg[nAddr - 1]));
- #if IS_USE_READMSG_CS
- LeaveCriticalSection(&m_csReadMsg);
- #endif
- }
- }
- void CUPSNxr::SetNxr_44VarMsg( int nAddr, char *szCmd, char *pBuffer)
- {
- int iCmd = atoi(szCmd + 4);
- if( iCmd >= 41 && iCmd <= 127)
- {
- #if IS_USE_READMSG_CS
- EnterCriticalSection( &m_csReadMsg );
- #endif
- //memcpy(m_szNxr_44Msg[nAddr - 1], pBuffer + 10, sizeof(m_szNxr_44Msg[nAddr - 1])); //Z.t国贸时的UPS处理;
- memcpy(m_szNxr_44Msg[nAddr - 1], pBuffer , sizeof(m_szNxr_44Msg[nAddr - 1])); //Z.t思明公安局有时的UPS处理;
- #if IS_USE_READMSG_CS
- LeaveCriticalSection(&m_csReadMsg);
- #endif
- }
- }
- void CUPSNxr::SetNxr_E1VarMsg( int nAddr, char *szCmd, char *pBuffer)
- {
- int iCmd = atoi(szCmd + 4);
- if( iCmd >= 128 && iCmd <= 143)
- {
- #if IS_USE_READMSG_CS
- EnterCriticalSection( &m_csReadMsg );
- #endif
- memcpy(m_szNxr_E1Msg[nAddr - 1], pBuffer, sizeof(m_szNxr_E1Msg[nAddr - 1]));
- #if IS_USE_READMSG_CS
- LeaveCriticalSection(&m_csReadMsg);
- #endif
- }
- }
- void CUPSNxr::SetNxr_E2VarMsg( int nAddr, char *szCmd, char *pBuffer)
- {
- int iCmd = atoi(szCmd + 4);
- if( iCmd >= 144 && iCmd <= 163)
- {
- #if IS_USE_READMSG_CS
- EnterCriticalSection( &m_csReadMsg );
- #endif
- memcpy(m_szNxr_E2Msg[nAddr - 1], pBuffer, sizeof(m_szNxr_E2Msg[nAddr - 1]));
- #if IS_USE_READMSG_CS
- LeaveCriticalSection(&m_csReadMsg);
- #endif
- }
- }
- void CUPSNxr::SetNxr_E3VarMsg( int nAddr, char *szCmd, char *pBuffer)
- {
- int iCmd = atoi(szCmd + 4);
- if( iCmd >= 164 && iCmd <= 173)
- {
- #if IS_USE_READMSG_CS
- EnterCriticalSection( &m_csReadMsg );
- #endif
- memcpy(m_szNxr_E3Msg[nAddr - 1], pBuffer, sizeof(m_szNxr_E3Msg[nAddr - 1]));
- #if IS_USE_READMSG_CS
- LeaveCriticalSection(&m_csReadMsg);
- #endif
- }
- }
- void CUPSNxr::SetNxr_E7VarMsg( int nAddr, char *szCmd, char *pBuffer)
- {
- int iCmd = atoi(szCmd + 4);
- if( iCmd >= 174 && iCmd <= 183)
- {
- #if IS_USE_READMSG_CS
- EnterCriticalSection( &m_csReadMsg );
- #endif
- memcpy(m_szNxr_E7Msg[nAddr - 1], pBuffer, sizeof(m_szNxr_E7Msg[nAddr - 1]));
- #if IS_USE_READMSG_CS
- LeaveCriticalSection(&m_csReadMsg);
- #endif
- }
- }
- WORD CUPSNxr::RtnCheck(char Msg[VAR_MSG])
- {
- char buffer[3] = {0};
- int j = 0;
- for (int i = 7; i < 9; i++)
- {
- buffer[j++] = Msg[i];
- }
- buffer[j] = '\0';
- if (strcmp(buffer,"00") == 0)
- {
- return 0;
- }
- else if (strcmp(buffer,"01") == 0)
- {
- return ERR_CODE_RTN_VER_ERROR;
- }
- else if (strcmp(buffer,"02") == 0)
- {
- return ERR_CODE_RTN_CHKSUM_ERROR;
- }
- else if (strcmp(buffer,"03") == 0)
- {
- return ERR_CODE_RTN_LCHKSUM_ERROR;
- }
- else if (strcmp(buffer,"04") == 0)
- {
- return ERR_CODE_RTN_CID_ERROR;
- }
- else if (strcmp(buffer,"05") == 0)
- {
- return ERR_CODE_RTN_COMMAND_FORMAT;
- }
- else if (strcmp(buffer,"06") == 0)
- {
- return ERR_CODE_RTN_INVALID_LIMIT;
- }
- else if (strcmp(buffer,"10") == 0)
- {
- return ERR_CODE_RTN_OPERATE_FAIL;
- }
-
- return 0;
- }
- UINT CUPSNxr::GetCheckSum(char *pBuf, char chDest[5], int len)
- {
- WORD iSum = 0;
- for(int i=0; i<len; i++)//求和
- {
- iSum += pBuf[i];
- }
- WORD iCompliment = iSum;
- iCompliment = ~iCompliment;//取反
- iCompliment++;
- itoa(iCompliment, chDest, 16);
- chDest[0] = lowercase2uppercase(chDest[0]);
- chDest[1] = lowercase2uppercase(chDest[1]);
- chDest[2] = lowercase2uppercase(chDest[2]);
- chDest[3] = lowercase2uppercase(chDest[3]);
- return atoi(chDest);
- }
- BYTE CUPSNxr::GetLengthSum(BYTE szChar[])
- {
- unsigned int nData = 0;
- unsigned int nData1 =0;
- unsigned short nDataLength = 0;
- unsigned short nChar1;
- nChar1 =AsciiToBYTE(szChar[1]) +
- AsciiToBYTE(szChar[2]) +
- AsciiToBYTE(szChar[3]);
- nChar1 = (~nChar1) + 1;
- nChar1 %=16;
- return (BYTE)nChar1;
- }
- int CUPSNxr::LengthCheck(char szSendMsg[])
- {
- int len = (int)strlen(szSendMsg);
- char buffer[5] = {0};
- int j = 0;
- for (int i = 9; i< 13; i++)
- {
- buffer[j++] = szSendMsg[i]; //取出检验位
- }
- buffer[j] ='0';
- if(!ValiateLength(buffer)) // 相加模十六取反加一
- {
- return ERR_CODE_RTN_LCHKSUM_ERROR;
- }
- /*转换为十六进制*/
- return 0;
- }
- BOOL CUPSNxr::ValiateLength(char szChar[])
- {
- unsigned int nData = 0;
- unsigned int nData1 =0;
- unsigned short nDataLength = 0;
- unsigned short nChar1;
- nChar1 =AsciiToBYTE(szChar[1]) +
- AsciiToBYTE(szChar[2]) +
- AsciiToBYTE(szChar[3]);
- nChar1 = (~nChar1) + 1;
- nChar1 %=16;
- nDataLength = AsciiToBYTE(szChar[0]);
- if (nDataLength != nChar1)
- {
- return FALSE;
- }
- return TRUE;
- }
- void CUPSNxr::SimulationCommData(int nAddr)
- {
- //LOG4C((LOG_NOTICE,"模拟"));
- //memcpy(m_szNxr_41Msg[nAddr - 1], "~10012A00006A0004CD4C5E439A1960439A995E439A995C4333B35B439A195B430000C03F6666663F0000C03F9A190744C3F547420000009A190744E6D0.",130);
- //memcpy(m_szNxr_43Msg[nAddr - 1], "~10012A009034000117E0E1E2E3E0E0E0E0E0E0E0E0E0E0E0E0E0E0E0E0E0E0E0F0DF.",70);
- }
- /*
- Length: 0020, Data: 7E 31 30 30 31 32 41 34 31 45 30 30 32 30 30 46 44 32 46 0D
- Length: 0124, Data: 7E 31 30 30 31 32 41 30 30 30 30 36 41 30 31 30 30 39 41 39 39 36 30 34 33 33 33 42 33 36 30 34 33 36 36 45 36 35 46 34 33 33 33 33 33 35 44 34 33 33 33 33 33 35 44 34 33 33 33 33 33 35 44 34 33 30 30 30 30 35 30 34 31 30 30 30 30 34 30 34 31 30 30 30 30 34 38 34 31 30 30 38 30 30 36 34 34 43 44 43 43 34 37 34 32 30 30 30 30 30 30 30 30 38 30 30 36 34 34 45 37 44 37 0D
- Length: 0018, Data: 7E 31 30 30 31 32 41 34 33 30 30 30 30 46 44 41 34 0D
- Length: 0070, Data: 7E 31 30 30 31 32 41 30 30 39 30 33 34 30 31 30 31 31 37 45 31 45 30 45 31 45 30 45 31 45 31 45 30 45 31 45 31 45 30 45 32 45 31 45 32 45 30 45 30 45 30 45 30 45 30 45 31 45 31 45 31 45 31 45 31 46 31 44 45 0D
- Length: 0018, Data: 7E 31 30 30 31 32 41 34 34 30 30 30 30 46 44 41 33 0D
- Length: 0204, Data: 7E 31 30 30 31 32 41 30 30 42 30 42 41 30 31 30 30 30 30 30 30 30 30 30 30 30 30 30 30 35 34 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 44 41 38 43 0D
- Length: 0020, Data: 7E 31 30 30 31 32 41 45 31 45 30 30 32 30 30 46 44 31 45 0D
- Length: 0136, Data: 7E 31 30 30 31 32 41 30 30 33 30 37 36 30 31 30 30 30 45 39 41 39 39 43 32 34 33 33 33 33 33 43 32 34 33 33 33 33 33 43 32 34 33 36 36 36 36 32 36 34 31 39 41 39 39 30 39 34 31 36 36 36 36 30 45 34 31 34 38 45 31 34 37 34 32 38 35 45 42 35 31 33 46 42 38 31 45 34 35 33 46 31 34 41 45 34 37 33 46 43 44 43 43 35 46 34 33 39 41 39 39 35 46 34 33 39 41 31 39 35 45 34 33 43 44 43 43 34 37 34 32 45 33 42 35 0D
- Length: 0020, Data: 7E 31 30 30 31 32 41 45 32 45 30 30 32 30 30 46 44 31 44 0D
- Length: 0168, Data: 7E 31 30 30 31 32 41 30 30 31 30 39 36 30 31 30 30 31 32 38 46 43 32 37 35 33 46 38 46 43 32 37 35 33 46 38 46 43 32 37 35 33 46 30 30 30 30 30 30 34 30 33 33 33 33 46 33 33 46 33 33 33 33 46 33 33 46 33 33 33 33 33 33 34 30 30 30 30 30 32 30 34 30 36 36 36 36 32 36 34 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 33 33 33 33 33 33 34 30 30 30 30 30 32 30 34 30 36 36 36 36 32 36 34 30 39 41 39 39 42 39 34 30 36 36 36 36 41 36 34 30 39 41 39 39 41 39 34 30 44 45 41 37 0D
- Length: 0018, Data: 7E 31 30 30 31 32 41 45 33 30 30 30 30 46 44 39 33 0D
- Length: 0094, Data: 7E 31 30 30 31 32 41 30 30 30 30 34 43 30 31 30 39 43 44 43 43 41 43 34 30 43 44 43 43 39 43 34 30 36 36 36 36 42 36 34 30 33 33 33 33 42 33 34 30 30 30 30 30 41 30 34 30 43 44 43 43 42 43 34 30 33 33 33 33 42 33 33 46 36 36 36 36 36 36 33 46 30 30 30 30 43 30 33 46 45 43 45 31 0D
- Length: 0022, Data: 7E 31 30 30 31 32 41 45 37 43 30 30 34 30 31 30 30 46 43 42 37 0D
- Length: 0088, Data: 7E 31 30 30 31 32 41 30 30 36 30 34 36 30 31 30 31 30 38 30 30 30 30 46 37 34 33 33 33 33 33 38 37 34 33 30 30 30 30 30 30 33 46 33 33 42 33 38 35 34 33 41 45 34 37 45 31 33 45 37 36 44 32 37 37 33 46 30 30 30 30 43 38 34 31 30 30 30 30 43 38 34 31 45 45 46 41 0D
- Length: 0020, Data: 7E 31 30 30 31 32 41 34 31 45 30 30 32 30 30 46 44 32 46 0D
- Length: 0124, Data: 7E 31 30 30 31 32 41 30 30 30 30 36 41 30 31 30 30 36 36 45 36 35 46 34 33 36 36 36 36 35 46 34 33 33 33 42 33 35 45 34 33 33 33 33 33 35 44 34 33 33 33 33 33 35 44 34 33 33 33 33 33 35 44 34 33 30 30 30 30 35 30 34 31 30 30 30 30 33 38 34 31 30 30 30 30 34 38 34 31 36 36 41 36 30 36 34 34 34 38 45 31 34 37 34 32 30 30 30 30 30 30 36 36 41 36 30 36 34 34 45 37 42 30 0D
- Length: 0018, Data: 7E 31 30 30 31 32 41 34 33 30 30 30 30 46 44 41 34 0D
- Length: 0070, Data: 7E 31 30 30 31 32 41 30 30 39 30 33 34 30 31 30 31 31 37 45 31 45 30 45 31 45 30 45 31 45 31 45 30 45 31 45 31 45 30 45 32 45 31 45 32 45 30 45 30 45 30 45 30 45 30 45 31 45 31 45 31 45 31 45 31 46 31 44 45 0D
- Length: 0018, Data: 7E 31 30 30 31 32 41 34 34 30 30 30 30 46 44 41 33 0D
- Length: 0204, Data: 7E 31 30 30 31 32 41 30 30 42 30 42 41 30 31 30 30 30 30 30 30 30 30 30 30 30 30 30 30 35 34 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 44 41 38 43 0D
- Length: 0020, Data: 7E 31 30 30 31 32 41 45 31 45 30 30 32 30 30 46 44 31 45 0D
- Length: 0136, Data: 7E 31 30 30 31 32 41 30 30 33 30 37 36 30 31 30 30 30 45 33 33 33 33 43 32 34 33 33 33 42 33 43 31 34 33 36 36 36 36 43 31 34 33 39 41 39 39 32 31 34 31 43 44 43 43 30 34 34 31 43 44 43 43 30 43 34 31 33 44 30 41 34 38 34 32 31 34 41 45 34 37 33 46 45 43 35 31 33 38 33 46 35 43 38 46 34 32 33 46 36 36 36 36 35 46 34 33 30 30 30 30 35 46 34 33 30 30 38 30 35 44 34 33 43 33 46 35 34 37 34 32 45 33 45 46 0D
- Length: 0020, Data: 7E 31 30 30 31 32 41 45 32 45 30 30 32 30 30 46 44 31 44 0D
- Length: 0168, Data: 7E 31 30 30 31 32 41 30 30 31 30 39 36 30 31 30 30 31 32 38 46 43 32 37 35 33 46 38 46 43 32 37 35 33 46 38 46 43 32 37 35 33 46 30 30 30 30 30 30 34 30 33 33 33 33 46 33 33 46 33 33 33 33 46 33 33 46 43 44 43 43 32 43 34 30 39 41 39 39 31 39 34 30 36 36 36 36 32 36 34 30 30 30 30 30 30 30 30 30 33 33 33 33 33 33 33 46 30 30 30 30 30 30 30 30 43 44 43 43 32 43 34 30 30 30 30 30 32 30 34 30 36 36 36 36 32 36 34 30 36 36 36 36 42 36 34 30 30 30 30 30 41 30 34 30 33 33 33 33 42 33 34 30 44 45 30 32 0D
- Length: 0018, Data: 7E 31 30 30 31 32 41 45 33 30 30 30 30 46 44 39 33 0D
- Length: 0094, Data: 7E 31 30 30 31 32 41 30 30 30 30 34 43 30 31 30 39 43 44 43 43 41 43 34 30 39 41 39 39 39 39 34 30 30 30 30 30 42 30 34 30 36 36 36 36 42 36 34 30 30 30 30 30 41 30 34 30 39 41 39 39 42 39 34 30 36 36 36 36 45 36 33 46 33 33 33 33 42 33 33 46 36 36 36 36 45 36 33 46 45 44 31 37 0D
- Length: 0022, Data: 7E 31 30 30 31 32 41 45 37 43 30 30 34 30 31 30 30 46 43 42 37 0D
- Length: 0088, Data: 7E 31 30 30 31 32 41 30 30 36 30 34 36 30 31 30 31 30 38 30 30 30 30 46 37 34 33 33 33 33 33 38 37 34 33 42 38 31 45 30 35 33 46 36 36 45 36 38 35 34 33 31 46 38 35 45 42 33 45 37 36 44 32 37 37 33 46 30 30 30 30 43 38 34 31 30 30 30 30 43 38 34 31 45 45 42 35 0D
- Length: 0020, Data: 7E 31 30 30 31 32 41 34 31 45 30 30 32 30 30 46 44 32 46 0D
- Length: 0124, Data: 7E 31 30 30 31 32 41 30 30 30 30 36 41 30 31 30 30 39 41 31 39 36 31 34 33 30 30 30 30 36 31 34 33 33 33 33 33 36 30 34 33 33 33 33 33 35 44 34 33 30 30 38 30 35 44 34 33 33 33 33 33 35 44 34 33 30 30 30 30 35 30 34 31 30 30 30 30 33 38 34 31 30 30 30 30 34 38 34 31 33 33 39 33 30 36 34 34 43 33 46 35 34 37 34 32 30 30 30 30 30 30 33 33 39 33 30 36 34 34 45 38 32 44 0D
- Length: 0018, Data: 7E 31 30 30 31 32 41 34 33 30 30 30 30 46 44 41 34 0D
- Length: 0070, Data: 7E 31 30 30 31 32 41 30 30 39 30 33 34 30 31 30 31 31 37 45 31 45 30 45 31 45 30 45 31 45 31 45 30 45 31 45 31 45 30 45 32 45 31 45 32 45 30 45 30 45 30 45 30 45 30 45 31 45 31 45 31 45 31 45 31 46 31 44 45 0D
- Length: 0018, Data: 7E 31 30 30 31 32 41 34 34 30 30 30 30 46 44 41 33 0D
- Length: 0204, Data: 7E 31 30 30 31 32 41 30 30 42 30 42 41 30 31 30 30 30 30 30 30 30 30 30 30 30 30 30 30 35 34 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 44 41 38 43 0D
- Length: 0020, Data: 7E 31 30 30 31 32 41 45 31 45 30 30 32 30 30 46 44 31 45 0D
- Length: 0136, Data: 7E 31 30 30 31 32 41 30 30 33 30 37 36 30 31 30 30 30 45 39 41 44 39 43 32 34 33 33 33 46 33 43 31 34 33 30 30 34 30 43 32 34 33 30 30 30 30 32 30 34 31 36 36 36 36 30 36 34 31 36 36 36 36 30 45 34 31 37 42 31 34 34 38 34 32 31 34 41 45 34 37 33 46 30 30 30 30 34 30 33 46 42 38 31 45 34 35 33 46 30 30 38 30 36 30 34 33 30 30 30 30 35 46 34 33 39 41 31 39 35 45 34 33 33 44 30 41 34 38 34 32 45 34 42 38 0D
- Length: 0020, Data: 7E 31 30 30 31 32 41 45 32 45 30 30 32 30 30 46 44 31 44 0D
- Length: 0168, Data: 7E 31 30 30 31 32 41 30 30 31 30 39 36 30 31 30 30 31 32 38 46 43 32 37 35 33 46 34 38 45 31 37 41 33 46 44 37 41 33 37 30 33 46 30 30 30 30 30 30 34 30 33 33 33 33 46 33 33 46 33 33 33 33 46 33 33 46 43 44 43 43 32 43 34 30 39 41 39 39 31 39 34 30 36 36 36 36 32 36 34 30 30 30 30 30 30 30 30 30 33 33 33 33 33 33 33 46 30 30 30 30 30 30 30 30 43 44 43 43 32 43 34 30 30 30 30 30 32 30 34 30 36 36 36 36 32 36 34 30 39 41 39 39 42 39 34 30 43 44 43 43 41 43 34 30 39 41 39 39 41 39 34 30 44 44 37 34 0D
- Length: 0018, Data: 7E 31 30 30 31 32 41 45 33 30 30 30 30 46 44 39 33 0D
- Length: 0094, Data: 7E 31 30 30 31 32 41 30 30 30 30 34 43 30 31 30 39 43 44 43 43 41 43 34 30 39 41 39 39 39 39 34 30 33 33 33 33 42 33 34 30 36 36 36 36 42 36 34 30 30 30 30 30 41 30 34 30 43 44 43 43 42 43 34 30 36 36 36 36 45 36 33 46 33 33 33 33 42 33 33 46 36 36 36 36 45 36 33 46 45 43 44 44 0D
- Length: 0022, Data: 7E 31 30 30 31 32 41 45 37 43 30 30 34 30 31 30 30 46 43 42 37 0D
- Length: 0088, Data: 7E 31 30 30 31 32 41 30 30 36 30 34 36 30 31 30 31 30 38 30 30 30 30 46 37 34 33 30 30 34 30 38 37 34 33 42 38 31 45 30 35 33 46 36 36 41 36 38 35 34 33 41 45 34 37 45 31 33 45 37 36 44 32 37 37 33 46 30 30 30 30 43 38 34 31 30 30 30 30 43 38 34 31 45 45 43 35 0D
- Length: 0020, Data: 7E 31 30 30 31 32 41 34 31 45 30 30 32 30 30 46 44 32 46 0D
- */
|