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>AddFriendWithApproach</title>
8  </head>
9  <body>
10<h1><CODE><a href="../../../nn/Overview.html">nn</a>::<a href="../../../nn/friends/Overview.html">friends</a>::<a href="../../../nn/friends/CTR/Overview.html">CTR</a>::AddFriendWithApproach</CODE> Function</h1>
11<h2>Syntax</h2>
12    <div class="section">
13      <pre class="definition">
14<a href="../../../nn/Result/Overview.html">Result</a> AddFriendWithApproach(
15     <a href="../../../nn/os/Event/Overview.html">os::Event</a> * pEvent,
16     const <a href="../../../nnfriendsApproachContext/Overview.html">ApproachContext</a> & approachContext
17);
18</pre>
19    </div>
20<h2>Parameters</h2>
21    <div class="section">
22      <table class="arguments">
23        <thead>
24          <tr>
25            <td width="15" />
26<th>Name</th>
27<td>Description</td>
28          </tr>
29        </thead>
30        <tr>
31<td>in</td>
32<th><CODE>pEvent</CODE></th>
33<td>Specifies a pointer to <CODE><a href="../../../nn/os/Event/Overview.html">nn::os::Event</a></CODE>, which signals that asynchronous processing is complete. Initialize this ahead of time, using the <a href="../../../nn/os/Event/Initialize.html"><CODE>nn::os::Event::Initialize</CODE></a> function.</td>
34        </tr>
35        <tr>
36<td>in</td>
37<th><CODE>approachContext</CODE></th>
38<td>Specifies the approach context of the user to register as a friend.</td>
39        </tr> </table>
40    </div>
41<h2>Return Values</h2>
42<div class="section">Returns the result of the operation.<br /> <br />
43      <table class="arguments">
44        <thead>
45          <tr>
46<th>Value</th>
47<td>Description</td>
48          </tr>
49        </thead>
50        <tr>
51<th><CODE>Result::IsSuccess</CODE></th>
52<td>Process succeeded.</td>
53        </tr>
54        <tr>
55<th><CODE>ResultInvalidPointer</CODE></th>
56<td>Invalid pointer passed as argument.</td>
57        </tr>
58        <tr>
59<th><CODE>ResultInvalidHandle</CODE></th>
60<td>Invalid <CODE><a href="../../../nn/os/Event/Overview.html">nn::os::Event</a></CODE> handle passed as argument.</td>
61        </tr>
62        <tr>
63<th><CODE>ResultNotInitialized</CODE></th>
64<td>The friend presence library is not initialized.</td>
65        </tr>
66        <tr>
67<th><CODE>ResultFriendNumMax</CODE></th>
68<td>The friend list is full.</td>
69        </tr>
70        <tr>
71<th><CODE>ResultInvalidPreference</CODE></th>
72<td>Not configured in the privacy settings for the friend list first-time startup sequence.</td>
73        </tr>
74        <tr>
75<th><CODE>ResultAddFriendProhibited</CODE></th>
76<td>Adding a friend is prohibited by Parental Controls.</td>
77        </tr>
78        <tr>
79<th><CODE>ResultInvalidPrincipalId</CODE></th>
80<td>Attempted to register an approach context with the same principal ID as the local host.</td>
81        </tr>
82        <tr>
83<th>Other</th>
84<td>Another result may be returned, depending on the internal state of the daemon and other factors.</td>
85        </tr>
86      </table> </div>
87<h2>Description</h2>
88    <div class="section">
89<p>Adds a user that includes an approach context to the friend list.</p><p>If this function returns successfully, asynchronous processing begins. The event <a href="../../../nn/os/Event/Overview.html"><CODE>nn::os::Event</CODE></a> specified in the argument is signaled when asynchronous processing completes. Call the <a href="../../../nn/friends/CTR/GetLastResponseResult.html"><CODE>nn::friends::CTR::GetLastResponseResult</CODE></a> function to get the result of the asynchronous operation. If this function fails, no asynchronous processing occurs.<br /><br />When this function completes successfully, the registered user becomes a local friend.<br /><br />When using this function to add a friend, implement with a sequence so that both users must agree, and then each user is registered as a friend of the other user.<br /><br />Before using this function, you must first call <CODE><a href="../../../nn/cfg/CTR/Initialize.html">nn::cfg::CTR::Initialize</a></CODE> to initialize the <CODE>CFG</CODE> library.<br /><br />If you stop or restart the debugger immediately after a friend has been added, you might lose the content you just added. The same goes for transitioning from the card-removal screen to the HOME Menu on systems, including test (system) units. Wait around 15 seconds after adding a friend before conducting debugger operations. You do not need to take this into consideration when powering down systems the normal way or exiting applications.</p><!-- write here --></div>
90<h2>Revision History</h2>
91    <div class="section">
92      <dl class="history">
93        <dt>2012/04/24</dt>
94<dd>Removed <CODE>ResultMiiNotExists</CODE> from the Return Values and added <CODE>ResultInvalidPreference</CODE>.<br />
95        </dd>
96        <dt>2012/03/12</dt>
97<dd>Added a note about removing cards.<br />
98        </dd>
99        <dt>2012/02/16</dt>
100<dd>Added a note about stopping and restarting the debugger.<br />
101        </dd>
102        <dt>2012/01/05</dt>
103<dd>Changed the text &quot;offline friend&quot; to &quot;local friend.&quot;<BR>
104        </dd>
105        <dt>2011/12/16</dt>
106<dd>Initial version.<br />
107        </dd>
108      </dl>
109    </div>
110  <hr><p>CONFIDENTIAL</p></body>
111</html>