-
I implemented your library in python, works great, but very slowly with python, do you have sources for C ? or in Python I do something wrong ? t is my script (this script lost many values from server) import asyncio
import sys
from bleak import BleakClient
import time
data_f = []
FIRST_NAME_ID = '0000fe42-8e22-4541-9d4c-21edae82ed19'
address = "00:80:E1:26:62:70"
async def main(address):
async with BleakClient(address) as client:
def callback(FIRST_NAME_ID, data):
data_f.append(data[1])
#print (data[1])
event.set()
if len(data_f)==1000:
with open("file.txt", "w") as output:
output.write(str(data_f))
sys.exit()
await client.start_notify(FIRST_NAME_ID, callback)
print ("was connected")
while 1:
if not event.is_set():
await event.wait()
#await asyncio.sleep(0)
event.clear()
event = asyncio.Event()
print('address:', address)
asyncio.run(main(address)) |
Beta Was this translation helpful? Give feedback.
Answered by
dlech
May 12, 2023
Replies: 1 comment 3 replies
-
What operating system are you using? Do you have logs of Bluetooth packets over the air vs Bluetooth packets received by the OS vs |
Beta Was this translation helpful? Give feedback.
3 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
This would be once every 4 milliseconds. BLE connection intervals are generally something like every 30 or 60 milliseconds. HID devices might have a 15 ms interval. So there is no way the device could actually send notifications that frequently.
Using a Bluetooth sniffer will show you what is actually going over the air and when.