From 4fbd13a7b363ca153f24f06f635240a573d65cd4 Mon Sep 17 00:00:00 2001 From: sqozz Date: Sat, 9 May 2020 16:39:43 +0200 Subject: [PATCH] Add reset functions --- sem6000.py | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/sem6000.py b/sem6000.py index 551c14f..4faa22d 100644 --- a/sem6000.py +++ b/sem6000.py @@ -97,6 +97,20 @@ class SEMSocket(): self.authenticated = self.authenticated and success return success + def clearHistory(self): + cmd = bytearray([0x15]) + payload = bytearray([0x00, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00]) + msg = self.BTLEMessage(self, cmd, payload) + success = msg.send() + return success + + def factoryReset(self): + cmd = bytearray([0x15]) + payload = bytearray([0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00]) + msg = self.BTLEMessage(self, cmd, payload) + success = msg.send() + return success + @property def name(self): self._name = self._name_char.read().decode("UTF-8")