From be710d57ef5e3e5518c6fe156203483feaafccc8 Mon Sep 17 00:00:00 2001 From: Daniel Pollithy Date: Tue, 29 Aug 2017 14:13:15 +0200 Subject: [PATCH] fixed fuck up --- client.py | 23 ++++++++++++----------- 1 file changed, 12 insertions(+), 11 deletions(-) diff --git a/client.py b/client.py index 89b19a2..9a311dd 100644 --- a/client.py +++ b/client.py @@ -30,14 +30,15 @@ def send_payload(address): sock.close() -# while True: -# nearby_devices = bluetooth.discover_devices(lookup_names=True) -# print("found %d devices" % len(nearby_devices)) -# -# for addr, name in nearby_devices: -# print(" %s - %s" % (addr, name)) -# if addr == settings.PEER_BT_ADDRESS: -# print("PEERING PARTNER FOUND") -# send_payload(addr) -# -# time.sleep(settings.BT_SLEEP) \ No newline at end of file +if __name__ == '__main__': + while True: + nearby_devices = bluetooth.discover_devices(lookup_names=True) + print("found %d devices" % len(nearby_devices)) + + for addr, name in nearby_devices: + print(" %s - %s" % (addr, name)) + if addr == settings.PEER_BT_ADDRESS: + print("PEERING PARTNER FOUND") + send_payload(addr) + + time.sleep(settings.BT_SLEEP) \ No newline at end of file