Beispiel #1
0
 def read(self, address):
     """Read a 32-byte block from the given (non-coded) address"""
     reply = self.bridge.write(struct.pack(">BH", 2, addrEncode(address)), 33)[1]
     crc = reply[-1]
     data = reply[:-1]
     self._checkCRC(crc, data)
     return data
Beispiel #2
0
 def read(self, address):
     """Read a 32-byte block from the given (non-coded) address"""
     reply = self.bridge.write(struct.pack(">BH", 2, addrEncode(address)),
                               33)[1]
     crc = reply[-1]
     data = reply[:-1]
     self._checkCRC(crc, data)
     return data
Beispiel #3
0
 def write(self, address, data):
     """Write a 32-byte block to the given (non-coded) address"""
     packet = struct.pack(">BH32s", 3, addrEncode(address), data)
     crc = self.bridge.write(packet, 1)[1]
     return self._checkCRC(crc, packet[3:])
Beispiel #4
0
 def write(self, address, data):
     """Write a 32-byte block to the given (non-coded) address"""
     packet = struct.pack(">BH32s", 3, addrEncode(address), data)
     crc = self.bridge.write(packet, 1)[1]
     return self._checkCRC(crc, packet[3:])