Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added option for multiple RFID Readers #1012

Merged
merged 8 commits into from
Jul 16, 2020
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Fixed waiting for Reader result
  • Loading branch information
Markus Prochaska authored and Markus Prochaska committed Jun 14, 2020
commit f5f2736fd793e5359216e332f10dd676a04a49a5
16 changes: 8 additions & 8 deletions scripts/Reader.py.experimental.Multi
Original file line number Diff line number Diff line change
Expand Up @@ -177,15 +177,15 @@ class Reader(object):
break

def readCard(self):
que = Queue.Queue()
que = Queue()
threads_list = list()
for dev in self.devs:
t = Thread(target=lambda q, arg1: q.put(dev.readCard(arg1)), args=(que,))
t = Thread(target=lambda q: q.put(dev.readCard()), args=(que,))
t.start()
threads_list.append(t)
for t in threads_list:
t.join()
while not que.empty():
result = que.get()
print(result)
return result
#for t in threads_list:
# t.join()
while True:
for read_thread in threads_list:
if not read_thread.is_alive() and not que.empty():
return que.get()