summaryrefslogtreecommitdiffstats
path: root/scripts/remote/controller.py
diff options
context:
space:
mode:
Diffstat (limited to 'scripts/remote/controller.py')
-rw-r--r--scripts/remote/controller.py24
1 files changed, 24 insertions, 0 deletions
diff --git a/scripts/remote/controller.py b/scripts/remote/controller.py
index a7257ecc97..eaab9f8f6b 100644
--- a/scripts/remote/controller.py
+++ b/scripts/remote/controller.py
@@ -46,6 +46,18 @@ def unpack(data):
elif p_type == BBType.fs_return:
logging.debug("received: fs_return")
return BBPacketFSReturn(raw=data)
+ elif p_type == BBType.md:
+ logging.debug("received: md")
+ return BBPacketMd(raw=data)
+ elif p_type == BBType.md_return:
+ logging.debug("received: md_return")
+ return BBPacketMdReturn(raw=data)
+ elif p_type == BBType.mw:
+ logging.debug("received: mw")
+ return BBPacketMw(raw=data)
+ elif p_type == BBType.mw_return:
+ logging.debug("received: mw_return")
+ return BBPacketMwReturn(raw=data)
else:
logging.debug("received: UNKNOWN")
return BBPacket(raw=data)
@@ -112,6 +124,18 @@ class Controller(Thread):
r = self._expect(BBPacketGetenvReturn)
return r.text
+ def md(self, path, addr, size):
+ self._send(BBPacketMd(path=path, addr=addr, size=size))
+ r = self._expect(BBPacketMdReturn)
+ logging.info("Md return: %r", r)
+ return (r.exit_code,r.data)
+
+ def mw(self, path, addr, data):
+ self._send(BBPacketMw(path=path, addr=addr, data=data))
+ r = self._expect(BBPacketMwReturn)
+ logging.info("Mw return: %r", r)
+ return (r.exit_code,r.written)
+
def close(self):
self.conn.close()