Пример #1
0
 def write(self, payload):
     """"""
     m = common.tonum(payload[0])
     print(("    Space: " + bin(m)))
     off = common.tonum(payload[1:][:3])
     print(("    Start: " + hex(off)))
     size = common.tonum(payload[4:][:2])
     print(("    End: " + hex(off + size)))
Пример #2
0
 def read(self, payload):
     """"""
     m = common.tonum(payload[0])
     print(("    Space: " + bin(m)))
     off = common.tonum(payload[1:][:3])
     print(("    Start: " + hex(off)))
     size = common.tonum(payload[4])
     print(("    End: " + hex(off + size)))
     data = payload[5:][:size]
     print(("    Data: " + common.tohex(data)))
Пример #3
0
 def mode_unpack(self, strData):
     """"""
     cont = common.unpack(strData[0])
     mode = common.tonum(strData[1])
     print(("    Mode: " + hex(mode)))
     print(("    Continuous: " + str(cont[2])))
     return cont