nn::applet::CTR::GetInitialWakeupState FunctionAppletWakeupState GetInitialWakeupState( void );
None.
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 Values | State | Expected Behavior |
|---|---|---|
applet::WAKEUP_TO_START | Woken up by a normal wakeup request. | Continues operating. |
applet::WAKEUP_BY_CANCEL | Woken up by a cancel notification. | Closes. |
applet::WAKEUP_BY_POWER_BUTTON_CLICK | Woken 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.
}
…
}
Enable function is called.
IsExpectedToCloseApplication function.
CONFIDENTIAL