new
This commit is contained in:
parent
da5c1c156a
commit
32ae69dd0f
10
server.py
10
server.py
@ -36,16 +36,14 @@ def hello():
|
|||||||
hex = hex.replace("#", "")
|
hex = hex.replace("#", "")
|
||||||
|
|
||||||
str = "56" + hex + "00f0aa"
|
str = "56" + hex + "00f0aa"
|
||||||
try:
|
# try:
|
||||||
result = subprocess.run(
|
result = subprocess.run(
|
||||||
[
|
[f"gatttool -i hci0 -b b2:3b:03:00:14:d6 --char-write-req -a 0x0009 -n {str}"],
|
||||||
f"gatttool -i hci0 -b b2:3b:03:00:14:d6 --char-write-req -a 0x0009 -n {str}"
|
|
||||||
],
|
|
||||||
stdout=subprocess.PIPE,
|
stdout=subprocess.PIPE,
|
||||||
).stdout.decode("utf-8")
|
).stdout.decode("utf-8")
|
||||||
if result != "Characteristic value was written successfully":
|
if result != "Characteristic value was written successfully":
|
||||||
raise Exception("Didn't work")
|
raise Exception("Didn't work")
|
||||||
else:
|
else:
|
||||||
return request.query_string
|
return request.query_string
|
||||||
except print(0):
|
# except print(0):
|
||||||
pass
|
# pass
|
||||||
|
Loading…
x
Reference in New Issue
Block a user