Fixed bug when GET_LOGCOUNTSTransaction return None
authorLaurent Bessard
Thu, 21 Mar 2013 02:06:16 +0100
changeset 34 b2fb188c9bff
parent 33 961cf0f80c25
child 35 cb9da964a178
Fixed bug when GET_LOGCOUNTSTransaction return None
LPCconnector/LPCAppObject.py
--- a/LPCconnector/LPCAppObject.py	Thu Mar 21 09:29:46 2013 +0900
+++ b/LPCconnector/LPCAppObject.py	Thu Mar 21 02:06:16 2013 +0100
@@ -46,7 +46,7 @@
 
     def GetPLCstatus(self):
         strcounts = self.HandleSerialTransaction(GET_LOGCOUNTSTransaction())
-        if len(strcounts) == LogLevelsCount * 4:
+        if strcounts is not None and len(strcounts) == LogLevelsCount * 4:
             cstrcounts = ctypes.create_string_buffer(strcounts)
             ccounts = ctypes.cast(cstrcounts, ctypes.POINTER(ctypes.c_uint32))
             counts = [int(ccounts[idx]) for idx in xrange(LogLevelsCount)]