abandonware / node-bluetooth-hci-socket

MIT License
43 stars 48 forks source link

TRANSFER STALLS at InEndpoint at high transmit rate #25

Closed mplutka closed 3 years ago

mplutka commented 3 years ago

Hi everybody, I need to transmit short packages (23 Bytes) of data at a high frequency (at least 60 Hz/every 16ms) to a connected BLE device. The device accepts a min connection interval of 7.5ms but insist on an mtu of 23.

So I'm using a setInterval loop to send a new write request every xx ms. Right now 30ms seem to work fine but anything below leads to an LIBUSB_TRANSFER_STALL on the InEndpoint. I guess this might have smth to do with response packets not being handled correctly. I attached a package capure of such an event. dump.zip

Do I need to change some parameter to make it more stable, increase some buffer or smth? Even tried to not use startPoll on the InEndpoint and use a custom loop at a lower rate to no avail.

I don't know much about USB communication so any help is appreciated. Thanks!