-
Notifications
You must be signed in to change notification settings - Fork 63
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
Gen2 Select Filtering #113
Comments
Hi, I'm also struggling to get the Gen2 Select filtering working and could really use a working example. Any help would be appreciated. UpdateI was able to get a single Gen2 Select filter to work when masking by EPC. See example below. device = "/dev/ttyUSB2"
reader = mercury.Reader("tmr://{}".format(device), baudrate=115200, protocol="GEN2")
reader.set_region("NA2")
# Showing filtering by epc. This works.
# Showing a mask that doesn't match my tags beyond 16 bits to show that the offset and length work for EPC filter.
gen2_select = {
'epc': b'E200FF',
'bit': 32,
'len': 16,
}
reader.set_read_plan([1], "GEN2", epc_target=gen2_select, bank="user")
print("Filter using EPC:")
print(reader.read())
# Showing filtering by user bank mask. I can't get this to work.
# User bank offset starts at 0 instead of 32. Just trying to match the first 16 bits.
gen2_select = {
'user': b'ABCD',
'bit': 0,
'len': 16,
}
reader.set_read_plan([1], "GEN2", epc_target=gen2_select, bank="user")
print("Filter using user data:")
print(reader.read())
# Showing that the first 16 bits of the user memory data matches the filter I am attempting.
target = b'E200001C121501031080489B'
result = reader.read_tag_mem(3, 0x00, 16, epc_target=target)
print("Show user memory data:")
print(result)
reader.destroy() Output: Filter using EPC:
[EPC(b'E200001C121501031080489B'), EPC(b'E200001C121500931080405A')]
Filter using user data:
[]
Show user memory data:
bytearray(b'ABCDEF\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00') I would really appreciate a working example of filtering by user memory mask. Thanks. |
@n8cutler Did you get this to work? |
Hello,
I am trying to use the gen2 select filtering as described in the documentation, but I keep getting "TypeError:reserved, epc, tid or user mask expected". I am not sure what I am doing wrong. Is there anyone that could present an example of the gen2 select filtering with all of the associated items in the dict.
Thanks
The text was updated successfully, but these errors were encountered: