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    <style type="text/css"><!--
8      span.static_style
9      {
10        font-size			: 8pt;
11        color				: white;
12        font-weight			: bold;
13        background			: #44f;
14        border-left			: solid 1px #aaf;
15        border-top			: solid 1px #aaf;
16        border-right		: solid 1px #00c;
17        border-bottom		: solid 1px #00c;
18        padding-left		: 2px;
19        padding-right		: 2px;
20      }
21      span.virtual_style
22      {
23        font-size			 : 8pt;
24        color				 : white;
25        font-weight			: bold;
26        background			: #0a0;
27        border-left			: solid 1px #0f0;
28        border-top			: solid 1px #0f0;
29        border-right		: solid 1px #060;
30        border-bottom		: solid 1px #060;
31        padding-left		: 2px;
32        padding-right		: 2px;
33      }
34      span.protected_style
35      {
36        font-size			 : 8pt;
37        color				 : white;
38        font-weight			: bold;
39        background			: #444;
40        border-left			: solid 1px #ccc;
41        border-top			: solid 1px #ccc;
42        border-right		: solid 1px #222;
43        border-bottom		: solid 1px #222;
44        padding-left		: 2px;
45        padding-right		: 2px;
46      }
47        --></style>
48<title>nn::cec::CTR</title>
49  </head>
50  <body>
51<h1><CODE><a href="../../../nn/Overview.html">nn</a>::<a href="../../../nn/cec/Overview.html">cec</a>::CTR</CODE> Namespace</h1>
52<h2>Description</h2>
53    <div class="section">
54<p>Namespace for the CEC library. <br />(This namespace can also be written without the <CODE>::CTR</CODE> portion.)</p><p>
55				CTR StreetPass is an improved and easier-to-use iteration of a similar Nintendo DS feature called Chance Encounter Communication (CEC).<br />Because the system performs the communication in the background, sending and receiving data can be performed simply by preparing the send data, regardless of the application running or its status. However, because an application's original communication processes cannot be implemented, there is a chance that implementation of send/receive methods that require special conditions may not be possible.
56			</p><p>
57				StreetPass communication is enabled by creating a StreetPass box in the area prepared by the system and registering StreetPass data as the message to send in it. This allows the system to automatically send/receive StreetPass data with communication partners.<br />There are 12 StreetPass boxes available. In principle, one application can exclusively own one StreetPass box. If all StreetPass boxes are already in use, no new StreetPass boxes can be created until the user deletes unnecessary StreetPass settings on the StreetPass management screen in the system settings.<br />The StreetPass box contains a send box (outbox) and a receive box (inbox). Each is allocated as a region to register StreetPass data to be sent and as a region to store received StreetPass data, respectively.<br />When two units that can perform StreetPass near each other and discover each other, the StreetPass box in the other unit's system region is scanned first. If there is a StreetPass box created with the same application (title ID) in the other's unit, communication begins only for the portion required for StreetPass send and receive data. When StreetPass data from several StreetPass boxes is to be sent, the data is sent from the smallest in size. But the communication partners may not remain in an area where they communicate long enough for all of the StreetPass send and receive data to be completed. When they are in the communication area for a short time, it is possible only the smallest data sent initially may be successfully communicated to the first person. For this reason, it is effective to keep the StreetPass data size as small as possible to increase the communication success rate. In addition, if they are not grouped, only one block of StreetPass data can be sent from one StreetPass box.<br />Depending on the settings, StreetPass data that can only be received can be saved, but be aware that StreetPass will not occur between receive-only data units. This situation also applies to StreetPass data that can only be sent. Specifically, if the first registered data is receive-only or send-only, StreetPass exchange will never occur, no matter how much time passes.<br /><br /><B>Note:</B> The system communicates once with each partner and remembers those partners. StreetPass with the same partner will not occur again until an average of 4 hours or a maximum of 8 hours elapses.<br /><B>Note:</B> StreetPass is not possible between a test unit (used for development) and a retail system.<br /><B>Note:</B> StreetPass does occur between systems whose regions are different.<br /></p></div>
58    <a name="class" id="class">
59<h2>Classes</h2>
60      <div class="section">
61        <table class="members">
62          <tr>
63            <th>
64<a href="../../../nn/cec/CTR/CecControl/Overview.html"><CODE>nn::cec::CTR::CecControl</CODE></a>
65            </th>
66<td>Changes StreetPass (CEC) status and gets information.</td>
67          </tr>
68          <tr>
69            <th>
70<a href="../../../nn/cec/CTR/Message/Overview.html"><CODE>nn::cec::CTR::Message</CODE></a>
71            </th>
72<td>Class that handles CEC <a href="../../../nn/cec/CTR/Message/Overview.html"><CODE>Message</CODE></a> objects.</td>
73          </tr>
74          <tr>
75            <th>
76<a href="../../../nn/cec/CTR/MessageBox/Overview.html"><CODE>nn::cec::CTR::MessageBox</CODE></a>
77            </th>
78<td>This class is used to access CEC <CODE>MessageBox</CODE> objects.</td>
79          </tr>
80          <tr>
81            <th>
82<a href="../../../nn/cec/CTR/MessageId/Overview.html"><CODE>nn::cec::CTR::MessageId</CODE></a>
83            </th>
84<td>Class that handles message IDs.</td>
85          </tr> </table>
86      </div>
87    </a> <a name="struct" id="struct">
88<h2>Structures</h2>
89      <div class="section">
90        <table class="members">
91          <tr>
92            <th>
93<a href="../../../nn/cec/CTR/CecNotificationParam/Overview.html"><CODE>nn::cec::CTR::CecNotificationParam</CODE></a>
94            </th>
95<td>Receive information for each box.</td>
96          </tr>
97          <tr>
98            <th>
99<a href="../../../nn/cec/CTR/CecNotificationData/Overview.html"><CODE>nn::cec::CTR::CecNotificationData</CODE></a>
100            </th>
101<td>Receive information.</td>
102          </tr> </table>
103      </div>
104    </a> <a name="enum" id="enum">
105<h2>Enumerated Types</h2>
106      <div class="section">
107        <table class="members">
108          <tr>
109            <td width="100"> </td>
110            <th>
111<a href="../../../nn/cec/CTR/CecBoxDataType.html"><CODE>CecBoxDataType</CODE></a>
112            </th>
113<td>Indicates the types of data associated with boxes.</td>
114          </tr>
115          <tr>
116            <td width="100"> </td>
117            <th>
118<a href="../../../nn/cec/CTR/CecBoxType.html"><CODE>CecBoxType</CODE></a>
119            </th>
120<td>Types used for inboxes and outboxes.</td>
121          </tr> </table>
122      </div>
123    </a> <a name="typedef" id="typedef">
124<h2><CODE>typedef</CODE> Definitions</h2>
125      <div class="section">
126        <table class="members">
127          <tr>
128<th class="category" colspan="3"><CODE>SendMode</CODE></th>
129          </tr>
130          <tr>
131            <td width="100" />
132            <th>
133<a href="../../../nn/cec/CTR/SendMode.html"><CODE>SendMode</CODE></a>
134            </th>
135<td>The sending mode for messages. This value is specified in the message.( <CODE><a href="../../../nn/cec/CTR/Message/NewMessage.html">Message::NewMessage</a></CODE> etc.)</td>
136          </tr>
137          <tr>
138<th class="category" colspan="3"><CODE>MessageTypeFlag</CODE></th>
139          </tr>
140          <tr>
141            <td width="100" />
142            <th>
143<a href="../../../nn/cec/CTR/MessageTypeFlag.html"><CODE>MessageTypeFlag</CODE></a>
144            </th>
145<td>Flag for switching <a href="../../../nn/cec/CTR/Message/Overview.html">messages</a> depending on the recipient. Specified in a message.( <CODE><a href="../../../nn/cec/CTR/Message/NewMessage.html">Message::NewMessage</a></CODE> etc.)</td>
146          </tr>
147          <tr>
148<th class="category" colspan="3"><CODE>MessageExHeaderType</CODE></th>
149          </tr>
150          <tr>
151            <td width="100" />
152            <th>
153<a href="../../../nn/cec/CTR/MessageExHeaderType.html"><CODE>MessageExHeaderType</CODE></a>
154            </th>
155<td>Data types for a <a href="../../../nn/cec/CTR/Message/Overview.html">message</a>'s extended header.</td>
156          </tr>
157          <tr>
158<th class="category" colspan="3">Other</th>
159          </tr>
160          <tr>
161            <td width="100" />
162            <th>
163<a href="../../../nn/cec/CTR/TitleId.html"><CODE>TitleId</CODE></a>
164            </th>
165<td>StreetPass ID format. This 32-bit value can be generated with the <a href="../../../nn/cec/CTR/MakeCecTitleId.html"><CODE>MakeCecTitleId</CODE></a> function.</td>
166          </tr> </table>
167      </div>
168    </a> <a name="constant" id="constant">
169<h2>Constants</h2>
170      <div class="section">
171        <table class="members">
172          <tr>
173<th class="category" colspan="4"><CODE>SendMode</CODE></th>
174          </tr>
175          <tr>
176            <td width="100">
177<span class="static_style" title="static">S</span>
178            </td>
179            <th>
180<span class="argument"><a href="../../../nn/cec/CTR/SENDMODE_RECV.html"><CODE>SENDMODE_RECV</CODE></a></span>
181            </th>
182<td width="100">const u8</td>
183<td>Receiving only.</td>
184          </tr>
185          <tr>
186            <td width="100">
187<span class="static_style" title="static">S</span>
188            </td>
189            <th>
190<span class="argument"><a href="../../../nn/cec/CTR/SENDMODE_SEND.html"><CODE>SENDMODE_SEND</CODE></a></span>
191            </th>
192<td width="100">const u8</td>
193<td>Sending only.</td>
194          </tr>
195          <tr>
196            <td width="100">
197<span class="static_style" title="static">S</span>
198            </td>
199            <th>
200<span class="argument"><a href="../../../nn/cec/CTR/SENDMODE_SENDRECV.html"><CODE>SENDMODE_SENDRECV</CODE></a></span>
201            </th>
202<td width="100">const u8</td>
203<td>Sending and receiving.</td>
204          </tr>
205          <tr>
206            <td width="100">
207<span class="static_style" title="static">S</span>
208            </td>
209            <th>
210<span class="argument"><a href="../../../nn/cec/CTR/SENDMODE_EXCHANGE.html"><CODE>SENDMODE_EXCHANGE</CODE></a></span>
211            </th>
212<td width="100">const u8</td>
213<td>Exchange.</td>
214          </tr>
215          <tr>
216<th class="category" colspan="4"><CODE>MessageTypeFlag</CODE></th>
217          </tr>
218          <tr>
219            <td width="100">
220<span class="static_style" title="static">S</span>
221            </td>
222            <th>
223<span class="argument"><a href="../../../nn/cec/CTR/MESSAGE_TYPEFLAG_NON_FRIEND.html"><CODE>MESSAGE_TYPEFLAG_NON_FRIEND</CODE></a></span>
224            </th>
225<td width="100">const u8</td>
226<td><I>Non-friends</I> can receive the message.</td>
227          </tr>
228          <tr>
229            <td width="100">
230<span class="static_style" title="static">S</span>
231            </td>
232            <th>
233<span class="argument"><a href="../../../nn/cec/CTR/MESSAGE_TYPEFLAG_FRIEND.html"><CODE>MESSAGE_TYPEFLAG_FRIEND</CODE></a></span>
234            </th>
235<td width="100">const u8</td>
236<td><I>Friends</I> can receive the message.</td>
237          </tr>
238          <tr>
239            <td width="100">
240<span class="static_style" title="static">S</span>
241            </td>
242            <th>
243<span class="argument"><a href="../../../nn/cec/CTR/MESSAGE_TYPEFLAG_ANYONE.html"><CODE>MESSAGE_TYPEFLAG_ANYONE</CODE></a></span>
244            </th>
245<td width="100">const u8</td>
246<td>Receivable without checking whether the sender is a friend or not a friend.</td>
247          </tr>
248          <tr>
249<th class="category" colspan="4"><CODE>MessageExHeaderType</CODE></th>
250          </tr>
251          <tr>
252            <td width="100">
253<span class="static_style" title="static">S</span>
254            </td>
255            <th>
256<span class="argument"><a href="../../../nn/cec/CTR/MESSAGE_EXHEADER_TYPE_ICON.html"><CODE>MESSAGE_EXHEADER_TYPE_ICON</CODE></a></span>
257            </th>
258<td width="100"><CODE>const u32</CODE></td>
259<td>Description of each <a href="../../../nn/cec/CTR/Message/Overview.html">Message</a> icon. <br />Use this to specify the <CODE><a href="../../../nn/cec/CTR/MessageExHeaderType.html">MessageExHeaderType</a></CODE>.</td>
260          </tr>
261          <tr>
262            <td width="100">
263<span class="static_style" title="static">S</span>
264            </td>
265            <th>
266<span class="argument"><a href="../../../nn/cec/CTR/MESSAGE_EXHEADER_TYPE_INFO.html"><CODE>MESSAGE_EXHEADER_TYPE_INFO</CODE></a></span>
267            </th>
268<td width="100"><CODE>const u32</CODE></td>
269<td>Description of each <a href="../../../nn/cec/CTR/Message/Overview.html">Message</a> data item. <br />Use this to specify the <CODE><a href="../../../nn/cec/CTR/MessageExHeaderType.html">MessageExHeaderType</a></CODE>.</td>
270          </tr>
271          <tr>
272<th class="category" colspan="4">Send Count and Propagation Count</th>
273          </tr>
274          <tr>
275            <td width="100">
276<span class="static_style" title="static">S</span>
277            </td>
278            <th>
279<span class="argument"><a href="../../../nn/cec/CTR/MESSAGE_SENDCOUNT_ONCE.html"><CODE>MESSAGE_SENDCOUNT_ONCE</CODE></a></span>
280            </th>
281<td width="100">const u8</td>
282<td>Specifies the number of times to send. The message is sent only once.</td>
283          </tr>
284          <tr>
285            <td width="100">
286<span class="static_style" title="static">S</span>
287            </td>
288            <th>
289<span class="argument"><a href="../../../nn/cec/CTR/MESSAGE_SENDCOUNT_UNLIMITED.html"><CODE>MESSAGE_SENDCOUNT_UNLIMITED</CODE></a></span>
290            </th>
291<td width="100">const u8</td>
292<td>Specifies the number of times to send. It does not set a limit on the send count.</td>
293          </tr>
294          <tr>
295            <td width="100">
296<span class="static_style" title="static">S</span>
297            </td>
298            <th>
299<span class="argument"><a href="../../../nn/cec/CTR/MESSAGE_PROPAGATIONCOUNT_ONCE.html"><CODE>MESSAGE_PROPAGATIONCOUNT_ONCE</CODE></a></span>
300            </th>
301<td width="100">const u8</td>
302<td>Specifies the number of times to propagate. It does not initiate propagation.</td>
303          </tr>
304          <tr>
305<th class="category" colspan="4">Other</th>
306          </tr>
307          <tr>
308            <td width="100">
309<span class="static_style" title="static">S</span>
310            </td>
311            <th>
312<span class="argument"><a href="../../../nn/cec/CTR/CEC_SIZEOF_MESSAGEID.html"><CODE>CEC_SIZEOF_MESSAGEID</CODE></a></span>
313            </th>
314<td width="100">const s32</td>
315<td><a href="../../../nn/cec/CTR/MessageId/Overview.html"><CODE>MessageId</CODE></a> size.</td>
316          </tr>
317          <tr>
318            <td width="100">
319<span class="static_style" title="static">S</span>
320            </td>
321            <th>
322<span class="argument"><a href="../../../nn/cec/CTR/MESSAGE_BODY_SIZE_MAX.html"><CODE>MESSAGE_BODY_SIZE_MAX</CODE></a></span>
323            </th>
324<td width="100">const size_t</td>
325<td>Maximum size of the body of the message.</td>
326          </tr> </table>
327      </div>
328    </a> <a name="function" id="function">
329<h2>Functions</h2>
330      <div class="section">
331        <table class="members">
332          <tr>
333<th class="category" colspan="3">Initialize/Finalize</th>
334          </tr>
335          <tr>
336            <td width="100">  </td>
337            <th>
338<a href="../../../nn/cec/CTR/Initialize.html"><CODE>Initialize</CODE></a>
339            </th>
340<td>Connects to the CEC daemon. This must be called first to all access to the CEC functions.</td>
341          </tr>
342          <tr>
343            <td width="100">  </td>
344            <th>
345<a href="../../../nn/cec/CTR/Finalize.html"><CODE>Finalize</CODE></a>
346            </th>
347<td>Finalizes access to the CEC daemon.</td>
348          </tr>
349          <tr>
350<th class="category" colspan="3">Receipt notification</th>
351          </tr>
352          <tr>
353            <td width="100">  </td>
354            <th>
355<a href="../../../nn/cec/CTR/GetCecRecvEventHandle.html"><CODE>GetCecRecvEventHandle</CODE></a>
356            </th>
357<td>Specifies the <CODE>Event</CODE> object to receive reception notifications.</td>
358          </tr>
359          <tr>
360            <td width="100">  </td>
361            <th>
362<a href="../../../nn/cec/CTR/GetCecInfoBuffer.html"><CODE>GetCecInfoBuffer</CODE></a>
363            </th>
364<td>Gets information about a message received in the previous communication.</td>
365          </tr>
366          <tr>
367<th class="category" colspan="3">Other</th>
368          </tr>
369          <tr>
370            <td width="100">  </td>
371            <th>
372<a href="../../../nn/cec/CTR/MakeCecTitleId.html"><CODE>MakeCecTitleId</CODE></a>
373            </th>
374<td>Generates a 32-bit StreetPass ID (CecTitleId) that is used in StreetPass from a 20-bit unique ID.</td>
375          </tr> </table>
376      </div>
377    </a>
378<h2>Revision History</h2>
379    <div class="section">
380      <dl class="history">
381        <dt>2011/01/24</dt>
382<dd>Added information about the conditions for discovering a communication partner. Removed descriptions of the <CODE>MessageBoxInfoReader</CODE> class, since that class is not supported.<br />
383        </dd>
384        <dt>2010/08/16</dt>
385<dd>Initial version.<br />
386        </dd>
387      </dl>
388    </div>
389  <hr><p>CONFIDENTIAL</p></body>
390</html>
391