| | |
| | | ASSERT(pParent); |
| | | ASSERT(pVariable); |
| | | |
| | | std::string svNote("SV"); |
| | | { |
| | | SERVO::CVariable* pDef = getVariable((int)pVariable->getVarialbleId()); |
| | | if (pDef == nullptr) { |
| | | pDef = pVariable; |
| | | } |
| | | auto& name = pDef->getName(); |
| | | if (!name.empty()) { |
| | | svNote += " -> "; |
| | | svNote += name; |
| | | } |
| | | } |
| | | |
| | | ISECS2Item* pItemList; |
| | | SERVO::SVFromat format = pVariable->getFormat(); |
| | | switch (format) |
| | | { |
| | | case SERVO::SVFromat::U1: |
| | | pParent->addU1Item((unsigned char)pVariable->getIntValue(), "SV"); |
| | | pParent->addU1Item((unsigned char)pVariable->getIntValue(), svNote.c_str()); |
| | | break; |
| | | case SERVO::SVFromat::U2: |
| | | pParent->addU2Item((unsigned char)pVariable->getIntValue(), "SV"); |
| | | pParent->addU2Item((unsigned char)pVariable->getIntValue(), svNote.c_str()); |
| | | break; |
| | | case SERVO::SVFromat::I2: |
| | | pParent->addI2Item((unsigned char)pVariable->getIntValue(), "SV"); |
| | | pParent->addI2Item((unsigned char)pVariable->getIntValue(), svNote.c_str()); |
| | | break; |
| | | case SERVO::SVFromat::A20: |
| | | case SERVO::SVFromat::A50: |
| | | pParent->addItem(pVariable->getValue().c_str(), "SV"); |
| | | pParent->addItem(pVariable->getValue().c_str(), svNote.c_str()); |
| | | break; |
| | | case SERVO::SVFromat::L: |
| | | pItemList = pParent->addItem(); |
| | |
| | | |
| | | ASSERT(pMessage); |
| | | m_pPassive->sendMessage(pMessage); |
| | | LOGI("<HSMS> [SEND] SysByte=%u sessionId:%d", pMessage->getHeader()->systemBytes, pMessage->getHeader()->sessionId); |
| | | LOGI("<HSMS>[SEND]SysByte=%u sessionId:%d", pMessage->getHeader()->systemBytes, pMessage->getHeader()->sessionId); |
| | | LOGI("<HSMS>[SEND]%s", pMessage->toString()); |
| | | |
| | | int nRet = WaitForSingleObject(pAction->getEvent(), pAction->getTimeout() * 1000); |
| | | if (nRet == WAIT_TIMEOUT) { |
| | |
| | | |
| | | ASSERT(pMessage); |
| | | m_pPassive->sendMessage(pMessage); |
| | | LOGI("<HSMS> [SEND] SysByte=%u sessionId:%d", pMessage->getHeader()->systemBytes, pMessage->getHeader()->sessionId); |
| | | LOGI("<HSMS>[SEND]SysByte=%u sessionId:%d", pMessage->getHeader()->systemBytes, pMessage->getHeader()->sessionId); |
| | | LOGI("<HSMS>[SEND]%s", pMessage->toString()); |
| | | |
| | | } |
| | | } |
| | |
| | | pItem->addItem(m_strEquipmentModelType.c_str(), "MDLN"); |
| | | pItem->addItem(m_strSoftRev.c_str(), "SOFTREV"); |
| | | m_pPassive->sendMessage(pMessage); |
| | | LOGI("<HSMS>[SECS Msg SEND] %s", pMessage->toString()); |
| | | LOGI("<HSMS>[SEND]sessionId:%d, sType:%d systemBytes:%d", |
| | | pMessage->getHeader()->sessionId, pMessage->getHeader()->sType, pMessage->getHeader()->systemBytes); |
| | | LOGI("<HSMS>[SEND]%s", pMessage->toString()); |
| | | HSMS_Destroy1Message(pMessage); |
| | | |
| | | return 0; |
| | |
| | | goto MYREPLY; |
| | | } |
| | | if (!pBody->getSubItemU2(0, SVID)) { |
| | | pMessage->getBody()->addU1Item(SVU1, "SV"); |
| | | goto MYREPLY; |
| | | if (!pBody->getSubItemI2(0, (short&)SVID)) { |
| | | pMessage->getBody()->addU1Item(SVU1, "SV"); |
| | | goto MYREPLY; |
| | | } |
| | | } |
| | | |
| | | SERVO::CVariable* pVariable = getVariable((int)SVID); |
| | |
| | | } |
| | | } |
| | | MYREPLY: |
| | | replyAck(2, 42, pRecv->getHeader()->systemBytes, BYTE(0), "ERACK"); |
| | | replyAck(2, 44, pRecv->getHeader()->systemBytes, BYTE(0), "ERACK"); |
| | | return 0; |
| | | } |
| | | |
| | |
| | | ISECS2Item* pItem = pMessage->getBody(); |
| | | // pItem->addU2Item(++DATAID, "DATAID"); // 根据别的日志显示DATAID恒为0,所以我们先照使用0 |
| | | pItem->addU2Item(0, "DATAID"); |
| | | pItem->addU4Item(CEID, "CEID"); |
| | | std::string ceidNote("CEID"); |
| | | if (pEvent != nullptr) { |
| | | auto& name = pEvent->getName(); |
| | | if (!name.empty()) { |
| | | ceidNote += " -> "; |
| | | ceidNote += name; |
| | | } |
| | | } |
| | | pItem->addU4Item(CEID, ceidNote.c_str()); |
| | | ISECS2Item* pItemList1 = pItem->addItem(); // L[n] reports |
| | | if (pReport != nullptr) { |
| | | ISECS2Item* pItemList2 = pItemList1->addItem(); |