btledev_private #2

Merged
sqozz merged 4 commits from btledev_private into master 2019-11-13 18:13:37 +01:00
Showing only changes of commit 6c83bccbde - Show all commits

View file

@ -48,10 +48,8 @@ class SEMSocket():
payload = bytearray() payload = bytearray()
payload.append(0x00) payload.append(0x00)
payload.append(0x00) payload.append(0x00)
payload.append(int(self.password[0])) for i in range(4):
payload.append(int(self.password[1])) payload.append(int(self.password[i]))
payload.append(int(self.password[2]))
payload.append(int(self.password[3]))
payload.append(0x00) payload.append(0x00)
payload.append(0x00) payload.append(0x00)
payload.append(0x00) payload.append(0x00)
@ -64,14 +62,10 @@ class SEMSocket():
payload = bytearray() payload = bytearray()
payload.append(0x00) payload.append(0x00)
payload.append(0x01) payload.append(0x01)
payload.append(int(newPassword[0])) for i in range(4):
payload.append(int(newPassword[1])) payload.append(int(self.newPassword[i]))
payload.append(int(newPassword[2])) for i in range(4):
payload.append(int(newPassword[3])) payload.append(int(self.password[i]))
payload.append(int(self.password[0]))
payload.append(int(self.password[1]))
payload.append(int(self.password[2]))
payload.append(int(self.password[3]))
self.password = newPassword self.password = newPassword
msg = self.BTLEMessage(self, cmd, payload) msg = self.BTLEMessage(self, cmd, payload)
msg.send() msg.send()
@ -138,8 +132,8 @@ class SEMSocket():
def __init__(self, btle_device, cmd=bytearray(), payload=bytearray()): def __init__(self, btle_device, cmd=bytearray(), payload=bytearray()):
self.__btle_device = btle_device self.__btle_device = btle_device
self.__cmd = cmd self.cmd = cmd
self.__payload = payload self.payload = payload
@property @property
def cmd(self): def cmd(self):