本文整理汇总了Python中tag.Tag.uid方法的典型用法代码示例。如果您正苦于以下问题:Python Tag.uid方法的具体用法?Python Tag.uid怎么用?Python Tag.uid使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类tag.Tag
的用法示例。
在下文中一共展示了Tag.uid方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: parse_tag
# 需要导入模块: from tag import Tag [as 别名]
# 或者: from tag.Tag import uid [as 别名]
def parse_tag(self, tagtype, r):
target = r.next()
if tagtype in (0x10, 0x20):
sens_res = (r.next() << 8) + r.next()
sel_res = r.next()
uidlen = r.next()
uid = ''.join('%02x' % r.next() for i in range(uidlen))
tag = Tag(self, target, sens_res, sel_res)
tag.uid = uid
if tagtype == 0x20:
atslen = r.next()
ats = [r.next() for i in range(atslen - 1)]
tag.ats = ats
elif tagtype == 0x23:
atqb = [r.next() for i in range(12)]
arlen = r.next()
ar = [r.next() for i in range(arlen)]
elif tagtype == 0x11:
prlen = r.next()
pol_res = [r.next() for i in range(prlen - 1)]
p = iter(pol_res)
resp_code = p.next()
uid = ''.join('%02x' % p.next() for i in range(8))
print uid
elif tagtype == 0x4:
atqa = (r.next() << 8) + r.next()
uid = ''.join('%02x' % r.next() for i in range(4))
return tag