adafruit / Adafruit_Blinka_bleio

`_bleio` for Blinka based on `bleak`
58 stars 19 forks source link

Fixed CharacteristicBuffer read function to handle timeouts. #60

Closed anthonytw closed 1 year ago

anthonytw commented 1 year ago

In the event of a connection timeout the read method will return a buffer with some data up front, zeros padding the end, and no indication of how many bytes were actually read. There's no way to distinguish between zeros padding the data and zeros occurring immediately before the timeout.

This fixes the problem by only returning a buffer the size of the data that was read.

Fixes #59