--- a/LPCconnector/LPCAppProto.py Thu Mar 21 17:29:53 2013 +0100
+++ b/LPCconnector/LPCAppProto.py Fri Mar 22 10:46:51 2013 +0900
@@ -46,17 +46,14 @@
def SendData(self, Data):
- # transform length into a byte string
- # we presuppose endianess of LPC same as PC
- lengthstr = ctypes.string_at(ctypes.pointer(ctypes.c_int(length)),4)
- buffer = lengthstr + Data
- return self.pseudofile.write(buffer)
+ return self.pseudofile.write(Data) lengthstr = self.pseudofile.read(4)
# transform a byte string into length
- length = ctypes.cast(ctypes.c_char_p(lengthstr), ctypes.POINTER(ctypes.c_int)).contents.value
+ ctypes.c_char_p(lengthstr), + ctypes.POINTER(ctypes.c_uint32)).contents.value return self.pseudofile.read(length)
@@ -82,7 +79,12 @@
class SET_TRACE_VARIABLETransaction(LPCAppTransaction):
def __init__(self, data):
LPCAppTransaction.__init__(self, 0x04)
+ # transform length into a byte string + # we presuppose endianess of LPC same as PC + lengthstr = ctypes.string_at(ctypes.pointer(ctypes.c_uint32(length)),4) + self.Data = lengthstr + data