1.reply系列函数,修改为统一参数IMessage;
2.增加U2数据类型支持;
| | |
| | | virtual bool getBinary(BYTE& bin) = 0; |
| | | virtual bool getBool(bool& boolValue) = 0; |
| | | virtual bool getU4(unsigned int& value) = 0; |
| | | virtual bool getU2(unsigned short& value) = 0; |
| | | virtual int getSubItemSize() = 0; |
| | | virtual ISECS2Item* getSubItem(int index) = 0; |
| | | virtual bool getSubItemString(int index, char*& pszText) = 0; |
| | | virtual bool getSubItemBinary(int index, BYTE& bin) = 0; |
| | | virtual bool getSubItemBool(int index, bool& boolValue) = 0; |
| | | virtual bool getSubItemU4(int index, unsigned int& value) = 0; |
| | | virtual bool getSubItemU2(int index, unsigned short& value) = 0; |
| | | virtual void reset() = 0; |
| | | virtual ISECS2Item* addItem(const char* pszText, const char* pszNote) = 0; |
| | | virtual ISECS2Item* addBinaryItem(BYTE bin, const char* pszNote) = 0; |
| | | virtual ISECS2Item* addBoolItem(bool boolValue, const char* pszNote) = 0; |
| | | virtual ISECS2Item* addU4Item(unsigned int value, const char* pszNote) = 0; |
| | | virtual ISECS2Item* addU2Item(unsigned short value, const char* pszNote) = 0; |
| | | virtual void setBinary(BYTE bin, const char* pszNote) = 0; |
| | | virtual ISECS2Item* addItem() = 0; |
| | | }; |
| | |
| | | LOGI("<HSMS>收到消息 S%dF%d", nStream, pHeader->function); |
| | | if (nStream == 1 && pHeader->function == 1) { |
| | | // S1F1 |
| | | replyAreYouThere(pHeader->systemBytes); |
| | | replyAreYouThere(pMessage); |
| | | } |
| | | else if (nStream == 1 && pHeader->function == 13) { |
| | | replyEstablishCommunications(pHeader->systemBytes); |
| | | replyEstablishCommunications(pMessage); |
| | | } |
| | | else if (nStream == 2 && pHeader->function == 31) { |
| | | replyDatetime(pMessage); |
| | |
| | | } |
| | | |
| | | // S1F2 |
| | | int CHsmsPassive::replyAreYouThere(unsigned int systemBytes) |
| | | int CHsmsPassive::replyAreYouThere(IMessage* pRecv) |
| | | { |
| | | if (m_pPassive == NULL || STATE::SELECTED != m_pPassive->getState()) { |
| | | return ER_NOTSELECT; |
| | | } |
| | | |
| | | IMessage* pMessage = NULL; |
| | | HSMS_Create1Message(pMessage, m_nSessionId, 1, 2, systemBytes); |
| | | HSMS_Create1Message(pMessage, m_nSessionId, 1, 2, pRecv->getHeader()->systemBytes); |
| | | ASSERT(pMessage); |
| | | |
| | | ISECS2Item* pItem = pMessage->getBody(); |
| | |
| | | } |
| | | |
| | | // S1F14 |
| | | int CHsmsPassive::replyEstablishCommunications(unsigned int systemBytes) |
| | | int CHsmsPassive::replyEstablishCommunications(IMessage* pRecv) |
| | | { |
| | | if (m_pPassive == NULL || STATE::SELECTED != m_pPassive->getState()) { |
| | | return ER_NOTSELECT; |
| | | } |
| | | |
| | | IMessage* pMessage = NULL; |
| | | HSMS_Create1Message(pMessage, m_nSessionId, 1, 14, systemBytes); |
| | | HSMS_Create1Message(pMessage, m_nSessionId, 1, 14, pRecv->getHeader()->systemBytes); |
| | | ASSERT(pMessage); |
| | | |
| | | ISECS2Item* pItem = pMessage->getBody(); |
| | |
| | | void replyAck(int s, int f, unsigned int systemBytes, BYTE ack, const char* pszAckName); |
| | | |
| | | /* reply开头的函数为回复函数 */ |
| | | int replyAreYouThere(unsigned int systemBytes); |
| | | int replyEstablishCommunications(unsigned int systemBytes); |
| | | int replyAreYouThere(IMessage* pRecv); |
| | | int replyEstablishCommunications(IMessage* pRecv); |
| | | int replyDatetime(IMessage* pRecv); |
| | | int replyEanbleDisableEventReport(IMessage* pRecv); |
| | | int replyEanbleDisableAlarmReport(IMessage* pRecv); |