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>ReceiveFrom</title>
8  </head>
9  <body>
10<h1><CODE>nn::uds::CTR::ReceiveFrom</CODE> Function</h1>
11<h2>Syntax</h2>
12    <div class="section">
13      <pre class="definition">
14<a href="../../../nn/Result/Overview.html">nn::Result</a> ReceiveFrom(
15     const <a href="../../../nn/uds/CTR/EndpointDescriptor/Overview.html">EndpointDescriptor</a> & endpointDesc,
16     void * pBuffer,
17     size_t * pReceivedSize,
18     u16 * pSrcNodeId,
19     size_t bufferSize,
20     bit8 option = 0x00
21);
22</pre>
23    </div>
24<h2>Arguments</h2>
25    <div class="section">
26      <table class="arguments">
27        <thead>
28          <tr>
29            <td width="15" />
30<th>Name</th>
31<td>Description</td>
32          </tr>
33        </thead>
34        <tr>
35<td>in</td>
36<th>endpointDesc</th>
37<td>Descriptor indicating the endpoint to use. The port and sending source must be attached in advance using the <a href="../../../nn/uds/CTR/Attach.html"><CODE>Attach</CODE></a> function.</td>
38        </tr>
39        <tr>
40<td>out</td>
41<th>pBuffer</th>
42<td>Received data storage location. Specify a buffer aligned to 4 bytes.</td>
43        </tr>
44        <tr>
45<td>out</td>
46<th>pReceivedSize</th>
47<td>Size of the received data. The UDS maximum received data size is <a href="../../../nn/uds/CTR/UDS_PACKET_PAYLOAD_MAX_SIZE.html"><CODE>UDS_PACKET_PAYLOAD_MAX_SIZE</CODE></a> bytes.</td>
48        </tr>
49        <tr>
50<td>out</td>
51<th>pSrcNodeId</th>
52<td>Sending source node ID.</td>
53        </tr>
54        <tr>
55<td>in</td>
56<th>bufferSize</th>
57<td>Size of the receive buffer (<SPAN class="argument">pBuffer</SPAN>).</td>
58        </tr>
59        <tr>
60<td>in</td>
61<th>option</th>
62<td>Receive options.</td>
63        </tr> </table>
64    </div>
65<h2>Return Values</h2>
66<div class="section">Returns the function's execution result. Returns one of the <a href="../../../nn/Result/Overview.html"><CODE>Result</CODE></a> values listed below. <br />
67      <table class="arguments">
68        <thead>
69          <tr>
70<th>Value</th>
71<td>Description</td>
72          </tr>
73        </thead>
74        <tr>
75<th><CODE>ResultSuccess</CODE></th>
76<td>Process was successful.</td>
77        </tr>
78        <tr>
79<th><CODE>ResultNotInitialized</CODE></th>
80<td>When the library is not initialized, returns that the specified endpoint does not exist.</td>
81        </tr>
82        <tr>
83<th>ResultInvalidState</th>
84<td>Not in an executable state. Returns that it was executed in a state where it was not connected to the network.</td>
85        </tr>
86        <tr>
87<th>ResultNotAuthorized</th>
88<td>Returns that an endpoint that was not attached was specified.</td>
89        </tr>
90        <tr>
91<th>ResultTooLarge</th>
92<td>Returns that the <CODE>bufferSize</CODE> was smaller than the received data. The desired size is <CODE>nn::uds::UDS_PACKET_PAYLOAD_MAX_SIZE</CODE>.</td>
93        </tr>
94        <tr>
95<th>ResultOutOfRange</th>
96<td>The specified argument was not in a specifiable range. It is possible it will succeed if you re-execute with an appropriate value for the argument.</td>
97        </tr>
98        <tr>
99<th>ResultWirelessOff</th>
100<td>Transitioned to wireless OFF mode. Re-initialization is required.</td>
101        </tr>
102        <tr>
103<th>A value other than the above.</th>
104<td>Failed for reasons other than those given above.</td>
105        </tr>
106      </table> </div>
107<h2>Description</h2>
108    <div class="section">
109<p>Receives data.</p><p>Receives packets sent to an endpoint for which the <CODE><A>Attach</A></CODE> function was executed. When there are no packets to be received, the function is blocked. (Excluding times when errors occur) when <CODE><A>NO_WAIT</A></CODE> is specified as an option, it is complete even when no packets have been received.</p><!-- write here --></div>
110<h2>Revision History</h2>
111    <div class="section">
112      <dl class="history">
113        <dt>2010/10/15</dt>
114<dd>Expanded the information on the return values. Revised the Description to make it easier to understand.<br />
115        </dd>
116        <dt>2010/09/24</dt>
117<dd>Noted that the buffer specified for <SPAN class="argument">pBuffer</SPAN> must be 4-byte aligned.
118        </dd>
119        <dt>2010/06/14</dt>
120<dd>Initial version.<br />
121        </dd>
122      </dl>
123    </div>
124  <hr><p>CONFIDENTIAL</p></body>
125</html>
126