summaryrefslogtreecommitdiffstats
path: root/h.py
blob: ba7d4871e9e517b714e227fd5992c38afe66e01d (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40

import sys

i = int(sys.argv[1],16)
print(i)
d1 = i&0x1f
print("Recepient        "+str(d1)),
if d1 == 0:
	print(" device")
elif d1 == 1:
	print(" interface")
elif d1 == 2:
	print(" endpoint")
elif d1 == 3:
	print(" other")
else:
	print(" Unknown")

d2 = ((i>>5)&0x3)
print("Request type     "+str(d2)),
if d2 == 0:
	print(" standart")
elif d2 == 1:
	print(" class")
elif d2 == 2:
	print(" vendor")
elif d2 == 3:
	print(" reserved")
else:
	print(" Unknown")

d3 = ((i>>7)&0x1)
print("Direction        "+str(d3)),
if d3 == 0:
	print(" Out")
elif d3 == 1:
	print(" In")
else:
	print(" Unknown")