nn::applet::CTR::GetInitialWakeupState Function

Syntax

AppletWakeupState GetInitialWakeupState(
     void
);

Parameters

None.

Return Values

"Wakeup" information when an application is launched.

Description

Gets wakeup information when an application is launched.

An application is put into the waiting state within the nn::applet::CTR::Enable function until a wakeup notification arrives. To determine how it was woken up, you can get a value from the AppletWakeupState enumerated type using this function.

This function can obtain the following values.

Return ValuesStateExpected Behavior
applet::WAKEUP_TO_STARTWoken up by a normal wakeup request.Continues operating.
applet::WAKEUP_BY_CANCELWoken up by a cancel notification.Closes.
applet::WAKEUP_BY_POWER_BUTTON_CLICKWoken up by a POWER Button press.Closes.

Although the application must be closed for some of these values, use the nn::applet::CTR::IsExpectedToCloseApplication function in your application to make this decision instead of referencing these values directly. If the result is true, promptly close the application.

Example

  nnMain()
  {
       ...
    applet::Enable();
    if ( applet::IsExpectedToCloseApplication() )
       {
          _finalize_application();
          applet::PrepareToCloseApplication();
          applet::CloseApplication();
          // Execution doesn't reach this point.
     }
     …
  }

Revision History

2010/12/14
Explained how to determine whether to close an application after the Enable function is called.
2010/12/11
Revised text to recommend use of the IsExpectedToCloseApplication function.
2010/12/01
Added an example.
2010/11/10
Initial version.

CONFIDENTIAL