nn::cec::CTR::MessageBox Classclass MessageBox
Class for accessing CEC MessageBox objects.
This allows you to create and delete boxes, read and write messages, get box information, and so forth. By creating a box with the CreateMessageBox function and then opening it with the OpenMessageBox function, you can access the messages in that box. You can use the WriteMessage function to write messages to a box. Messages written to the outbox are sent. Received messages are stored in the reception box and can be read with ReadMessage.
Call the CloseMessageBox function when you have finished accessing the box. When a message is created and written, a MessageId is given to the message. The MessageID is a randomly generated unique value, and each message is accessed using this value as the key.
Information, such as the attributes of individual messages, can be obtained with the GetMessageXXX functions.
Because the GetMessageXXX functions retrieve information from the message list stored in the system, they can acquire information faster than the message itself can be accessed with ReadMessage.
It is possible that the message list stored by the system and the information of the message itself may become unsynchronized due to an expected power outage, etc. (For example, you may be able to get the message ID but ReadMessage may fail.) The message list is regenerated when a message is written with WriteMessage, but if processing enters an irrecoverable state delete it using DeleteAllMessages and DeleteMessageBox.
The EULA version to which the user has agreed is checked when a message is written by the WriteMessage function. You must initialize the FS library in advance because FS library features are used to check this.
| Create/Delete a Message Box | ||
|---|---|---|
CreateMessageBox
|
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. |
|
DeleteMessageBox
|
Deletes a MessageBox. |
|
OpenMessageBox
|
Opens a MessageBox. You must use this function to open a box before you can access the messages within it. |
|
| CloseMessageBox | Closes the MessageBox. The messages are not accessible thereafter. |
|
| IsOpened | Gets whether a MessageBox is already opened. | |
| Message Operations | ||
ReadMessage
|
Reads a message. | |
WriteMessage
|
Writes a message to the system save region. | |
DeleteMessage
|
Deletes a message. | |
| DeleteAllMessages | Deletes all messages in the box. | |
| CommitMessageBox | Commits the data written in the system save region. | |
| Controlling Boxes and Getting Information | ||
GetMessageBoxData
|
Gets the data associated with a MessageBox. |
|
GetMessageBoxDataSize
|
Gets the data size associated with a MessageBox. |
|
SetMessageBoxData
|
Sets the data associated with a MessageBox. |
|
SetMessageBoxName
|
Sets a MessageBox's name. |
|
SetMessageBoxIcon
|
Sets a MessageBox's icon. |
|
GetMessageBoxName
|
Gets a MessageBox's name. |
|
GetMessageBoxIcon
|
Gets a MessageBox's icon. |
|
| Getting Message Box Information | ||
GetBoxFlag
|
Gets the attributes of a MessageBox. |
|
GetBoxSizeMax
|
Gets the capacity of the inbox or outbox. | |
GetBoxSize
|
Gets the current size of the inbox or outbox. | |
GetBoxMessNumMax
|
Gets the maximum number of messages in the inbox or outbox. | |
GetBoxMessNum
|
Gets the number of messages in the inbox or outbox. | |
GetBoxGroupNumMax
|
Gets the maximum number of message groups in the inbox or outbox. | |
GetBoxGroupNum
|
Gets the number of message groups in the inbox or outbox. | |
SetBoxGroupNumMax
|
Sets the maximum number of message groups in the inbox or outbox. | |
GetBoxSessionNum
|
Gets the Session ID count for (the number of items received in) the inbox. | |
| Getting Message Information (old API) | ||
GetInBoxMessIdByIndex
|
Gets the MessageID of the nth message in the inbox. |
|
GetOutBoxMessIdByIndex
|
Gets the MessageID of the nth message in the outbox. |
|
GetMessSizeByMessId
|
Gets the size of the message with the specified MessageID. |
|
| Getting Message Information | ||
GetMessageMessSize
|
Gets the size of a message. | |
GetMessageBodySize
|
Gets the size of a message's body. | |
GetMessageGroupId
|
Gets the group ID of a message. | |
GetMessageSessionId
|
Gets an inbox message's session ID. (The ID assigned when received.) | |
GetMessageMessTypeFlag
|
Gets the CecMessageTypeFlag of a message. |
|
GetMessageSendMode
|
Gets the SendMode of a message. |
|
GetMessageSendCount
|
Gets the send count of a message. | |
GetMessagePropagationCount
|
Gets the propagation count of a message. | |
GetMessageTag
|
Gets the message tag of a message. | |
GetMessageSendDate
|
Gets the timestamp of when a received message was sent. | |
GetMessageRecvDate
|
Gets the timestamp of when a message was received. | |
GetMessageCreateDate
|
Gets the timestamp of when a message was created. | |
GetMessageMessIdPair
|
Gets the pair of MessageIDs corresponding to a message exchange. |
|
GetMessageMessId
|
Gets the MessageID of a message. |
|
GetMessIndex
|
Gets a message's index (messIndex) based on its MessageID. |
|
| Other | ||
SetBoxActivate
|
Specifies whether a MessageBox is enabled or disabled. A disabled box will not have any data sent or received. |
|
GetBoxActivate
|
Gets whether a MessageBox is enabled or disabled. A disabled box will not have any data sent or received. |
|
RoundOutBoxIndex
|
Moves the Message with the specified MessageID to the end of the outbox's outgoing message queue.( The queue order is automatically changed when a message is sent, so there is normally no need to call this function.) |
|
CONFIDENTIAL