def run(self): cmd = CommandType.REQA struct = CommandStructure.encode_command(cmd, []) s = self._tag ns = self._reader i = 0 mx = self._max while i < mx or mx == 0: ret = s.process_packet(cmd, struct) if not ret: cmd = CommandType.REQA struct = CommandStructure.encode_command(cmd, []) s = self._tag ns = self._reader s.wake_up() # so that it can respond i += 1 else: cmd, struct = ret temp = s s = ns ns = temp
def _handle_next(self, cmd, extra): if not cmd: return None struct = CommandStructure.encode_command(cmd, extra) print "TAG OUTGOING" struct.display() all_bits = Convert.to_bit_ar(struct.all_bytes(), True) if self._encode: all_bits = self._encode(all_bits, cmd) #print all_bits self._callback(all_bits) return (cmd, struct)
def _handle_next(self, cmd, extra): struct = CommandStructure.encode_command(cmd, extra) print "READER OUTGOING" struct.display() if cmd == CommandType.HALT: self._reset_tag() all_bits = Convert.to_bit_ar(struct.all_bytes(), True) if self._encode: all_bits = self._encode(all_bits, cmd) #print all_bits self._callback(all_bits, cmd == CommandType.HALT) return (cmd, struct)