Closed piefel closed 1 year ago
Thank you for the bug report. We'll look into it. Sorry for the late response.
Hi, I pushed a fix. I tried to find the reason of why you'd experience such behavior, and the only thing I can see is that the callback were posted on a handler looper, and could have values updated. The fix above stores the current values and makes sure they are returned.
I use
writeCharacteristic()
and the default splitter withsplit()
taking aWriteProgressCallback
. The latter gets called with incorrect values.With
ble-ktx:2.4.1
, theindex
started at 1, probably unintentionally. My guess is thatWriteRequest::notifyPacketSent
is the place. The callback is called, then the count is incremented, but since the callback is posted to the handler, it gets the new value.With
ble-ktx:2.6.1
(don’t know where it started exactly) the index is still off by one, but now thedata
is wrong, too. It does not show the values that were actually transmitted, but some data that happen to be in some buffer, which is actually the next chunk by that time. I lose the first chunk of data in my logs, I get the last chunk twice.