Some fixes in LPCApp{Obj,Proto}, to be continued.
--- a/connectors/LPC/LPCAppObject.py Thu Jun 03 17:21:40 2010 +0200
+++ b/connectors/LPC/LPCAppObject.py Thu Jun 03 17:23:11 2010 +0200
@@ -38,7 +38,7 @@
try:
self.PLCStatus, res = self.SerialConnection.HandleTransaction(transaction)
return res
- except LPCError,e:
+ except LPCProtoError,e:
self.pluginsroot.logger.write_error(str(e)+"\n")
self.SerialConnection = None
self.PLCStatus = "Disconnected"
@@ -52,17 +52,17 @@
PLCprint("StopPLC")
self.HandleSerialTransaction(STOPTransaction())
- def GetPLCstatus(self):
+ def ResetPLC(self):
self.HandleSerialTransaction(RESETTransaction())
return self.PLCStatus
- def ResetPLC(self):
+ def GetPLCstatus(self):
self.HandleSerialTransaction(IDLETransaction())
return self.PLCStatus
def MatchMD5(self, MD5):
data = self.HandleSerialTransaction(GET_PLCIDTransaction())
- print "PLCINFO",data[32:]
+ print "PLCINFO",data
return data[:32] == MD5
class IEC_STRING(ctypes.Structure):
--- a/connectors/LPC/LPCBootObject.py Thu Jun 03 17:21:40 2010 +0200
+++ b/connectors/LPC/LPCBootObject.py Thu Jun 03 17:23:11 2010 +0200
@@ -38,7 +38,7 @@
def NewPLC(self, md5sum, data, extrafiles):
self.successfully_transfered = self.HandleSerialTransaction(LOADTransaction(data))
- return successfully_transfered
+ return self.successfully_transfered
def MatchMD5(self, MD5):
return self.successfully_transfered
--- a/connectors/LPC/LPCBootProto.py Thu Jun 03 17:21:40 2010 +0200
+++ b/connectors/LPC/LPCBootProto.py Thu Jun 03 17:23:11 2010 +0200
@@ -19,7 +19,8 @@
self.pseudofile = pseudofile
def SendData(self):
- return self.pseudofile.write(self.OptData) == len(self.OptData)
+ res = self.pseudofile.write(self.OptData)
+ return True
def GetData(self):
pass # not impl