def msg_handler(self, channel, data): if channel == "GoalReader/TagConfirm": msg = Tag.decode(data) print ("received tagConfirm!") print("reader=" + msg.reader) print("tagId=" + str(msg.tagId)) self.read_sender.repeater.push_confirm(msg)
def format_tag_read(self, reactor, idx, new_val): ''' obj = { 'Type': 'TagRead', 'Time': self.timer.time(), 'Reader': self.field_state.reader_of_idx(reactor, idx), 'TagID': unicode(new_val) } return json.dumps(obj) ''' print("index=" + str(idx)) print("reader=" + str(self.field_state.reader_of_idx(reactor, idx))) print('Formatting tag read for reactor {}, idx {}, val {}'.format( reactor, idx, new_val)) print('Field state:', self.field_state) msg = Tag() msg.uptime = self.timer.time() msg.reader = self.field_state.reader_of_idx(reactor, idx) msg.tagId = new_val print('Got reader', msg.reader) return msg