--- a/connectors/LPC/LPCProto.py Tue Dec 08 12:54:28 2009 +0100
+++ b/connectors/LPC/LPCProto.py Wed Dec 09 00:56:18 2009 +0100
@@ -4,6 +4,8 @@
from threading import Lock
LPC_STATUS=dict(STARTED = 0x01,
@@ -84,8 +86,21 @@
length = len(self.OptData)
# 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)
- self.pseudofile.write(lengthstr + self.OptData)
+ lengthstr = ctypes.string_at(ctypes.pointer(ctypes.c_int(length)),4) + buffer = lengthstr + self.OptData + ################################################################### + # TO BE REMOVED AS SOON AS USB IS FIXED IN CONTROLLER + ################################################################### + next_cursor = cursor + MAX_PACKET_SIZE + # sent just enough bytes to not crash controller + self.pseudofile.write(buffer[cursor:next_cursor]) + # if sent quantity was 128 + if next_cursor <= length: lengthstr = self.pseudofile.read(4)
@@ -130,14 +145,14 @@
if __name__ == "__main__":
TestConnection = LPCProto(6,115200,2)
- #TestConnection.HandleTransaction(GET_PLCIDTransaction())
- TestConnection.HandleTransaction(STARTTransaction())
- TestConnection.HandleTransaction(SET_TRACE_VARIABLETransaction(
+# TestConnection.HandleTransaction(GET_PLCIDTransaction()) TestConnection.HandleTransaction(STARTTransaction())
+# TestConnection.HandleTransaction(SET_TRACE_VARIABLETransaction( +# "\x03\x00\x00\x00"*200)) +# TestConnection.HandleTransaction(STARTTransaction())
TestConnection.HandleTransaction(SET_TRACE_VARIABLETransaction(
- "\x01\x00\x00\x00"*31))
+ "\x01\x00\x00\x00"*200)) #print map(hex,map(ord,TestConnection.HandleTransaction(GET_TRACE_VARIABLETransaction())))
#TestConnection.HandleTransaction(STOPTransaction())