ricardoquesada / bluepad32

Bluetooth gamepad, mouse and keyboard support for ESP32 and PicoW
https://bluepad32.readthedocs.io/
Other
503 stars 53 forks source link

Timeout selection need for disconnected controller #81

Closed mkornmue closed 3 months ago

mkornmue commented 3 months ago

Is there a way to select the timeout when no data is available from controller?

Now it appears that the timeout when the controller is not in range takes about 1 to 5 seconds or something?! I want to adjust this timeout to get a disconnected after 100ms at least.

Best way would be that within the Arduino setup function where the callbacks for on Connected and on Disconnected also the timeout can be specified.

Is there a way to do that?

ricardoquesada commented 3 months ago

The alternative is to use this: https://github.com/ricardoquesada/bluepad32/issues/42#issuecomment-1933270864

If you don't receive data in certain amount of time, then assume it is disconnected.

(closing it as duplicate... use the bug linked above if you need further clarification)

mkornmue commented 3 months ago

Thx. Thats solves my problem.