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>Send</title>
8  </head>
9  <body>
10<h1><CODE><a href="../../../../nn/Overview.html">nn</a>::<a href="../../../../nn/ir/Overview.html">ir</a>::<a href="../../../../nn/ir/CTR/Overview.html">CTR</a>::<a href="../../../../nn/ir/CTR/Communicator/Overview.html">Communicator</a>::Send</CODE> Member Function</h1>
11<h2>Syntax</h2>
12    <div class="section">
13      <pre class="definition">
14static <a href="../../../../nn/Result/Overview.html">Result</a> Send(
15     void * pBuffer,
16     size_t dataSize,
17     size_t bufferSize,
18     bool restore = false
19);
20</pre>
21    </div>
22<h2>Parameters</h2>
23    <div class="section">
24      <table class="arguments">
25        <thead>
26          <tr>
27            <td width="15" />
28<th>Name</th>
29<td>Description</td>
30          </tr>
31        </thead>
32        <tr>
33<td>in</td>
34<th>pBuffer</th>
35<td>Specifies the send buffer. Place the send data in this buffer starting from the head of the buffer, in intervals of <SPAN class="argument">dataSize</SPAN>. Must be aligned on a 4-byte boundary.</td>
36        </tr>
37        <tr>
38<td>in</td>
39<th><SPAN class="argument">dataSize</SPAN></th>
40<td>Specifies the size of the send data.</td>
41        </tr>
42        <tr>
43<td>in</td>
44<th>bufferSize</th>
45<td>Specifies the buffer size. <br /><B>Note:</B> This must be larger than the size of the send data.</td>
46        </tr>
47        <tr>
48<td>in</td>
49<th>restore</th>
50<td>Specifies whether the send buffer will be restored to its unencrypted state.</td>
51        </tr> </table>
52    </div>
53<h2>Return Values</h2>
54<div class="section">Returns the function's result. Returns one of the <a href="../../../../nn/Result/Overview.html"><CODE>Result</CODE></a> values listed below.<br /> <br />
55      <table class="arguments">
56        <thead>
57          <tr>
58<th>Value</th>
59<td>Description</td>
60          </tr>
61        </thead>
62        <tr>
63<th><CODE>Result::IsSuccess</CODE></th>
64<td>Process was successful.</td>
65        </tr>
66        <tr>
67<th><CODE>ResultNotConnected</CODE></th>
68<td>Not in the connected state.</td>
69        </tr>
70        <tr>
71<th><CODE>ResultCannotConfirm</CODE></th>
72<td>ID has not been confirmed.</td>
73        </tr>
74        <tr>
75<th><CODE>ResultPacketFull</CODE></th>
76<td>Insufficient management region for packet.</td>
77        </tr>
78        <tr>
79<th><CODE>ResultBufferInsufficient</CODE></th>
80<td>The region for storing packets is not large enough, or the send buffer is not large enough.</td>
81        </tr>
82        <tr>
83<th><CODE>ResultMachineSleep</CODE></th>
84<td>Sleeping because the system is in Sleep Mode.</td>
85        </tr>
86        <tr>
87<th><CODE>ResultFatalError</CODE></th>
88<td>The IR module may be malfunctioning.</td>
89        </tr>
90      </table> </div>
91<h2>Description</h2>
92    <div class="section">
93<p>Sends the specified data.</p><p>Since security information is added to the send buffer, the buffer must be 48 to 53 bytes larger than the size of data being sent. The size of buffer required depends on the size of data you want to send. Calculate the value using the <CODE>CalculateBufferSizeToCommunicate</CODE> function. (Note that you do <B>not</B> use the <CODE>GetPacketSize</CODE> function.) <br />The send buffer also must be aligned on a 4-byte boundary.</p><p>Since the data is sent after various processes including encryption are performed on the buffer, the buffer state is different from its original state when the function returns. If you specify <CODE>true</CODE> for the <SPAN class="argument">restore</SPAN> parameter, the function restores an area of <SPAN class="argument">dataSize</SPAN> length from the head of the buffer to its original state before returning. However, restoring causes the process to take slightly longer.</p><p>This function returns control before the sending process is completed. Packets are sent at times when the receive process is not taking place.<br />This function can send data in sizes ranging from 0 to 16316 bytes. At least <CODE>GetPacketSize(size)</CODE> bytes of space must be available in the region used to save outgoing packets and <CODE>GetManagementSize(1)</CODE> bytes of space must be available in the management region for outgoing packets. (These regions are specified when the <CODE>Initialize</CODE> function is called.)</p><p>In order for this function to succeed, you must first confirm the ID using the <CODE>RequireToConfirmId</CODE> function or the <CODE>WaitToConfirmId</CODE> function.<br /></p><!-- write here --></div>
94<h2>Revision History</h2>
95    <div class="section">
96      <dl class="history">
97        <dt>2011/10/05</dt>
98<dd>Revised descriptions related to the <SPAN class="argument">restore</SPAN> argument.<br />
99        </dd>
100        <dt>2011/08/30</dt>
101<dd>Initial version.<br />
102        </dd>
103      </dl>
104    </div>
105  <hr><p>CONFIDENTIAL</p></body>
106</html>