1<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
2<html xml:lang="en-US" lang="en-US" xmlns="http://www.w3.org/1999/xhtml">
3  <head>
4    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
5    <meta http-equiv="Content-Style-Type" content="text/css" />
6    <link rel="stylesheet" href="../../../css/manpage.css" type="text/css" />
7<title>GetInitialWakeupState</title>
8  </head>
9  <body>
10<h1><CODE><a href="../../../nn/Overview.html">nn</a>::<a href="../../../nn/applet/Overview.html">applet</a>::<a href="../../../nn/applet/CTR/Overview.html">CTR</a>::GetInitialWakeupState</CODE> Function</h1>
11<h2>Syntax</h2>
12    <div class="section">
13      <pre class="definition">
14<a href="../../../nn/applet/CTR/WakeupState.html">AppletWakeupState</a> GetInitialWakeupState(
15     void
16);
17</pre>
18    </div>
19<h2>Parameters</h2>
20    <div class="section">
21<p>None.</p>
22    </div>
23<h2>Return Values</h2>
24<div class="section">&quot;Wakeup&quot; information when an application is launched. </div>
25<h2>Description</h2>
26    <div class="section">
27<p>Gets wakeup information when an application is launched.</p><!-- write here --><P>
28An application is put into the waiting state within the <a href="../../../nn/applet/CTR/Enable.html"><CODE>nn::applet::CTR::Enable</CODE></a> function until a wakeup notification arrives. To determine how it was woken up, you can get a value from the <CODE>AppletWakeupState</CODE> enumerated type using this function.
29</P><P>
30This function can obtain the following values.
31</P><TABLE><THEAD><TR bgcolor="#ccccdd"><TH>Return Values</TH><TH>State</TH><TH>Expected Behavior</TH></TR></THEAD><TR><TD><CODE>applet::WAKEUP_TO_START</CODE></TD><TD>Woken up by a normal wakeup request.</TD><TD>Continues operating.</TD></TR><TR><TD><CODE>applet::WAKEUP_BY_CANCEL</CODE></TD><TD>Woken up by a cancel notification.</TD><TD>Closes.</TD></TR><TR><TD><CODE>applet::WAKEUP_BY_POWER_BUTTON_CLICK</CODE></TD><TD>Woken up by a POWER Button press.</TD><TD>Closes.</TD></TR></TABLE><P>
32Although the application must be closed for some of these values, use the <a href="../../../nn/applet/CTR/IsExpectedToCloseApplication.html"><CODE>nn::applet::CTR::IsExpectedToCloseApplication</CODE></a> function in your application to make this decision instead of referencing these values directly. If the result is <CODE>true</CODE>, promptly close the application.
33</P><P>
34Example
35</P><PRE>
36  nnMain()
37  {
38       ...
39    applet::Enable();
40    if ( <FONT color="red">applet::IsExpectedToCloseApplication()</FONT> )
41       {
42          _finalize_application();
43          applet::PrepareToCloseApplication();
44          applet::CloseApplication();
45          // Execution doesn't reach this point.
46     }
4748  }
49</PRE></div>
50<h2>Revision History</h2>
51    <div class="section">
52      <dl class="history">
53        <dt>2010/12/14</dt>
54<dd>Explained how to determine whether to close an application after the <CODE>Enable</CODE> function is called.
55        </dd>
56        <dt>2010/12/11</dt>
57<dd>Revised text to recommend use of the <CODE>IsExpectedToCloseApplication</CODE> function.
58        </dd>
59        <dt>2010/12/01</dt>
60<dd>Added an example.<br />
61        </dd>
62        <dt>2010/11/10</dt>
63<dd>Initial version.<br />
64        </dd>
65      </dl>
66    </div>
67  <hr><p>CONFIDENTIAL</p></body>
68</html>
69