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>SendTo</title>
8  </head>
9  <body>
10<h1><CODE><a href="../../../nn/Overview.html">nn</a>::<a href="../../../nn/uds/Overview.html">uds</a>::<a href="../../../nn/uds/CTR/Overview.html">CTR</a>::SendTo</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> SendTo(
15     const <a href="../../../nn/uds/CTR/EndpointDescriptor/Overview.html">EndpointDescriptor</a> & endpointDesc,
16     const void * data,
17     size_t dataSize,
18     <a href="../../../nn_types/u16.html">u16</a> destNodeId,
19     <a href="../../../nn_types/u8.html">u8</a> port,
20     <a href="../../../nn_types/bit8.html">bit8</a> option = 0x00
21);
22</pre>
23    </div>
24<h2>Parameters</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.</td>
38        </tr>
39        <tr>
40<td>in</td>
41<th>data</th>
42<td>Pointer to the data to send. Specify a buffer aligned to 4 bytes. Make the buffer for storing the data of size <SPAN class="argument">dataSize</SPAN>, rounded up to a multiple of four.</td>
43        </tr>
44        <tr>
45<td>in</td>
46<th>dataSize</th>
47<td>Size of the data to send (in bytes). The maximum size of the data to send 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>in</td>
51<th>destNodeId</th>
52<td>Sending destination. Specify <a href="../../../nn/uds/CTR/BROADCAST_NODE_ID.html"><CODE>BROADCAST_NODE_ID</CODE></a> to broadcast the data.</td>
53        </tr>
54        <tr>
55<td>in</td>
56<th>port</th>
57<td>The port to use. Port number <CODE>0x00</CODE> is reserved by the system and cannot be used.</td>
58        </tr>
59        <tr>
60<td>in</td>
61<th>option</th>
62<td>Sending 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>Result::IsSuccess</CODE></th>
76<td>Process was successful.</td>
77        </tr>
78        <tr>
79<th><CODE>ResultNotInitialized</CODE></th>
80<td>The library is not initialized. Execute the <CODE><a href="../../../nn/uds/CTR/Initialize.html">Initialize</a></CODE> function.</td>
81        </tr>
82        <tr>
83<th><CODE>ResultInvalidState</CODE></th>
84<td>Not in an executable state. Returned when executed in a state other than master or client.</td>
85        </tr>
86        <tr>
87<th><CODE>ResultInvalidNode</CODE></th>
88<td>The target node does not exist on the network. It is possible you are disconnected.</td>
89        </tr>
90        <tr>
91<th><CODE>ResultTooLarge</CODE></th>
92<td><CODE>dataSize</CODE> exceeds <CODE><a href="../../../nn/uds/CTR/UDS_PACKET_PAYLOAD_MAX_SIZE.html">UDS_PACKET_PAYLOAD_MAX_SIZE</a></CODE>.</td>
93        </tr>
94        <tr>
95<th><CODE>ResultOutOfRange</CODE></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><CODE>ResultBufferIsFull</CODE></th>
100<td>When the <CODE>NO_WAIT</CODE> option is specified, occurs when packet sending exceeds the send capacity of the wireless device. This can occur more frequently when the signal strength is bad.</td>
101        </tr>
102        <tr>
103<th><CODE>ResultWirelessOff</CODE></th>
104<td>Entered wireless-disabled mode. Re-initialization is required.</td>
105        </tr>
106        <tr>
107<th><CODE>ResultMisalignedAddress</CODE></th>
108<td><SPAN class="argument">data</SPAN> is not appropriate. It is possible it will succeed if you re-execute with an appropriate value for the argument.</td>
109        </tr>
110        <tr>
111<th>A value other than the above</th>
112<td>Failed for reasons other than those given above.</td>
113        </tr>
114      </table> </div>
115<h2>Description</h2>
116    <div class="section">
117<p>Sends data to the specified port on the specified partner's system.</p><p>This function blocks until it has finished sending data. The send method can be specified by using <CODE><A>NO_WAIT</A></CODE>, <CODE><A>FORCE_DIRECT_BC</A></CODE>, or <CODE><A>FORCE_UNICAST</A></CODE> for <CODE>option</CODE>. To specify multiple options, you can specify them with an <CODE>OR</CODE> option.<BR><BR> This function is thread-safe.</p><!-- write here --></div>
118<h2>Revision History</h2>
119    <div class="section">
120      <dl class="history">
121        <dt>2011/09/07</dt>
122<dd>Standardized notation for wireless-disabled mode.<br />
123        </dd>
124        <dt>2011/03/08</dt>
125<dd>Added a link to <CODE>UDS_PACKET_PAYLOAD_MAX_SIZE</CODE> in the description of the <SPAN class="argument">dataSize</SPAN> argument. Added a link to <CODE>BROADCAST_NODE_ID</CODE> in the description of the <SPAN class="argument">destNodeId</SPAN> argument. Added a link to <CODE>Initialize</CODE> in <B>Return Values</B>.<br />
126        </dd>
127        <dt>2010/10/15</dt>
128<dd>Expanded the information on the return values. Added a description of the added send options.<br />
129        </dd>
130        <dt>2010/06/14</dt>
131<dd>Initial version.<br />
132        </dd>
133      </dl>
134    </div>
135  <hr><p>CONFIDENTIAL</p></body>
136</html>