equal
deleted
inserted
replaced
40 return res |
40 return res |
41 except LPCProtoError,e: |
41 except LPCProtoError,e: |
42 self.pluginsroot.logger.write_error(str(e)+"\n") |
42 self.pluginsroot.logger.write_error(str(e)+"\n") |
43 self.SerialConnection = None |
43 self.SerialConnection = None |
44 self.PLCStatus = "Disconnected" |
44 self.PLCStatus = "Disconnected" |
45 return None |
45 return None |
46 |
46 |
47 def StartPLC(self, debug=False): |
47 def StartPLC(self, debug=False): |
48 self.HandleSerialTransaction(STARTTransaction()) |
48 self.HandleSerialTransaction(STARTTransaction()) |
49 |
49 |
50 def StopPLC(self): |
50 def StopPLC(self): |
59 self.HandleSerialTransaction(IDLETransaction()) |
59 self.HandleSerialTransaction(IDLETransaction()) |
60 return self.PLCStatus |
60 return self.PLCStatus |
61 |
61 |
62 def MatchMD5(self, MD5): |
62 def MatchMD5(self, MD5): |
63 data = self.HandleSerialTransaction(GET_PLCIDTransaction()) |
63 data = self.HandleSerialTransaction(GET_PLCIDTransaction()) |
64 return data[:32] == MD5 |
64 if data is not None: |
|
65 return data[:32] == MD5 |
|
66 return False |
65 |
67 |
66 class IEC_STRING(ctypes.Structure): |
68 class IEC_STRING(ctypes.Structure): |
67 """ |
69 """ |
68 Must be changed according to changes in iec_types.h |
70 Must be changed according to changes in iec_types.h |
69 """ |
71 """ |