JoyShockLibrary icon indicating copy to clipboard operation
JoyShockLibrary copied to clipboard

JslConnectDevices blocking when called again > JslDisconnectAndDisposeAll blocking if a device has been disconnected manually

Open benkuper opened this issue 4 years ago • 6 comments

Hello, I'm trying to find a way to have dynamic connection / disconnection detection to avoid having to relaunch the software everytime a joycon has been disconnected or reconnected. The first JslConnectDevices is working just fine, but if I power down and power again my joycons, calling this function again will be blocking and the function never returns.

Am I doing something wrong or is there a known issue there ?

BTW, the project I'm working on for this is that : https://benjamin.kuperberg.fr/chataigne / https://github.com/benkuper/Chataigne

Thank you for this wonderful lib, Cheers

benkuper avatar Oct 01 '21 08:10 benkuper

I pushed the researched a bit further and figured that JslDisconnectAndDisposeAll is the problematic function, only when at least one controller has been powered down manually. When calling this with all connected controllers still connected, the method returns quickly, but if the controller or one of the connected controllers is not actually connected anymore, the method never returns.

benkuper avatar Oct 01 '21 09:10 benkuper

Thanks! I'll have a look

JibbSmart avatar Oct 01 '21 09:10 JibbSmart

Sorry it took so long, @benkuper. I think I've fixed the issue in v2.3.0, but not sure, because I haven't had the chance to fully explore it.

JibbSmart avatar Oct 11 '21 04:10 JibbSmart

Thank you ! Is there a release for 2.3 ?

benkuper avatar Jan 07 '22 11:01 benkuper

Not yet, I'm afraid, but if you build from the latest on master it'll have what I think is the fix.

JibbSmart avatar Jan 08 '22 06:01 JibbSmart

Gotcha

benkuper avatar Jan 08 '22 13:01 benkuper