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>Receive</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>::Receive</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> Receive(
15     void * pDst,
16     size_t size,
17     size_t * pReceiveSize,
18     <a href="../../../../nn_types/s32.html">s32</a> * pRemainCount
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>out</td>
34<th>pDst</th>
35<td>Specifies the address of the receive buffer to which to copy the data. Must be aligned on a 4-byte boundary.</td>
36        </tr>
37        <tr>
38<td>in</td>
39<th>size</th>
40<td>Specifies the receive buffer size. <br /><B>Note:</B> This buffer must be larger than the size of data actually being received.</td>
41        </tr>
42        <tr>
43<td>out</td>
44<th>pReceiveSize</th>
45<td>Stores the size of the receive data.</td>
46        </tr>
47        <tr>
48<td>out</td>
49<th>pRemainCount</th>
50<td>Stores the remaining number of receive packets.</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>ResultNoData</CODE></th>
76<td>There are no receive packets.</td>
77        </tr>
78        <tr>
79<th><CODE>ResultBufferInsufficient</CODE></th>
80<td>The size of the buffer where data are being copied is not large enough.</td>
81        </tr>
82        <tr>
83<th><CODE>ResultInvalidData</CODE></th>
84<td>Received invalid data.</td>
85        </tr>
86        <tr>
87<th><CODE>ResultMachineSleep</CODE></th>
88<td>Sleeping because the system is in Sleep Mode.</td>
89        </tr>
90        <tr>
91<th><CODE>ResultFatalError</CODE></th>
92<td>The IR module may be malfunctioning.</td>
93        </tr>
94      </table> </div>
95<h2>Description</h2>
96    <div class="section">
97<p>Receives data.</p><p>Copies the user data portion of a received packet to the specified buffer. Data are copied in units of packets, so if multiple packets have been received you will need to make repeated calls to this function.</p><p>Since security information is appended to data before it is sent, the receiving process requires a buffer that is 48 to 53 bytes larger than the data size. The size of buffer required depends on the size of data sent. Calculate the value using the <CODE>CalculateBufferSizeToCommunicate</CODE> function. (Note that you do <B>not</B> use the <CODE>GetPacketSize</CODE> function.) <br />The receive buffer also must be aligned on a 4-byte boundary.</p><p>If the connection is dropped while there is still receive data to be processed, the remaining data can be received up until the start of the next connection process.</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><p>Also note that if the passphrase specified by these functions differs from the passphrase configured by the communication partner, the two parties will not be able to establish communication. Data sending will succeed, but the receiving party will treat the received data as invalid data.</p><p>Even if you have received invalid data, until you execute this function you cannot run the process to determine that the data are invalid. If you have received any data, you must either run this function to conduct the receiving process, or run the <CODE>DropNextReceiveData</CODE> function to destroy the data.</p><!-- write here --></div>
98<h2>Revision History</h2>
99    <div class="section">
100      <dl class="history">
101        <dt>2011/08/30</dt>
102<dd>Initial version.<br />
103        </dd>
104      </dl>
105    </div>
106  <hr><p>CONFIDENTIAL</p></body>
107</html>
108