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>A 32-bit StreetPass ID. Can be generated with <a href="../../../../nn/cec/CTR/MakeCecTitleId.html"><CODE>MakeCecTitleId</CODE></a>.</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.5 KB)<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 bytes (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, which 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, which 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><br /> <br /> 103 <table class="arguments"> 104 <thead> 105 <tr> 106 <th>Value</th> 107 <td>Description</td> 108 </tr> 109 </thead> 110 <tr> 111 <th><CODE>ResultSuccess</CODE></th> 112 <td>Process succeeded.</td> 113 </tr> 114 <tr> 115 <th><CODE>ResultBoxAlreadyExists</CODE></th> 116 <td>The box already exists.</td> 117 </tr> 118 <tr> 119 <th><CODE>ResultBoxNumFull</CODE></th> 120 <td>The maximum number of boxes have been created. To create a new box, you must delete a box for another game title.</td> 121 </tr> 122 <tr> 123 <th><CODE>ResultInvalidArgument</CODE></th> 124 <td>An argument was specified incorrectly.</td> 125 </tr> 126 <tr> 127 <th><CODE>ResultInvalidData</CODE></th> 128 <td>There is a problem with the data being set.</td> 129 </tr> 130 <tr> 131 <th><CODE>ResultStateBusy</CODE></th> 132 <td>Unable to access because the daemon is busy (BUSY state).</td> 133 </tr> 134 <tr> 135 <th>A value other than the above.</th> 136 <td>Failed.</td> 137 </tr> 138 </table> </div> 139 <h2>Description</h2> 140 <div class="section"> 141 <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.<br /><br /> The <SPAN class="argument">privateId</SPAN> and <SPAN class="argument">hmacKey</SPAN> values are used to restrict access. The <SPAN class="argument">privateId</SPAN> value is the key needed to open a message box and is intended to be limited to one system. The <SPAN class="argument">hmacKey</SPAN> value is a key common to all instances of an application and is used to prevent data tampering and application spoofing. These keys are stored in the message box. Set shared keys in an appropriate configuration if you need to access the same message box from multiple save-data files or applications.<br /><br /> There are two types of StreetPass icons used on System Settings screens and other screens. There is a box icon and an icon for individual messages. You must specify both. This function sets the box icon.</p><!-- write here --></div> 142 <h2>Revision History</h2> 143 <div class="section"> 144 <dl class="history"> 145 <dt>2010/08/16</dt> 146 <dd>Initial version.<br /> 147 </dd> 148 </dl> 149 </div> 150 <hr><p>CONFIDENTIAL</p></body> 151</html>