equal
deleted
inserted
replaced
44 self.HandleSerialTransaction(RESETTransaction()) |
44 self.HandleSerialTransaction(RESETTransaction()) |
45 return self.PLCStatus |
45 return self.PLCStatus |
46 |
46 |
47 def GetPLCstatus(self): |
47 def GetPLCstatus(self): |
48 strcounts = self.HandleSerialTransaction(GET_LOGCOUNTSTransaction()) |
48 strcounts = self.HandleSerialTransaction(GET_LOGCOUNTSTransaction()) |
49 if len(strcounts) == LogLevelsCount * 4: |
49 if strcounts is not None and len(strcounts) == LogLevelsCount * 4: |
50 cstrcounts = ctypes.create_string_buffer(strcounts) |
50 cstrcounts = ctypes.create_string_buffer(strcounts) |
51 ccounts = ctypes.cast(cstrcounts, ctypes.POINTER(ctypes.c_uint32)) |
51 ccounts = ctypes.cast(cstrcounts, ctypes.POINTER(ctypes.c_uint32)) |
52 counts = [int(ccounts[idx]) for idx in xrange(LogLevelsCount)] |
52 counts = [int(ccounts[idx]) for idx in xrange(LogLevelsCount)] |
53 else : |
53 else : |
54 counts = [0]*LogLevelsCount |
54 counts = [0]*LogLevelsCount |