Skip to content
Snippets Groups Projects
Commit 767525cf authored by jkerdreu's avatar jkerdreu
Browse files

Added is_get_[attributes|description]_reply

git-svn-id: https://redmine.imt-atlantique.fr/svn/xaal/code/Python/branches/fork@1646 b32b6428-25c9-4566-ad07-03861ab6144f
parent c33d0b01
No related branches found
No related tags found
No related merge requests found
......@@ -51,11 +51,8 @@ class InfoDumper:
mf = self.eng.msg_factory
msg = mf.build_msg(self.dev,[self.target,], 'request','getDescription',None)
self.eng.queue_tx(msg)
msg = mf.build_msg(self.dev,[self.target,], 'request','getAttributes',None)
self.eng.queue_tx(msg)
self.eng.send_get_description(self.dev,[addr,])
self.eng.send_get_attributes(self.dev,[addr,])
term('cyan')
print("** Device : [%s]" % self.target)
......@@ -75,10 +72,10 @@ class InfoDumper:
if msg.is_reply():
if self.addr in msg.targets:
if self.target == msg.source:
if msg.action=='getAttributes':
if msg.is_get_attribute_reply():
print("== Attributes =====")
if msg.action=='getDescription':
if msg.is_get_description_reply():
print("== Description ====")
print(json.dumps(msg.body,sort_keys=True,indent=4))
......
......@@ -341,6 +341,17 @@ class Message(object):
if self.msgtype == 'notify' and self.action == 'attributesChange':
return True
return False
def is_get_attribute_reply(self):
if self.msgtype == 'reply' and self.action == 'getAttributes':
return True
return False
def is_get_description_reply(self):
if self.msgtype == 'reply' and self.action == 'getDescription':
return True
return False
def build_nonce(data):
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment