equal
deleted
inserted
replaced
122 #PLCprint("Debug error - wrong buffer unpack !") |
122 #PLCprint("Debug error - wrong buffer unpack !") |
123 return self.PLCStatus, None, [] |
123 return self.PLCStatus, None, [] |
124 |
124 |
125 def GetLogMessage(self, level, msgid): |
125 def GetLogMessage(self, level, msgid): |
126 strbuf = self.HandleSerialTransaction(GET_LOGMSGTransaction(level, msgid)) |
126 strbuf = self.HandleSerialTransaction(GET_LOGMSGTransaction(level, msgid)) |
127 if len(strbuf) > 12: |
127 if strbuf is not None and len(strbuf) > 12: |
128 cbuf = ctypes.cast( |
128 cbuf = ctypes.cast( |
129 ctypes.c_char_p(strbuf[:12]), |
129 ctypes.c_char_p(strbuf[:12]), |
130 ctypes.POINTER(ctypes.c_uint32)) |
130 ctypes.POINTER(ctypes.c_uint32)) |
131 return (strbuf[12:],)+tuple(int(cbuf[idx]) for idx in range(3)) |
131 return (strbuf[12:],)+tuple(int(cbuf[idx]) for idx in range(3)) |
132 return None |
132 return None |