From eceed8911304f0ab88f97b19e9784a1feb0a729b Mon Sep 17 00:00:00 2001 From: 7marcus9 <7m9_c3hgit@7m9.eu> Date: Mon, 11 Jul 2022 22:10:01 +0200 Subject: [PATCH] Stuff --- .gitignore | 1 + keymatic.py | 7 +++++++ 2 files changed, 8 insertions(+) diff --git a/.gitignore b/.gitignore index 3b242c7..6ee96fd 100644 --- a/.gitignore +++ b/.gitignore @@ -3,3 +3,4 @@ __pycache__/ *.py[cod] *$py.class +config.py diff --git a/keymatic.py b/keymatic.py index 1f122a0..654b4a4 100755 --- a/keymatic.py +++ b/keymatic.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")