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[cod]
|
||||||
*$py.class
|
*$py.class
|
||||||
|
|
||||||
|
config.py
|
||||||
|
|
|
@ -5,6 +5,11 @@ import eq3crypto
|
||||||
import os
|
import os
|
||||||
import config
|
import config
|
||||||
import sys
|
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()
|
pstart = time.time()
|
||||||
writeHandle = 0x411
|
writeHandle = 0x411
|
||||||
|
@ -53,6 +58,7 @@ if "open" in actionStr:
|
||||||
if "unlock" in actionStr:
|
if "unlock" in actionStr:
|
||||||
action = 1
|
action = 1
|
||||||
try:
|
try:
|
||||||
|
send_lsock(bytes([2,0,action]))
|
||||||
p = subprocess.Popen(["gatttool", "-I"], stdout=subprocess.PIPE, stdin=subprocess.PIPE)
|
p = subprocess.Popen(["gatttool", "-I"], stdout=subprocess.PIPE, stdin=subprocess.PIPE)
|
||||||
expect(p, "[LE]")
|
expect(p, "[LE]")
|
||||||
tsLog("INIT DONE")
|
tsLog("INIT DONE")
|
||||||
|
@ -73,6 +79,7 @@ try:
|
||||||
tsLog("DONE")
|
tsLog("DONE")
|
||||||
finally:
|
finally:
|
||||||
print("FINALLY")
|
print("FINALLY")
|
||||||
|
send_lsock(bytes([2,1,action]))
|
||||||
try:
|
try:
|
||||||
p.communicate(input=b"exit\n",timeout=2)
|
p.communicate(input=b"exit\n",timeout=2)
|
||||||
print("NORMAL EXIT")
|
print("NORMAL EXIT")
|
||||||
|
|
Loading…
Reference in a new issue