nn::applet::CTR::EnableSleep Function
void EnableSleep(
bool isSleepCheck = nn::applet::CTR::SLEEP_IF_SHELL_CLOSED
);
| Name | Description | |
|---|---|---|
| in | isSleepCheck | If true, enters into Sleep Mode operations if the system is closed. |
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.
| Value | Description | |
|---|---|---|
true | applet::SLEEP_IF_SHELL_CLOSED | Checks once if the system is closed. |
false | applet::NO_SHELL_CHECK | Does 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.
After you call this function and enable sleep, it causes no problem to call this function again. You can also call this function for the purpose of checking whether the system is closed and then entering Sleep Mode.(The nn::applet::CTR::Enable function code sample uses this function for exactly that purpose.)
CONFIDENTIAL