diff options
-rwxr-xr-x | dcs8000lh-configure.py | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/dcs8000lh-configure.py b/dcs8000lh-configure.py index fa057ec..636a0ad 100755 --- a/dcs8000lh-configure.py +++ b/dcs8000lh-configure.py @@ -3,12 +3,15 @@ import sys import hashlib import base64 -from bluepy.btle import Peripheral +from bluepy.btle import UUID, Peripheral + +dev_name_uuid = UUID(0x2A00) class BleCam(object): def __init__(self, address, pincode): self.pincode = pincode self.periph = Peripheral(address) + #print(self.periph) self.ipcamservice() self.dumpchars() self.experiment() @@ -34,8 +37,9 @@ class BleCam(object): if t.startswith("C="): self.challenge=t.split("=",2)[1] print("challenge is %s" % self.challenge) - name = "DCS-8000LH-CC73" + name = self.periph.getCharacteristics(uuid=dev_name_uuid)[0].read().decode() # "DCS-8000LH-CC73" hashit = name + self.pincode + self.challenge + print("will hash %s" % hashit) self.key = base64.b64encode(hashlib.md5(hashit.encode()).digest())[:16] print ("key is %s" % self.key) try: |