You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
how to stop main loop, because there is blocking, and and I can't call stop function, this my code
import gatt
manager = gatt.DeviceManager(adapter_name='hci0')
class AnyDevice(gatt.Device):
def services_resolved(self):
super().services_resolved()
device_proprietary_service = next(
s for s in self.services
if s.uuid == 'd0cbda9a-9a69-49ab-b4d1-a96d6fbd10c6')
psp = next(
c for c in device_proprietary_service.characteristics
if c.uuid == 'd0cb6c99-9a69-49ab-b4d1-a96d6fbd10c6')
how to stop main loop, because there is blocking, and and I can't call stop function, this my code
import gatt
manager = gatt.DeviceManager(adapter_name='hci0')
class AnyDevice(gatt.Device):
def services_resolved(self):
super().services_resolved()
psp.write_value(bytearray(b'\x0a'))
tes="\x1D\x5A\x02"
best=tes.encode()
psp.write_value(best)
kay="\x1B\x5A\x00\x4C\x08\x11\x00\x43\x44\x3A\x42\x30\x3A\x32\x31\x3A\x32\x31\x3A\x34\x30\x3A\x42\x33"
best=kay.encode()
psp.write_value(best)
class Manager(gatt.DeviceManager):
def run(self):
print("Running Manager")
super().run()
def quit(self):
print("Stopping Manager")
super().stop()
manager = Manager(adapter_name = 'hci0')
device = AnyDevice(mac_address='CD:B0:21:21:40:B3', manager=manager)
device.connect()
manager.run()
time.sleep(2)
manager.quit()
The text was updated successfully, but these errors were encountered: