DisableSleep

nn::applet::CTR::DisableSleep Function

Syntax

void DisableSleep(
     bool isReplyReject = nn::applet::CTR::REPLY_REJECT_IF_LATER
);

Parameters

Name Description
in isReplyReject If true, performs applet::ReplySleepQuery(applet::REPLY_REJECT) when a sleep query comes.

Return Values

None.

Description

Prohibits Sleep Mode.

Once you use this function to disable Sleep Mode, and when nn::applet::CTR::IsActive returns TRUE, all values returned by the application to the sleep query callback (set by nn::applet::CTR::SetSleepQueryCallback) are thereafter handled as REPLY_REJECT. When nn::applet::CTR::IsActive returns FALSE, the sleep query callback function return values are used.

The system will not transition to sleep if any application or applet returns REPLY_REJECT to a sleep query.

This effectively disables sleep, but note that sleep query callbacks are still called when the system is closed.

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 isReplyReject argument.

ValueDescription
trueapplet::REPLY_REJECT_IF_LATERReturn REPLY_REJECT to sleep queries.
falseapplet::NO_REPLY_REJECTReturn nothing to sleep queries.

If true or applet::REPLY_REJECT_IF_LATER and sleep queries are enabled, the application returns REPLY_REJECT to any sleep queries.

If false or applet::NO_REPLY_REJECT, the application does not do this. In other words, the application does nothing regardless of whether sleep queries are enabled.

Specifying true or false for the isReplyReject argument only affects whether the function returns applet::REPLY_REJECT for this single call, and has no effect on any later calls.

It causes no problems to call this function again after you have already used it to disable Sleep Mode.

Revision History

2011/11/28
Clarified that setting values are only used when active.
2010/12/31
Explained that it is no problem to call this function more than once.
2010/12/01
Added operating details.
2010/11/29
Initial version.

CONFIDENTIAL