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/Server/Overview.html">Server</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); 24</pre> 25 </div> 26 <h2>Parameters</h2> 27 <div class="section"> 28 <table class="arguments"> 29 <thead> 30 <tr> 31 <td width="15" /> 32 <th>Name</th> 33 <td>Description</td> 34 </tr> 35 </thead> 36 <tr> 37 <td>out</td> 38 <th><CODE>pNotice</CODE></th> 39 <td>Returns <CODE>true</CODE> if message display is required. For details, see the Description section further down on this page.</td> 40 </tr> 41 <tr> 42 <td>in</td> 43 <th>eventHandle</th> 44 <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> 45 </tr> 46 <tr> 47 <td>in</td> 48 <th>maxClientNum</th> 49 <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> 50 </tr> 51 <tr> 52 <td>in</td> 53 <th>childIndex</th> 54 <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> 55 </tr> 56 <tr> 57 <td>in</td> 58 <th>pBuffer</th> 59 <td>Pointer to the DLP working buffer. Must be 4096-byte aligned.</td> 60 </tr> 61 <tr> 62 <td>in</td> 63 <th>bufferSize</th> 64 <td>Size of working buffer. Must be 4096-byte aligned.</td> 65 </tr> 66 <tr> 67 <td>in</td> 68 <th>blockBufferSize</th> 69 <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 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> 70 </tr> 71 <tr> 72 <td>in</td> 73 <th>blockBufferNum</th> 74 <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> 75 </tr> </table> 76 </div> 77 <h2>Return Values</h2> 78 <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 /> 79 <table class="arguments"> 80 <thead> 81 <tr> 82 <th>Value</th> 83 <td>Description</td> 84 </tr> 85 </thead> 86 <tr> 87 <th><CODE>Result::IsSuccess</CODE></th> 88 <td>Initialization was successful.</td> 89 </tr> 90 <tr> 91 <th><CODE>ResultInvalidPointer</CODE></th> 92 <td><SPAN class="argument">pBuffer</SPAN> is either NULL or not 4096-byte aligned.</td> 93 </tr> 94 <tr> 95 <th><CODE>ResultOutOfRange</CODE></th> 96 <td>maxClientNum, bufferSize, blockBufferSize, and blockBufferNum are invalid.</td> 97 </tr> 98 <tr> 99 <th><CODE>ResultInvalidHandle</CODE></th> 100 <td><SPAN class="argument">eventHandle</SPAN> is invalid.</td> 101 </tr> 102 <tr> 103 <th><CODE>ResultAlreadyOccupiedWirelessDevice</CODE></th> 104 <td>The wireless device is already occupied for another purpose. Exit the other wireless process.</td> 105 </tr> 106 <tr> 107 <th><CODE>ResultInternalError</CODE></th> 108 <td>An irrecoverable error occurred internally.</td> 109 </tr> 110 <tr> 111 <th><CODE>ResultWirelessOff</CODE></th> 112 <td>Communication is impossible (the system is in Sleep Mode or wireless-disabled mode).</td> 113 </tr> 114 <tr> 115 <th><CODE>ResultFailedToAccessMedia</CODE></th> 116 <td>Cannot access the media. The child program may not be properly installed on the parent or a card may have been removed.</td> 117 </tr> 118 <tr> 119 <th><CODE>ResultChildTooLarge</CODE></th> 120 <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> 121 </tr> 122 <tr> 123 <th><CODE>ResultInvalidRegion</CODE></th> 124 <td>The child program and the system have different regions.</td> 125 </tr> 126 </table> </div> 127 <h2>Description</h2> 128 <div class="section"> 129 <p>Initializes the server.</p><p>For the <SPAN class="argument">pBuffer</SPAN> argument, specify a 4096-byte aligned buffer of the size specified by the <CODE><a href="../../../../nn/dlp/CTR/Server/GetBufferSize.html">GetBufferSize</a></CODE> function. Do not use device memory for the buffer. The maximum import size for a child program that can be distributed is 32 MB.<br />The import size can be checked using the <B>RequiredSize</B> item that is displayed when you select a child device on the DevMenu's <B>Import</B> tab.<br />This function might block for a long time. This can happen because communications in the background have been completed and the DLP library has taken control of the communications device.<br />Control of the communications device will continue until the <CODE><a href="../../../../nn/dlp/CTR/FakeClient/Finalize.html">Finalize</a></CODE> function is called. If the server is a download application, continued communication with clients with a low system version is impossible because a system update has not been performed.<br />For this reason, the server rejects the connection of clients with low system versions and the client is disconnected without any warning to the user.<br />For development devices, the client may experience a <CODE>FatalError</CODE>. For actual products, a disconnection occurs.<br />Because the client cannot display a warning related to this disconnection, you must have the server display a message to the user.<br />In the numerals that are separated by a period in the system version, the upper three digit values determine whether a system update is performed.<br />The parameter <CODE>pNotice</CODE> is used to determined whether the display of a message is required. When <SPAN class="argument">pNotice</SPAN> returns <CODE>true</CODE>, we recommend the display of a message. <br />For more information about the messages displayed, see the guidelines.<br />If sometime in the future the system is updated by a download application and the message no longer needs to be displayed, <SPAN class="argument">pNotice</SPAN> will return <CODE>false</CODE>.<br />If you enable the Download Play debug settings with the Config tool, then <SPAN class="argument">pNotice</SPAN> will be forcibly set to <CODE>false</CODE> even when the server is a download application.<br />Be sure to always display a message according to the result of <SPAN class="argument">pNote</SPAN> to switch the message display depending on the system update support status.<br />Also, note that <SPAN class="argument">pNotice</SPAN> does not return <CODE>true</CODE> for card applications. However, if you implement message display depending on <SPAN class="argument">pNotice</SPAN>, then no changes need to be made to the source code when releasing a card application as a download application. If you enable the <CODE>Dlp Debug</CODE> flag using the Config tool, then <SPAN class="argument">pNotice</SPAN> will return <CODE>false</CODE>. Use this flag to check what is happening when messages are not displayed.<br /></p><!-- write here --></div> 130 <h2>Revision History</h2> 131 <div class="section"> 132 <dl class="history"> 133 <dt>2010/08/16</dt> 134 <dd>Initial version.<br /> 135 </dd> 136 <dt>2011/05/26</dt> 137 <dd>Added an explanation about the child device import size.<br /> 138 </dd> 139 <dt>2012/01/10</dt> 140 <dd>Added a description of how a client on development hardware with a low version number may result in a fatal error. 141 </dd> 142 <dt>2012/04/11</dt> 143 <dd>Added a method for forcing <CODE>pNotice</CODE> to return <CODE>false</CODE>.<br /> 144 </dd> 145 <dt>2012/04/12</dt> 146 <dd>Deleted the explanation about <CODE>ResultInvalidMediaType</CODE>.<br /> 147 </dd> 148 <dt>2012/05/02</dt> 149 <dd>Added an explanation about the Config tool, <CODE>Dlp Debug</CODE>.<br /> 150 </dd> 151 <dt>2012/07/25</dt> 152<dd>Added the location that is referenced in the system version for system updates.<br /> 153 </dd> 154 </dl> 155 </div> 156 <hr><p>CONFIDENTIAL</p></body> 157</html>