You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
27 lines
1.2 KiB
27 lines
1.2 KiB
from itertools import chain
|
|
|
|
data = '7E010101120304050607087E010301020304050607987E01090102030405060710'
|
|
data = "7E0000000000000000A15E1F197E0000000000000000C10311197E0000000000000000811D16197E0000000000000000815D1F197E000000000000000011C919197E000000000000000061B61B197E0000000000000000000000007E0000000000000000E1E00F197E000000000000000021E00F197E000000000000000041D20F197E0000000000000000111D21197E0000000000000000319A0D197E0000000000000000C1E10F197E0000000000000000A11E16197E0000000000000000B11D1619"
|
|
result = {}
|
|
# for i in range(0, len(data), 22):
|
|
# key = int(data[i + 2:i + 4], 16)
|
|
# value = data[i + 6:i + 22]
|
|
# result.setdefault(key, []).append(value)
|
|
#
|
|
# print(result)
|
|
"""{1: ['A15E1F19', 'C1031119', '811D1619', ]}"""
|
|
data_list = data.split("7E")
|
|
for index, data in enumerate(data_list):
|
|
print(data)
|
|
print("===")
|
|
if data and len(data) > 8:
|
|
value = data[-8:]
|
|
if value != "00000000":
|
|
result.setdefault(value, index)
|
|
print(result)
|
|
# out_rfid_set = set(list(chain.from_iterable(result.values())))
|
|
out_rfid_set = set(i for i in result.keys() if i != "00000000")
|
|
print(out_rfid_set)
|
|
a = {'61B61B19', '21E00F19', '111D2119', 'C1E10F19',}
|
|
b = {'61B61B19', '21E00F19', '111D2119'}
|