-
-
Save yasudacloud/9bf9ea3780f01817979bd146a7884b3e to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| write_char = "16860002-a5ae-9856-b6d3-dbb4c676993e" | |
| notify_char = "16860003-a5ae-9856-b6d3-dbb4c676993e" | |
| async with BleakClient( | |
| device, | |
| pair=True, | |
| services=[service_uuid], | |
| timeout=20 | |
| ) as client: | |
| ble_client = client | |
| writer = client.services.get_characteristic(write_char) | |
| notifier = client.services.get_characteristic(notify_char) | |
| # Notify開始 | |
| await client.start_notify(notifier, notification_handler) | |
| async def notification_handler(_, data: bytearray): | |
| print(data) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment