NewMessage

nn::cec::CTR::Message::NewMessage Member Function

Syntax

nn::Result NewMessage(
     TitleId cecTitleId,
     u32 groupId,
     MessageTypeFlag messageTypeFlag,
     SendMode sendMode,
     u8 sendCount,
     u8 propagationCount,
     const void * icon,
     size_t iconSize,
     const wchar_t * infoTextData,
     size_t infoTextSize
);

Parameters

Name Description
in cecTitleId StreetPass ID. Specify the value generated by MakeCecTitleId.
in groupId Message grouping ID
If set to other than 0, messages with the same group ID will be sent together.
This is the same as the value set by the SetGroupID function.
in messageTypeFlag Specifies whether the recipient is a friend or a non-friend using the MessageTypeFlag enumerated type. To send regardless of whether the recipient is a friend or a non-friend, specify (MESSAGE_TYPEFLAG_NON_FRIEND | MESSAGE_TYPEFLAG_FRIEND).
in sendMode Specifies the send mode (receive only, send only, send and receive, or exchange) using the SendMode enumerated type. This is the same as the value set by the SetSendMode function.
in sendCount 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.
The send count and propagation count values cannot both be set to greater than 1 at the same time.
This is the same as the value set by the SetSendCount function.
in propagationCount Specifies the propagation count.
If 2 or higher is specified, it will be copied to the outbox when received by the communication partner. The send count and propagation count values cannot both be set to greater than 1 at the same time.
This is the same as the value set by the SetPropagationCount function.
in icon Specifies an icon.
Format: RGB565 (little-endian)
Size: 40 x 40 (3200 bytes)
in iconSize Specifies the size of the icon data.
in infoTextData Sets the information text of a Message. Encoding: UTF16-LE
Display size: The number of characters displayable as two lines of 16 double-byte characters
Maximum buffer size: 128 x 2 bytes (including line breaks and the NULL terminator)
in infoTextSize Specifies the data size for the information text of a Message.

Return Values

nn::Result

Value Description
Result::IsSuccess Process succeeded.
ResultInvalidArgument An invalid value has been set.
ResultInvalidCombination The send count and propagation count have both been set equal to a value of 2 or greater.
A value other than the above. Process failed.

Description

Creates a new message.

This function sets the basic parameters. A message is sent via StreetPass after the SetMessageBody function has set the body (data) of the message and the MessageBox::WriteMessage function has written the message to the outbox.

Revision History

2010/08/16
Initial version.

CONFIDENTIAL