修改agentlink 协议
diff --git a/setup.py b/setup.py
index bc8d02d..5899d22 100644
--- a/setup.py
+++ b/setup.py
@@ -37,5 +37,5 @@
author='Cheng Tang',
author_email='cheng.tang@supwisdom.com',
platforms=['All'],
- packages=['supwisdom', 'supwisdom.protocol']
+ packages=['supwisdom', 'supwisdom.protocol', 'supwisdom.agentlink']
)
diff --git a/supwisdom/agentlink/__init__.py b/supwisdom/agentlink/__init__.py
index 1c7d390..d3305ab 100644
--- a/supwisdom/agentlink/__init__.py
+++ b/supwisdom/agentlink/__init__.py
@@ -23,7 +23,7 @@
MSG_HEADER_FMT = '!IIIBB'
MSG_HEADER_DESC = ('major_version', 'minor_version', 'unique_no', 'msg_type', 'retcode')
# 协议版本号定义
- MAJOR_VERSION = 1
+ MAJOR_VERSION = 2
MINOR_VERSION = 1
def __init__(self):
@@ -125,6 +125,20 @@
return False
return True
+ def answer_invalidate(self):
+ msg_type = 0x36
+ message_header = self._new_message(msg_type)
+ req_data = self._pack_request(message_header, self.connection_id)
+ data = self._send_and_recv(req_data, None)
+ answer_resp = self._unpack_request(data)
+ if not self._check_response(message_header, answer_resp):
+ print u"answer data error"
+ return False
+ if answer_resp['retcode'] != 0:
+ print u"Answer error retcode={0}".format(answer_resp['retcode'])
+ return False
+ return True
+
def _new_message(self, msg_type):
unique_no = random.randint(0x10000000, 0xFFFFFFFF)
return dict(major_version=self.MAJOR_VERSION, minor_version=self.MINOR_VERSION,