Page 1 of 1

ksceLedSetMode function arguments findings

Posted: Fri Apr 07, 2017 8:09 pm
by reprep
Trying to find arguments of ksceLedSetMode function which i used for the plugin noled. viewtopic.php?f=116&t=48017

It is defined as "int ksceLedSetMode(int led, int mode, void *led_configuration);" https://wiki.henkaku.xyz/vita/ScePower

The function seems similar to sceLedSetMode function in PSP but LEDS are different, so trying to find the correct arguments for Vita. for psp: http://uofw.github.io/uofw/group__LED.html

Argument led:
2 seems to control the blue light on home button, by passing "ksceLedSetMode(2, 0, NULL); home button stops glowing till a next event lights it, by passing "ksceLedSetMode(2, 1, NULL); home button begins to glow, by passing "ksceLedSetMode(2, 2, NULL); home button blinks rapidly. Unfortunately i couldn't find the argument for red light on home button.

Argument "mode" seems same as PSP:
[spoiler]enum SceLedModes
The possible LED control commands.

Enumerator:
SCE_LED_MODE_OFF
Turn a LED OFF.

SCE_LED_MODE_ON
Turn a LED ON.

SCE_LED_MODE_BLINK
Set a blink event for a LED.

SCE_LED_MODE_SELECTIVE_EXEC
Register LED configuration commands and execute them. Its use is not recommended, as it is still not completely known how that mode works.[/spoiler]

led configuration seems same as PSP too, though i haven't messed with it. It needs confirmation:
http://uofw.github.io/uofw/structSceLed ... ation.html

ERROR CODES:

SCE_ERROR_INVALID_LED: Error code 0x803F0140 if led>7
SCE_ERROR_INVALID_MODE: Error code 0x803F0141 if mode>4 or ((mode == 4) && (led != 2))

Re: ksceLedSetMode function arguments findings

Posted: Sat Apr 08, 2017 11:37 pm
by noname120
Have you tried 1 or 0 for the first argument?

Re: ksceLedSetMode function arguments findings

Posted: Sun Apr 09, 2017 6:34 am
by reprep
noname120 wrote:Have you tried 1 or 0 for the first argument?
yup, nothing happens. Well to be honest, i haven't checked the led in game slot, it is rarely seen anyways. But 0, 1, 3, 4, 5, 6 and 7 (all other possible values for first argument) has no effects.