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/dlp/Overview.html">dlp</a>::<a href="../../../../nn/dlp/CTR/Overview.html">CTR</a>::<a href="../../../../nn/dlp/CTR/ServerWithName/Overview.html">ServerWithName</a>::Initialize</CODE> Member Function</h1>
11<h2>Syntax</h2>
12    <div class="section">
13      <pre class="definition">
14static <a href="../../../../nn/Result/Overview.html">nn::Result</a> Initialize(
15     bool * pNotice,
16     nn::Handle eventHandle,
17     <a href="../../../../nn_types/u8.html">u8</a> maxClientNum,
18     <a href="../../../../nn_types/u8.html">u8</a> childIndex,
19     void * pBuffer,
20     size_t bufferSize,
21     size_t blockBufferSize = <a href="../../../../nn/dlp/CTR/MIN_NETWORK_BLOCK_BUFFER_SIZE.html">MIN_NETWORK_BLOCK_BUFFER_SIZE</a> *2,
22     size_t blockBufferNum = <a href="../../../../nn/dlp/CTR/MIN_NETWORK_BLOCK_BUFFER_NUM.html">MIN_NETWORK_BLOCK_BUFFER_NUM</a>,
23     <a href="../../../../nn/cfg/CTR/UserName/Overview.html">nn::cfg::UserName</a> * pUserName = NULL
24);
25</pre>
26    </div>
27<h2>Parameters</h2>
28    <div class="section">
29      <table class="arguments">
30        <thead>
31          <tr>
32            <td width="15" />
33<th>Name</th>
34<td>Description</td>
35          </tr>
36        </thead>
37        <tr>
38<td>out</td>
39<th><CODE>pNotice</CODE></th>
40<td>Returns <CODE>true</CODE> if message display is required. For details, see the <STRONG>Description</STRONG> section on this page.</td>
41        </tr>
42        <tr>
43<td>in</td>
44<th><CODE>eventHandle</CODE></th>
45<td>Specifies a handle to the <CODE><a href="../../../../nn/os/Event/Overview.html">nn::os::Event</a></CODE> object, waiting for a signal from Download Play. Initialize the event in the application. Use the <CODE><a href="../../../../nn/dlp/CTR/Server/GetEventDesc.html">GetEventDesc</a></CODE> function to get the event information.</td>
46        </tr>
47        <tr>
48<td>in</td>
49<th><CODE>maxClientNum</CODE></th>
50<td>Specifies the maximum number of clients (from <CODE>1</CODE> to <CODE><a href="../../../../nn/dlp/CTR/MAX_CLIENT_NUM.html">MAX_CLIENT_NUM</a></CODE>) that can connect to the server.</td>
51        </tr>
52        <tr>
53<td>in</td>
54<th><CODE>childIndex</CODE></th>
55<td>Specify the index (the RSF <CODE>ChildIndex</CODE>) of the child program to distribute. You can specify a value between 0 and 255. (A server can have up to 256 children.)</td>
56        </tr>
57        <tr>
58<td>in</td>
59<th><CODE>pBuffer</CODE></th>
60<td>Pointer to the DLP working buffer. Must be 4096-byte aligned.</td>
61        </tr>
62        <tr>
63<td>in</td>
64<th><CODE>bufferSize</CODE></th>
65<td>Size of working buffer. Must be 4096-byte aligned.</td>
66        </tr>
67        <tr>
68<td>in</td>
69<th><CODE>blockBufferSize</CODE></th>
70<td>This is the size of the block buffer, when data that has been read from a file is kept before sending. Specify a size that is greater than or equal to <CODE><a href="../../../../nn/dlp/CTR/MIN_NETWORK_BLOCK_BUFFER_SIZE.html">MIN_NETWORK_BLOCK_BUFFER_SIZE</a></CODE>, and less than or equal to <CODE><a href="../../../../nn/dlp/CTR/MAX_NETWORK_BLOCK_BUFFER_SIZE.html">MAX_NETWORK_BLOCK_BUFFER_SIZE</a></CODE>.</td>
71        </tr>
72        <tr>
73<td>in</td>
74<th><CODE>blockBufferNum</CODE></th>
75<td>This is the number of block buffers. Specify a number greater than or equal to <CODE><a href="../../../../nn/dlp/CTR/MIN_NETWORK_BLOCK_BUFFER_NUM.html">MIN_NETWORK_BLOCK_BUFFER_NUM</a></CODE>, and less than or equal to <CODE><a href="../../../../nn/dlp/CTR/MAX_NETWORK_BLOCK_BUFFER_NUM.html">MAX_NETWORK_BLOCK_BUFFER_NUM</a></CODE>.</td>
76        </tr>
77        <tr>
78<td>in</td>
79<th><CODE>pUserName</CODE></th>
80<td>Specifies the user name. Handle the user name according to UGC guidelines and information given on this page. The user name set in system settings is used if <CODE>NULL</CODE> is specified here.</td>
81        </tr> </table>
82    </div>
83<h2>Return Values</h2>
84<div class="section">The following <a href="../../../../nn/Result/Overview.html"><CODE>Result</CODE></a> values are returned as the result of the operation.<br /> <br />
85      <table class="arguments">
86        <thead>
87          <tr>
88<th>Value</th>
89<td>Description</td>
90          </tr>
91        </thead>
92        <tr>
93<th><CODE>ResultSuccess</CODE></th>
94<td>Initialization was successful.</td>
95        </tr>
96        <tr>
97<th><CODE>ResultInvalidPointer</CODE></th>
98<td><SPAN class="argument">pBuffer</SPAN> is either <CODE>NULL</CODE> or not 4096-byte aligned.</td>
99        </tr>
100        <tr>
101<th><CODE>ResultOutOfRange</CODE></th>
102<td><CODE>maxClientNum</CODE>, <CODE>bufferSize</CODE>, <CODE>blockBufferSize</CODE>, and <CODE>blockBufferNum</CODE> are invalid.</td>
103        </tr>
104        <tr>
105<th><CODE>ResultInvalidHandle</CODE></th>
106<td><SPAN class="argument">eventHandle</SPAN> is invalid.</td>
107        </tr>
108        <tr>
109<th><CODE>ResultAlreadyOccupiedWirelessDevice</CODE></th>
110<td>The wireless device is already occupied for another purpose. Exit the other wireless process.</td>
111        </tr>
112        <tr>
113<th><CODE>ResultInternalError</CODE></th>
114<td>An irrecoverable error occurred internally.</td>
115        </tr>
116        <tr>
117<th><CODE>ResultWirelessOff</CODE></th>
118<td>Communication is impossible (the system is in Sleep Mode or wireless-disabled mode).</td>
119        </tr>
120        <tr>
121<th><CODE>ResultInvalidMediaType</CODE></th>
122<td>The media type of the parent device is not supported.</td>
123        </tr>
124        <tr>
125<th><CODE>ResultFailedToAccessMedia</CODE></th>
126<td>Cannot access the media. The child program may not be properly installed on the parent or a card may have been removed.</td>
127        </tr>
128        <tr>
129<th><CODE>ResultChildTooLarge</CODE></th>
130<td>The child program exceeds the standard import size (<CODE><a href="../../../../nn/dlp/CTR/MAX_CHILD_IMPORT_SIZE.html">MAX_CHILD_IMPORT_SIZE</a></CODE>).</td>
131        </tr>
132        <tr>
133<th><CODE>ResultInvalidRegion</CODE></th>
134<td>The child program and the system have different regions.</td>
135        </tr>
136      </table> </div>
137<h2>Description</h2>
138    <div class="section">
139<p>Initializes the server by specifying a user name.</p><p>This function is the same as <CODE>nn:dlp::Server::Initialize</CODE>, with the added ability to set a user name.<BR>Precautions regarding user names are described here.<BR>A check is made whether the user name given by <CODE>pUserName</CODE> (the <CODE>userName</CODE> member of <CODE>nn::cfg::UserName</CODE>) follows UGC guidelines. If it includes profanity, set the profanity flag (the <CODE>isNgUserName</CODE> member of <CODE>nn:cfg::UserName</CODE>) to <CODE>true</CODE>.<br /> If the profanity flag has been set to <CODE>true</CODE>, do not do anything to hide the profanity, just pass it to this function unaltered. <BR>Note, however, that the user name specified with this function can be obtained as node information, so when displaying the obtained user name together with other node information to a user, be sure to follow the guidelines for the profanity flag and process appropriately.<br />The reason the system needs to display user names by looking at the profanity flag is so that behavior matches download play of built-in system applications.<BR>You must therefore follow the instruction given here.</p><!-- write here --></div>
140<h2>Revision History</h2>
141    <div class="section">
142      <dl class="history">
143        <dt>2012/01/20</dt>
144<dd>Initial version.<br />
145        </dd>
146        <dt>2012/04/12</dt>
147<dd>Deleted the explanation about <CODE>ResultInvalidMediaType</CODE>.<br />
148        </dd>
149      </dl>
150    </div>
151  <hr><p>CONFIDENTIAL</p></body>
152</html>