Ejemplo n.º 1
0
    def __init__(self, bus, name):
        self._bus = bus
        self._path = "/onebutton/service/%s" % ''.join([s for s in name if s.isdigit() or s.isalpha()])
        Profile.__init__(self, self._bus, self._path)

        self._services = {}
        self._handlers = {}

        self._name = name
        self._bt_uuid = str(uuid.uuid5(uuid.UUID(bytes=b"OneButtonBlueTNS"), name))

        self.start()
        log.info("BTService: Prepared bluetooth service %s %s" % (name, self._bt_uuid))
Ejemplo n.º 2
0
 def stop(self):
     log.info("BTService: Stopping bluetooth service %s %s" % (self._name, self._bt_uuid))
     self.unregister()
     Profile.stop(self)