nn::cec::CTR::MessageBox::CreateMessageBox Member Functionnn::Result CreateMessageBox( const TitleId cecTitleId, const u32 privateId, const char * hmacKey, void * icon, size_t iconSize, wchar_t * name, size_t nameSize, size_t inboxSizeMax = CEC_INBOX_SIZE_DEFAULT, size_t outboxSizeMax = CEC_OUTBOX_SIZE_DEFAULT, size_t inboxMessNumMax = CEC_INBOX_MESSNUM_DEFAULT, size_t outboxMessNumMax = CEC_OUTBOX_MESSNUM_DEFAULT, size_t messageSizeMax = CEC_MESSSIZEMAX_DEFAULT );
| Name | Description | |
|---|---|---|
| in | cecTitleId | A 32-bit StreetPass ID. Can be generated with MakeCecTitleId. |
| in | privateId | The key needed to open a message box.→ OpenMessageBoxThe value used must be stored by the application accessing the message box. |
| in | hmacKey | Specifies the key needed to read a Message. Specify a string of 32 characters.This must be a key shared with the communication partner. 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. |
| in | icon | Specifies an icon. Format: RGB565 (little-endian) Size: 48 x 48 (4.5 KB) |
| in | iconSize | Specifies the size of the icon data. |
| in | name | Specifies an application name. Encoding UTF16-LE Display size: The number of characters displayable as 17 double-byte characters. Maximum buffer size: 64 x 2 bytes (including the NULL terminator) |
| in | nameSize | Specifies the size of the application name. |
| in | inboxSizeMax | 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. |
| in | outboxSizeMax | 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. |
| in | inboxMessNumMax | Specifies the maximum number of messages that can be saved in the inbox. The default is 99, which is the maximum specifiable value. |
| in | outboxMessNumMax | Specifies the maximum number of messages that can be saved in the outbox. The default is 99, which is the maximum specifiable value. |
| in | messageSizeMax | Specifies the maximum size of a message. Messages that exceed this size cannot be saved. Attempting to do so causes an error when calling WriteMessage. |
| Value | Description |
|---|---|
ResultSuccess |
Process succeeded. |
ResultBoxAlreadyExists |
The box already exists. |
ResultBoxNumFull |
The maximum number of boxes have been created. To create a new box, you must delete a box for another game title. |
ResultInvalidArgument |
An argument was specified incorrectly. |
ResultInvalidData |
There is a problem with the data being set. |
ResultStateBusy |
Unable to access because the daemon is busy. |
| A value other than the above. | Failed. |
Creates a MessageBox. An inbox and outbox are created within the message box. Any message set in the outbox is automatically sent during StreetPass communication, and any received data is stored in the inbox.
MessageBox 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. The privateId and hmacKey values are used to restrict access. The privateId value is the key needed to open a message box and is intended to be limited to one system. The hmacKey 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. Use the shared key for the appropriate configuration if you need to access the same message box from multiple save-data files or applications.
CONFIDENTIAL