nn::cec::CTR::MessageBox::CreateMessageBox Member Function

Syntax

nn::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
);

Arguments

Name Description
in cecTitleId Unique title ID.
in privateId The key needed to open a message box.→ OpenMessageBox
The 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.5KB)
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 B (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, and this is the maximum specifiable value.
in outboxMessNumMax Specifies the maximum number of messages that can be saved in the outbox. The default is 99, and this 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.

Return Values

nn::Result

Description

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. Set a shared key of the appropriate range if you need to access the same message box from multiple save data files or applications.

Revision History

2010/08/16
Initial version.

CONFIDENTIAL