nn::applet::CTR::EnableSleep Function

Syntax

void EnableSleep(
     bool isSleepCheck = nn::applet::CTR::SLEEP_IF_SHELL_CLOSED
);

Arguments

Name Description
in isSleepCheck If true, enters into Sleep Mode operations if the system is closed.

Return Values

None.

Description

Enables sleep mode.

Once you use this function to enable Sleep Mode, the value that the application returns to the sleep query callback (as set by nn::applet::CTR::SetSleepQueryCallback) is thereafter what this function returns as its return value.

If Sleep Mode is disabled, all responses are handled as REPLY_REJECT. The system will not transition to sleep if any application or applet returns REPLY_REJECT to a sleep query, disabling sleep mode as a result.

Using this function to enable sleep essentially may mean that the application can return REPLY_ACCEPT to any sleep queries. (Even after calling this function, the system will not transition to sleep mode if the application itself returns REPLY_REJECT.)

The behavior of this function up to this point is always the same, regardless of the argument values it is given.

Specify one of the following as the value for the isSleepCheck argument.

ValueDescription
trueapplet::SLEEP_IF_SHELL_CLOSEDChecks once if the system is closed.
falseapplet::NO_SHELL_CHECKDoes not check if the system is closed.

If true or applet::SLEEP::IF_SHELL_CLOSED, the function will check once if the system is closed, and attempt to transition to sleep mode if it is closed.

If false or applet::NO_SHELL_CHECK, the function does not do this. The nn::applet::CTR::Enable function calls nn::applet::CTR::EnableSleep(applet::NO_SHELL_CHECK) internally.

Specifying true or false for the isSleepCheck argument only affects whether the function checks once if the system is closed for this single call, and has no effect on any later calls.

Revision History

2010/12/01
Added operating details.
2010/11/15
Initial version.

CONFIDENTIAL