Stuff
This commit is contained in:
parent
ac92458573
commit
eceed89113
2 changed files with 8 additions and 0 deletions
1
.gitignore
vendored
1
.gitignore
vendored
|
@ -3,3 +3,4 @@ __pycache__/
|
|||
*.py[cod]
|
||||
*$py.class
|
||||
|
||||
config.py
|
||||
|
|
|
@ -5,6 +5,11 @@ import eq3crypto
|
|||
import os
|
||||
import config
|
||||
import sys
|
||||
import socket
|
||||
|
||||
lsock = socket.socket(family=socket.AF_INET, type=socket.SOCK_DGRAM)
|
||||
def send_lsock(msg):
|
||||
lsock.sendto(msg, ("127.0.0.1", 3667))
|
||||
|
||||
pstart = time.time()
|
||||
writeHandle = 0x411
|
||||
|
@ -53,6 +58,7 @@ if "open" in actionStr:
|
|||
if "unlock" in actionStr:
|
||||
action = 1
|
||||
try:
|
||||
send_lsock(bytes([2,0,action]))
|
||||
p = subprocess.Popen(["gatttool", "-I"], stdout=subprocess.PIPE, stdin=subprocess.PIPE)
|
||||
expect(p, "[LE]")
|
||||
tsLog("INIT DONE")
|
||||
|
@ -73,6 +79,7 @@ try:
|
|||
tsLog("DONE")
|
||||
finally:
|
||||
print("FINALLY")
|
||||
send_lsock(bytes([2,1,action]))
|
||||
try:
|
||||
p.communicate(input=b"exit\n",timeout=2)
|
||||
print("NORMAL EXIT")
|
||||
|
|
Loading…
Reference in a new issue