IanHarvey / bluepy

Python interface to Bluetooth LE on Linux
Other
1.6k stars 491 forks source link

incoming MIDI notifications not aligned with hcidump #421

Open evanraalte opened 4 years ago

evanraalte commented 4 years ago

Hi! First of all thank you for developing this library. I am having a lot of fun with it, while interfacing with my piano over BLE :)

There is an issue I am experiencing while handling notifications (in my case midi BLE messages). In my HCI snoop log, I receive every message exactly when I expect it. In this case (just to put it in context):

However, my delegate class has some issues printing everything at the expected time (eventually it receives everything). This is the handler I used for generating the data right now:

def handleNotification(self, cHandle, data):
        log.debug(f"raw data: {data.hex()}")

The notifications are here as follows:

I did not find any configuration option for minimizing / bundling / flushing messages. So I thought it might be something that is worth looking at?

If you think that I missed to provide some information on the logs, here is a side by side view of hcidump and my delegate handler. logging good 2

Also, please let me know if there is any other important information lacking in this issue :)

Erik