From c6c847136c231b50edeb9598ece72b16242dfd24 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ond=C5=99ej=20Hru=C5=A1ka?= Date: Wed, 27 Dec 2017 18:17:52 +0100 Subject: [PATCH] added simple bulk access to Unit --- gex/Unit.py | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/gex/Unit.py b/gex/Unit.py index 037228c..19a0087 100644 --- a/gex/Unit.py +++ b/gex/Unit.py @@ -14,3 +14,18 @@ class Unit: def query(self, cmd, pld=None, id=None): """ Query the unit. Returns TF_Msg """ self.client.query(cs=self.callsign, cmd=cmd, pld=pld, id=None) + + def bulk_read(self, cmd, id=None, pld=None, chunk=1024): + """ + Perform a bulk read. + cmd, id and pld are used to initiate the read. + """ + self.client.bulk_read(cs=self.callsign, cmd=cmd, id=id, pld=pld, chunk=chunk) + + def bulk_write(self, cmd, bulk, id=None, pld=None): + """ + Perform a bulk write. + cmd, id and pld are used to initiate the read. + bulk is the data to write. + """ + self.client.bulk_write(cs=self.callsign, cmd=cmd, id=id, pld=pld, bulk=bulk)