slotUI/freeslot.py

changeset 145
80be5eb283d3
parent 143
cb514887cf17
child 150
cc8721bd2c03
equal deleted inserted replaced
144:8f07a8d15826 145:80be5eb283d3
123 status = ord(data[3]) 123 status = ord(data[3])
124 clk = (ord(data[4]) * 256*256*256) + (ord(data[5]) * 256*256) + (ord(data[6]) * 256) + ord(data[7]) 124 clk = (ord(data[4]) * 256*256*256) + (ord(data[5]) * 256*256) + (ord(data[6]) * 256) + ord(data[7])
125 self.com.readline() # clear to next linefeed 125 self.com.readline() # clear to next linefeed
126 line = "RW:%i:%i:%i:%i:%x\n" % (slot, track, sender, status, clk) 126 line = "RW:%i:%i:%i:%i:%x\n" % (slot, track, sender, status, clk)
127 self.log.write(line) 127 self.log.write(line)
128 return line 128 if line.find(chr(0)) == -1:
129 return line
130 else:
131 self.log.write("malformed RX\n")
132 return ""
129 133
130 def query(self, msg): 134 def query(self, msg):
131 if self.com: 135 if self.com:
132 return self.com.query(msg) 136 return self.com.query(msg)
133 return "" 137 return ""

mercurial