Anyone got SDL_JoystickSetLED to work?

I’m making a game controller diagnostic app (Game Controller Diagnostics by POW Games) which exposes every feature of SDL2. But I’m coming up against things that don’t work, including SDL_JoystickSetLED.

I purchased a cloned controller that pretends to be a PS4 controller. It works well, including the touch pad. But the LEDs do not change. SDL_JoystickHasLED is returning SDL_TRUE and SDL_JoystickSetLED returns success.

Does anyone have experience of this feature working or not?

I should add I’m using the latest SDL source code and I’ve tried it on Windows 10 and various Android platforms over both Bluetooth and wired.

I have it working for both SDL_GameControllerSetLED and SDL_JoystickSetLED. Also using a cloned PS4 on 2.0.16.

I opened as GameController then opened the joystick from SDL_GameControllerGetJoystick. For setting the led it was simply calling either of the two set LED functions with the correct instance. Worked over Bluetooth and wired on Win 10.

1 Like

Many thanks for that and welcome to SDL forums.

I rolled back to 2.0.16 and they’re still not working for me, so have to assume it’s the controller.

It’s probably not relevant, but are you working with 32bit or 64bit?

I am currently using 64bit. When I tested 32bit for my final target which is on an RPI only the joystick buttons/hat/axis is working. But that may be a different problem, I will try and compile for 32bit on Win10.

I did some more testing as I have a bunch of the PS4 clones. Models CUH-ZCT2E & CUH-ZCT1U seem to work fine over Bluetooth and USB. Model CUH-ZCT2U works over Bluetooth for everything, but the LED and everything works over USB.

Edit: Compiled for 32bit and it was working.

1 Like