nn::cec::CTR::Message Class

Syntax

class Message

Description

Class that handles CEC Message objects.

Parameters Set in Messages

The parameters set in messages placed in the outbox affect the message behavior, such as the search conditions for communication peers.
You can set multiple messages in the outbox, but the parameters set to the first message are the parameters that are used as conditions. When a message is sent successfully, that message is moved to the end of the queue.

MessageID

This identifies the message.
It is generated and assigned to a message by MessageBox::WriteMessage when it writes the message to a box.
Messages are deemed to be identical if they have the same message ID. A box cannot contain multiple instances of the same message.
This value cannot be changed manually.

GroupID

It is possible to place multiple messages in the outbox.
The oubox normally sends messages one at a time, in the order they were stored.
You can send multiple messages simultaneously by assigning them a non-zero GroupId.
If the first message in the outbox has a non-zero GroupId, then any other messages in the outbox with that same group ID will be sent together with it.
The total size of the grouped messages must be no more than 100 KB.

You can switch between sending to peers that are friends or non-friends by preparing multiple messages with different MessageTypeFlag values and the same GroupId.

MessageTypeFlag

Flag for switching messages depending on the recipient peer.
Specify MESSAGE_TYPEFLAG_ANYONE to send regardless of whether the peer is a friend.
Specify MESSAGE_TYPEFLAG_FRIEND to only send to peers that are registered as friends.
Specify MESSAGE_TYPEFLAG_NON_FRIEND to only send to peers that are not registered as friends.

SendMode

The sending mode for messages.
SENDMODE_RECV: Receive only
SENDMODE_SEND: Send only
SENDMODE_SENDRECV: Send and receive
SENDMODE_EXCHANGE: Exchange
When a peer attempts to send a message, if the send mode does not match, then the communication will fail.

The combinations are as follows.
Receive only: Can communicate when peer mode is "send only" or "send and receive"
Send only: Can communicate when peer mode is "receive only" or "send and receive"
Send and receive: Can communicate when peer mode is "receive only", "send only", or "send and receive"
Exchange: Can communicate when peer mode is "exchange"

Send count.

Specifies the send count. The send count is decremented by one with each send. The data is no longer sent once the count reaches zero.
If you specify MESSAGE_SENDCOUNT_UNLIMITED to the send count, this value is not decremented and the data are sent repeatedly.
If the data do not reach the peer because communications have been interrupted or for some other reason, the send count is not decremented.
The message remains in the outbox even after it has been sent and its send count is 0.
When the send count for all messages in an outbox reaches 0, sending from that box stops.

Propagation count.

Specifies the propagation count.
If this value is 2 or higher, the received data is copied to the outbox and sent to a different person.

The send count and propagation count values cannot both be set to greater than 1 at the same time.

Member Functions

New Message Creation
NewMessage Creates a new message.
Parameters
GetCecTitleId Gets the StreetPass ID of the Message.
SetGroupID Sets the Group ID for a Message. Messages in the outbox with the same GroupID are grouped and sent together.
GetGroupID Gets the Group ID of a message. Messages in the outbox with the same GroupID are grouped and sent together.
GetMessSize Gets the size of a message.
GetMessageSize Gets the size of a message.
GetHeaderSize Gets the size of a message header (including the extended header).
GetBodySize Gets the size of the body of a message.
GetMessageId Gets the MessageID for a Message. The MessageID is assigned when a message is created and then saved.
GetMessageId_Pair Gets the MessageID for the exchanged Message. If communication takes place with the "exchange" mode specified, the message ID of the message sent by the other peer (forming the pair) is recorded in the received message.
SetMessageTypeFlag Specifies the recipients using the MessageTypeFlag enumerated type.
GetMessageTypeFlag Gets the value specified for the message to be sent.
SetSendMode Specifies the send mode (receive only, send only, send and receive, or exchange) using the SendMode enumerated type.
GetSendMode Gets the send mode (receive only, send only, send and receive, or exchange).
GetSendDate Gets the timestamp of when a received message was sent (when StreetPass occurred). This is the time according to the sender's clock.
GetRecvDate Gets the timestamp of when a received message was received (when StreetPass occurred). This is the time according to the recipient's clock.
GetCreateDate Gets the creation timestamp of a message.
SetSendCount Specifies the send count. The send count is decremented by one with each send. The data is no longer sent once the count reaches zero.
GetSendCount Gets the send count. The send count is decremented by one with each send. The data is no longer sent once the count reaches zero.
SetPropagationCount Specifies the propagation count. The propagation count is decremented by one upon reception. The data is copied to the outbox if the count is still 1 or greater.
GetPropagationCount Gets the propagation count. The propagation count is decremented by one upon reception. The data is copied to the outbox if the count is still 1 or greater.
SetTag Sets the 16-bit value in the header of the Message.
GetTag Gets the Tag value from the header of a message.
SetExHeader Sets the extended header data for a message.
GetExHeader Gets data from the extended header of a message.
SetIcon Sets an icon for a message.
GetIcon Gets an icon from a Message.
SetInfoText Sets the information text of a Message.
GetInfoText Gets the description of a Message.
SetMessageBody Sets the data body of a message.
GetMessageBody Gets the body data of a Message.
GetMessageBodyPointer Gets a pointer to the body data of a Message.
Other
Message Constructor.
~Message Destructor.

Revision History

2011/03/11
Added information about parameters set in messages. Fixed broken links.
2010/08/16
Initial version.

CONFIDENTIAL