Skip to content

Commit 0a97a07

Browse files
committed
[IMP] Print UUID of charteristics
1 parent 636fe2c commit 0a97a07

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

read_characteristics.py

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,16 +7,17 @@
77

88

99
# connect (enter your own devices MAC address of course)
10-
zei = btle.Peripheral('f1:05:a5:9c:2e:9b', 'random', iface=1)
10+
zei = btle.Peripheral('f1:05:a5:9c:2e:9b', 'random', iface=0)
1111

1212

1313
try:
1414
data=[]
1515
for i, c in enumerate(zei.getCharacteristics()):
16-
data.append((i, c.uuid.getCommonName(), c.propertiesToString(), c.getHandle()))
16+
data.append((i, str(c.uuid), c.uuid.getCommonName(), c.propertiesToString(), c.getHandle()))
1717

1818
print tabulate(tabular_data=data,
19-
headers=["", "Characteristics", "Properties", "Handle"])
19+
headers=["Idx", "UUID", "Characteristics", "Properties", "Handle"],
20+
tablefmt="pipe")
2021

2122
finally:
2223
zei.disconnect()

0 commit comments

Comments
 (0)