1<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> 2<html xml:lang="en-US" lang="en-US" xmlns="http://www.w3.org/1999/xhtml"> 3 <head> 4 <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> 5 <meta http-equiv="Content-Style-Type" content="text/css" /> 6 <link rel="stylesheet" href="../../../../css/manpage.css" type="text/css" /> 7<title>NewMessage</title> 8 </head> 9 <body> 10<h1><CODE><a href="../../../../nn/Overview.html">nn</a>::<a href="../../../../nn/cec/Overview.html">cec</a>::<a href="../../../../nn/cec/CTR/Overview.html">CTR</a>::<a href="../../../../nn/cec/CTR/Message/Overview.html">Message</a>::NewMessage</CODE> Member Function</h1> 11<h2>Syntax</h2> 12 <div class="section"> 13 <pre class="definition"> 14<a href="../../../../nn/Result/Overview.html">nn::Result</a> NewMessage( 15 <a href="../../../../nn/cec/CTR/TitleId.html">TitleId</a> cecTitleId, 16 <a href="../../../../nn_types/u32.html">u32</a> groupId, 17 <a href="../../../../nn/cec/CTR/MessageTypeFlag.html">MessageTypeFlag</a> messageTypeFlag, 18 <a href="../../../../nn/cec/CTR/SendMode.html">SendMode</a> sendMode, 19 <a href="../../../../nn_types/u8.html">u8</a> sendCount, 20 <a href="../../../../nn_types/u8.html">u8</a> propagationCount, 21 const void * icon, 22 size_t iconSize, 23 const wchar_t * infoTextData, 24 size_t infoTextSize 25); 26</pre> 27 </div> 28<h2>Parameters</h2> 29 <div class="section"> 30 <table class="arguments"> 31 <thead> 32 <tr> 33 <td width="15" /> 34<th>Name</th> 35<td>Description</td> 36 </tr> 37 </thead> 38 <tr> 39<td>in</td> 40<th>cecTitleId</th> 41<td>StreetPass ID. Specify the value generated by <a href="../../../../nn/cec/CTR/MakeCecTitleId.html"><CODE>MakeCecTitleId</CODE></a>.</td> 42 </tr> 43 <tr> 44<td>in</td> 45<th>groupId</th> 46<td><CODE><a href="../../../../nn/cec/CTR/Message/Overview.html">Message</a></CODE> grouping ID<br /> If set to other than 0, messages with the same group ID will be sent together.<br />This is the same as the value set by the <a href="../../../../nn/cec/CTR/Message/SetGroupID.html"><CODE>SetGroupID</CODE></a> function.</td> 47 </tr> 48 <tr> 49<td>in</td> 50<th>messageTypeFlag</th> 51<td>Specifies whether the recipient is a <I>friend</I> or a <I>non-friend</I> using the <a href="../../../../nn/cec/CTR/MessageTypeFlag.html"><CODE>MessageTypeFlag</CODE></a> enumerated type. To send regardless of whether the recipient is a friend or a non-friend, specify (<CODE>MESSAGE_TYPEFLAG_NON_FRIEND | MESSAGE_TYPEFLAG_FRIEND</CODE>).</td> 52 </tr> 53 <tr> 54<td>in</td> 55<th>sendMode</th> 56<td>Specifies the send mode (receive only, send only, send and receive, or exchange) using the <CODE><a href="../../../../nn/cec/CTR/SendMode.html">SendMode</a></CODE> enumerated type. This is the same as the value set by the <a href="../../../../nn/cec/CTR/SendMode.html"><CODE>SetSendMode</CODE></a> function.</td> 57 </tr> 58 <tr> 59<td>in</td> 60<th>sendCount</th> 61<td>Specifies the send count.<br />The send count is decremented by one with each send. The data is no longer sent once the count reaches zero.<br />The send count and propagation count values cannot both be set to greater than 1 at the same time.<br />This is the same as the value set by the <a href="../../../../nn/cec/CTR/Message/SetSendCount.html"><CODE>SetSendCount</CODE></a> function.</td> 62 </tr> 63 <tr> 64<td>in</td> 65<th>propagationCount</th> 66<td>Specifies the propagation count.<br />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.<br />This is the same as the value set by the <a href="../../../../nn/cec/CTR/Message/SetPropagationCount.html"><CODE>SetPropagationCount</CODE></a> function.</td> 67 </tr> 68 <tr> 69<td>in</td> 70<th>icon</th> 71<td>Specifies an icon.<br />Format: RGB565 (little-endian)<br /> Size: 40 x 40 (3200 bytes)<br /></td> 72 </tr> 73 <tr> 74<td>in</td> 75<th>iconSize</th> 76<td>Specifies the size of the icon data.</td> 77 </tr> 78 <tr> 79<td>in</td> 80<th>infoTextData</th> 81<td>Sets the information text of a <a href="../../../../nn/cec/CTR/Message/Overview.html">Message</a>. Encoding: UTF16-LE<br /> Display size: The number of characters displayable as two lines of 16 double-byte characters<br />Maximum buffer size: 128 x 2 bytes (including line breaks and the <CODE>NULL</CODE> terminator)<br /></td> 82 </tr> 83 <tr> 84<td>in</td> 85<th>infoTextSize</th> 86<td>Specifies the data size for the information text of a <a href="../../../../nn/cec/CTR/Message/Overview.html">Message</a>.</td> 87 </tr> </table> 88 </div> 89<h2>Return Values</h2> 90<div class="section"><a href="../../../../nn/Result/Overview.html"><CODE>nn::Result</CODE></a><br /> <br /> 91 <table class="arguments"> 92 <thead> 93 <tr> 94<th>Value</th> 95<td>Description</td> 96 </tr> 97 </thead> 98 <tr> 99<th><CODE>Result::IsSuccess</CODE></th> 100<td>Process succeeded.</td> 101 </tr> 102 <tr> 103<th><CODE>ResultInvalidArgument</CODE></th> 104<td>An invalid value has been set.</td> 105 </tr> 106 <tr> 107<th><CODE>ResultInvalidCombination</CODE></th> 108<td>The send count and propagation count have both been set equal to a value of 2 or greater.</td> 109 </tr> 110 <tr> 111<th>A value other than the above.</th> 112<td>Process failed.</td> 113 </tr> 114 </table> </div> 115<h2>Description</h2> 116 <div class="section"> 117<p>Creates a new <a href="../../../../nn/cec/CTR/Message/Overview.html">message</a>.</p><p>This function sets the basic parameters. A message is sent via StreetPass after the <a href="../../../../nn/cec/CTR/Message/SetMessageBody.html"><CODE>SetMessageBody</CODE></a> function has set the body (data) of the message and the <a href="../../../../nn/cec/CTR/MessageBox/WriteMessage.html"><CODE>MessageBox::WriteMessage</CODE></a> function has written the message to the outbox.</p><!-- write here --></div> 118<h2>Revision History</h2> 119 <div class="section"> 120 <dl class="history"> 121 <dt>2010/08/16</dt> 122<dd>Initial version.<br /> 123 </dd> 124 </dl> 125 </div> 126 <hr><p>CONFIDENTIAL</p></body> 127</html>