LPCconnector/LPCAppObject.py
changeset 30 9cd6bc93ed89
parent 29 86fb7dc2b54e
child 31 a9c9d1fc97d3
equal deleted inserted replaced
29:86fb7dc2b54e 30:9cd6bc93ed89
    47     def GetPLCstatus(self):
    47     def GetPLCstatus(self):
    48         strcounts = self.HandleSerialTransaction(GET_LOGCOUNTSTransaction())
    48         strcounts = self.HandleSerialTransaction(GET_LOGCOUNTSTransaction())
    49         ccounts = ctypes.cast(
    49         ccounts = ctypes.cast(
    50                       ctypes.c_char_p(strcounts),
    50                       ctypes.c_char_p(strcounts),
    51                       ctypes.POINTER(ctypes.c_uint32))
    51                       ctypes.POINTER(ctypes.c_uint32))
    52         return (self.PLCStatus,)+tuple(int(ccounts[idx]) for idx in range(4))
    52         return self.PLCStatus, tuple(int(ccounts[idx]) for idx in range(4))
    53 
    53 
    54     def MatchMD5(self, MD5):
    54     def MatchMD5(self, MD5):
    55         data = self.HandleSerialTransaction(GET_PLCIDTransaction())
    55         data = self.HandleSerialTransaction(GET_PLCIDTransaction())
    56         if data is not None:
    56         if data is not None:
    57             return data[:32] == MD5[:32]
    57             return data[:32] == MD5[:32]