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>Initialize</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>::Initialize</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> Initialize(
15     <a href="../../../nn/os/Event/Overview.html">nn::os::Event</a> * pStatusUpdateEvent,
16     void * receiveBuffer,
17     const size_t bufferSize,
18     <a href="../../../nn/cfg/CTR/UserName/Overview.html">nn::cfg::UserName</a> * pUserName
19);
20</pre>
21    </div>
22<h2>Arguments</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><CODE>pStatusUpdateEvent</CODE></th>
35<td>Event used to notify about connection state updates. This is initialized as an auto-reset event within the library.</td>
36        </tr>
37        <tr>
38<td>in</td>
39<th><CODE>receiveBuffer</CODE></th>
40<td>Pointer indicating the head of the receive buffer used by the UDS library. Specify a buffer aligned to 4096 bytes. Device memory cannot be used. Access to the memory region specified by the buffer is prohibited until the <a href="../../../nn/uds/CTR/Finalize.html"><CODE>Finalize</CODE></a> function's execution is complete.</td>
41        </tr>
42        <tr>
43<td>in</td>
44<th><CODE>bufferSize</CODE></th>
45<td>Size of the receive buffer. Specify a value that is a multiple of 4096.</td>
46        </tr>
47        <tr>
48<td>in</td>
49<th><CODE>pUserName</CODE></th>
50<td>Specifies the user name. Handle user names according to UGC guidelines. System settings are used if NULL.</td>
51        </tr> </table>
52    </div>
53<h2>Return Values</h2>
54<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 /> <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>Initialization successful.</td>
65        </tr>
66        <tr>
67<th><CODE>ResultAlreadyOccupiedWirelessDevice</CODE></th>
68<td>Communication is already taking place. New UDS communication cannot begin.</td>
69        </tr>
70        <tr>
71<th><CODE>ResultOutOfResource</CODE></th>
72<td>System resources are insufficient.</td>
73        </tr>
74        <tr>
75<th><CODE>ResultWirelessOff</CODE></th>
76<td>Wireless-disabled mode.</td>
77        </tr>
78      </table> </div>
79<h2>Description</h2>
80    <div class="section">
81<p>Initializes the UDS library. Initialization fails if any other communication features are already in use.</p><p>This function may block for a long time because it finalizes communications in the background and the UDS library takes control of the communication device until <a href="../../../nn/uds/CTR/Finalize.html"><CODE>Finalize</CODE></a> is run. Always call the <a href="../../../nn/uds/CTR/Finalize.html"><CODE>Finalize</CODE></a> function to release the communication device after you have finished using the UDS library. Handle the user name given by <CODE>pUserName</CODE> according to UGC guidelines. This function is thread-unsafe.</p><!-- write here --></div>
82<h2>Revision History</h2>
83    <div class="section">
84      <dl class="history">
85        <dt>2011/09/07</dt>
86<dd>Standardized notation for wireless-disabled mode.<br />
87        </dd>
88        <dt>2010/10/15</dt>
89<dd>Expanded the information on the return values. Revised the Description to make it easier to understand.<br />
90        </dd>
91        <dt>2010/09/27</dt>
92<dd>Eliminated text from the description of <SPAN class="argument">receiveBuffer</SPAN> related to its purpose and noted that applications are prohibited from accessing the specified memory region until <CODE>Finalize</CODE> completes.
93        </dd>
94        <dt>2010/09/18</dt>
95<dd>Noted that this function may take some time to complete.
96        </dd>
97        <dt>2010/06/14</dt>
98<dd>Initial version.<br />
99        </dd>
100      </dl>
101    </div>
102  <hr><p>CONFIDENTIAL</p></body>
103</html>