pygattlib icon indicating copy to clipboard operation
pygattlib copied to clipboard

No confirmation on indication

Open Jpvmello opened this issue 3 years ago • 1 comments

Hi,

I work with two devices which communicate via BLE. Currently, it is possible to send data from the device X to the device Y by enabling indications and confirming receipt via HVC event. However, I'm trying to simulate the device Y in my PC with this library without success. I can enable indications on both Ctrl and Pkt handles and start communication successfully and the pygattlib application can receive one package of data on the on_indication callback, but it does not send the HVC confirmation of the received package so the application stucks and I cannot continue receiving the rest of the data.

I'm almost sure that the problem is on my python application and not with the device X, since X and Y can communicate successfully. Any ideas on what could be wrong?

Jpvmello avatar Mar 22 '21 17:03 Jpvmello

I'm afraid that I don't think I have any devices that use indications, only notifications, so I can't test this. However looking at the code I see no reason why it shouldn't work - certainly pygattlib tries to send the confirmation packet (opcode 0x1e) just after calling the on_indication python callback. So unless you're doing something in that callback to deadlock it, it ought to be sent.

...assuming you're up to date, because an internal deadlock in that area was fixed in November (see #12)

jsgh avatar Mar 22 '21 21:03 jsgh