added simple bulk access to Unit

This commit is contained in:
2017-12-27 18:17:58 +01:00
parent 732c6ff58c
commit c6c847136c
+15
View File
@@ -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)