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>CreateMessageBox</title>
8  </head>
9  <body>
10    <h1><CODE>nn::cec::CTR::MessageBox::CreateMessageBox</CODE> Member Function</h1>
11    <h2>Syntax</h2>
12    <div class="section">
13      <pre class="definition">
14<a href="../../../../nn/Result/Overview.html">nn::Result</a> CreateMessageBox(
15     const <a href="../../../../nn/cec/CTR/TitleId.html">TitleId</a> cecTitleId,
16     const u32 privateId,
17     const char * hmacKey,
18     void * icon,
19     size_t iconSize,
20     wchar_t * name,
21     size_t nameSize,
22     size_t inboxSizeMax = CEC_INBOX_SIZE_DEFAULT,
23     size_t outboxSizeMax = CEC_OUTBOX_SIZE_DEFAULT,
24     size_t inboxMessNumMax = CEC_INBOX_MESSNUM_DEFAULT,
25     size_t outboxMessNumMax = CEC_OUTBOX_MESSNUM_DEFAULT,
26     size_t messageSizeMax = CEC_MESSSIZEMAX_DEFAULT
27);
28</pre>
29    </div>
30    <h2>Arguments</h2>
31    <div class="section">
32      <table class="arguments">
33        <thead>
34          <tr>
35            <td width="15" />
36            <th>Name</th>
37            <td>Description</td>
38          </tr>
39        </thead>
40        <tr>
41          <td>in</td>
42          <th>cecTitleId</th>
43          <td>Unique title ID.</td>
44        </tr>
45        <tr>
46          <td>in</td>
47          <th>privateId</th>
48          <td>The key needed to open a message box.→ <a href="../../../../nn/cec/CTR/MessageBox/OpenMessageBox.html"><CODE>OpenMessageBox</CODE></a><br />The value used must be stored by the application accessing the message box.</td>
49        </tr>
50        <tr>
51          <td>in</td>
52          <th>hmacKey</th>
53          <td>Specifies the key needed to read a <a href="../../../../nn/cec/CTR/Message/Overview.html">Message</a>. Specify a string of 32 characters.</cf> This must be a key shared with the communication partner.<br /> This value is used to check if the transmitted data has been tampered with. Transmitted data is signed with a signature generated using this key. Use a value stored by the application.</td>
54        </tr>
55        <tr>
56          <td>in</td>
57          <th>icon</th>
58          <td>Specifies an icon.<br /> Format: RGB565 (little-endian)<br /> Size: 48 x 48 (4.5KB)<br /></td>
59        </tr>
60        <tr>
61          <td>in</td>
62          <th>iconSize</th>
63          <td>Specifies the size of the icon data.</td>
64        </tr>
65        <tr>
66          <td>in</td>
67          <th>name</th>
68          <td>Specifies an application name.<br /> Encoding UTF16-LE<br /> Display size: The number of characters displayable as 17 double-byte characters<br />Maximum buffer size: 64 x 2 B (including the <CODE>NULL</CODE> terminator)<br /></td>
69        </tr>
70        <tr>
71          <td>in</td>
72          <th>nameSize</th>
73          <td>Specifies the size of the application name.</td>
74        </tr>
75        <tr>
76          <td>in</td>
77          <th>inboxSizeMax</th>
78          <td>Specifies the maximum amount of data that can be saved in the inbox. The combined size of the inbox and outbox must be no more than 1 MB. The default size is 512 * 1024 bytes.</td>
79        </tr>
80        <tr>
81          <td>in</td>
82          <th>outboxSizeMax</th>
83          <td>Specifies the maximum amount of data that can be saved in the outbox. The combined size of the inbox and outbox must be no more than 1 MB. The default size is 512 * 1024 bytes.</td>
84        </tr>
85        <tr>
86          <td>in</td>
87          <th>inboxMessNumMax</th>
88          <td>Specifies the maximum number of messages that can be saved in the inbox. The default is 99, and this is the maximum specifiable value.</td>
89        </tr>
90        <tr>
91          <td>in</td>
92          <th>outboxMessNumMax</th>
93          <td>Specifies the maximum number of messages that can be saved in the outbox. The default is 99, and this is the maximum specifiable value.</td>
94        </tr>
95        <tr>
96          <td>in</td>
97          <th>messageSizeMax</th>
98          <td>Specifies the maximum size of a message. Messages that exceed this size cannot be saved. Attempting to do so causes an error when calling <CODE>WriteMessage</CODE>.</td>
99        </tr> </table>
100    </div>
101    <h2>Return Values</h2>
102    <div class="section"><a href="../../../../nn/Result/Overview.html"><CODE>nn::Result</CODE></a> </div>
103    <h2>Description</h2>
104    <div class="section">
105      <p>Creates a <CODE>MessageBox</CODE>. An inbox and outbox are created within the message box. Any <a href="../../../../nn/cec/CTR/Message/Overview.html">message</a> set in the outbox is automatically sent during StreetPass communication, and any received data is stored in the inbox.</p><p><CODE>MessageBox</CODE> objects are created in NAND memory. Only one box may be created for each application. Only 12 boxes may be created in total. Attempting to create a new message box when 12 already exist will not create a new box.</p><p>The <CODE>privateId</CODE> and <CODE>hmacKey</CODE> values are used to restrict access. The <CODE>privateId</CODE> value is the key needed to open a message box, and is intended to be limited to one system. The <CODE>hmacKey</CODE> value is a key common to all instances of an application, and is used to prevent data tampering and application spoofing. This key is stored in the message box. Set a shared key of the appropriate range if you need to access the same message box from multiple save data files or applications.</p><!-- write here --></div>
106    <h2>Revision History</h2>
107    <div class="section">
108      <dl class="history">
109        <dt>2010/08/16</dt>
110        <dd>Initial version.<br />
111        </dd>
112      </dl>
113    </div>
114  <hr><p>CONFIDENTIAL</p></body>
115</html>