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>RegisterTask</title> 8 </head> 9 <body> 10<h1><CODE>nn::boss::RegisterTask</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> RegisterTask( 15<a href="../../nn/boss/Task/Overview.html">Task</a> * pTask, 16<a href="../../nn/boss/TaskPolicy/Overview.html">TaskPolicy</a> * pPolicy, 17<a href="../../nn/boss/TaskAction/Overview.html">TaskAction</a> * pAction, 18<a href="../../nn/boss/TaskOption/Overview.html">TaskOption</a> * pOption = NULL, 19u8 taskStep = DEFAULT_STEP_ID 20); 21</pre> 22 </div> 23<h2>Arguments</h2> 24 <div class="section"> 25 <table class="arguments"> 26 <thead> 27 <tr> 28 <td width="15" /> 29<th>Name</th> 30<td>Description</td> 31 </tr> 32 </thead> 33 <tr> 34<td>in</td> 35<th>pTask</th> 36<td>Specifies a task name. You can use a name of up to seven characters.</td> 37 </tr> 38 <tr> 39<td>in</td> 40<th>pPolicy</th> 41<td>Specifies a task policy.</td> 42 </tr> 43 <tr> 44<td>in</td> 45<th>pAction</th> 46<td>Specifies a task action. (Currently, you can only specify <a href="../../nn/boss/NsaDownloadAction/Overview.html"><CODE>NsaDownloadAction</CODE></a> or <CODE>DownloadAction</CODE>.)</td> 47 </tr> 48 <tr> 49<td>in</td> 50<th>pOption</th> 51<td>Specifies task options. (Optional)</td> 52 </tr> 53 <tr> 54<td>in</td> 55<th>taskStep</th> 56<td>Specifies a task step ID. (May be omitted if there is only one task step to be executed)</td> 57 </tr> </table> 58 </div> 59<h2>Return Values</h2> 60<div class="section">Returns the function's execution result. Returns one of the <a href="../../nn/Result/Overview.html"><CODE>Result</CODE></A></a> values listed below. <br /> 61 <table class="arguments"> 62 <thead> 63 <tr> 64<th>Value</th> 65<td>Description</td> 66 </tr> 67 </thead> 68 <tr> 69<th><CODE>ResultSuccess</CODE></th> 70<td>Registration successful.</td> 71 </tr> 72 <tr> 73<th><CODE>ResultInvalidTaskId</CODE></th> 74<td>The task ID pointer is <CODE>NULL</CODE> or a zero-length string.</td> 75 </tr> 76 <tr> 77<th><CODE>ResultInvalidPolicy</CODE></th> 78<td>The policy information pointer is <CODE>NULL</CODE>.</td> 79 </tr> 80 <tr> 81<th><CODE>ResultInvalidAction</CODE></th> 82<td>The task action pointer is <CODE>NULL</CODE>.</td> 83 </tr> 84 <tr> 85<th><CODE>ResultInvalidTaskPriolity</CODE></th> 86<td>The task priority specification is invalid. Confirm that it is in the range of <CODE><a href="../../nn/boss/TaskPriority.html">TaskPriority</a></CODE>.</td> 87 </tr> 88 <tr> 89<th><CODE>ResultTaskPermissionOutOfRange</CODE></th> 90<td>The task permission information is out of range. Confirm that it is in the range of <CODE><a href="../../nn/boss/TaskPermission.html">TaskPermission</a></CODE>.</td> 91 </tr> 92 <tr> 93<th><CODE>ResultSchedulingPolicyOutOfRange</CODE></th> 94<td>The scheduling policy is out of range. Confirm that it is in the range of <CODE><a href="../../nn/boss/SchedulingPolicy.html">SchedulingPolicy</a></CODE>.</td> 95 </tr> 96 <tr> 97<th><CODE>ResultInvalidTaskTargetDuration</CODE></th> 98<td>The task duration is invalid. (For future extensibility)</td> 99 </tr> 100 <tr> 101<th><CODE>ResultActionCodeOutOfRange</CODE></th> 102<td>The task action code is out of range. Confirm that it is in the range of <CODE><a href="../../nn/boss/Action.html">Action</a></CODE>.</td> 103 </tr> 104 <tr> 105<th><CODE>ResultInvalidUrl</CODE></th> 106<td>The URL string pointer is <CODE>NULL</CODE> or a zero-length string.</td> 107 </tr> 108 <tr> 109<th><CODE>ResultApInfoTypeOutOfRange</CODE></th> 110<td>The AP information type is out of range. Confirm that it is in the range of <CODE><a href="../../nn/boss/ApInfoType.html">ApInfoType</a></CODE>.</td> 111 </tr> 112 <tr> 113<th><CODE>ResultInvalidFilePath</CODE></th> 114<td>The file path string pointer is <CODE>NULL</CODE> or a zero-length string.</td> 115 </tr> 116 <tr> 117<th><CODE>ResultInvalidOption</CODE></th> 118<td>The task option pointer is <CODE>NULL</CODE>, or the <B>option</B> code is out of range. Confirm that it is in the range of <CODE><a href="../../nn/boss/ExecOption.html">ExecOption</a> </CODE>.</td> 119 </tr> 120 <tr> 121<th><CODE>ResultStorageNotFound</CODE></th> 122<td>Storage has not been registered for the corresponding application ID.</td> 123 </tr> 124 <tr> 125<th>ResultTaskIdAlreadyExist</th> 126<td>Another task of the same name is already registered.</td> 127 </tr> 128 <tr> 129<th>ResultDatabaseFull</th> 130<td>Storage and tasks cannot be registered because the maximum number of registered application IDs and tasks has been reached.</td> 131 </tr> 132 <tr> 133<th><CODE>ResultIpcNotSessionInitialized</CODE></th> 134<td>Either the session had not been initialized or there were incompatible permissions. This <CODE>Result</CODE> value is returned if you call this function before <a href="../../../nn/boss/NsData/Initialize.html"><CODE>Initialize</CODE></a> or <CODE>InitializePrivileged</CODE>. Always call <a href="../../../nn/boss/Task/Initialize.html"><CODE>Initialize</CODE></a> or <CODE>InitializePrivileged</CODE> first when you use the BOSS library.</td> 135 </tr> 136 <tr> 137<th>A value other than the above.</th> 138<td>Unexpected error (see <CODE>boss_Result.h</CODE> for details).</td> 139 </tr> 140 </table> </div> 141<h2>Description</h2> 142 <div class="section"> 143<p>Registers a task to the library. You can register two types of tasks: raw download tasks and NSA download tasks. To register a task, you must prepare the <a href="../../nn/boss/TaskPolicy/Overview.html"><CODE>TaskPolicy</CODE></a> class and the <CODE>DownloadAction</CODE> class, which is a subclass of the <CODE>TaskAction</CODE> class; or you must prepare the <a href="../../nn/boss/NsaDownloadAction/Overview.html"><CODE>NsaDownloadAction</CODE></a> class and the (optional) <a href="../../nn/boss/TaskOption/Overview.html"><CODE>TaskOption</CODE></a> class. See the topic for each class for more information on which attributes must be set. After you have finished registering a task, you can reuse each of these instances as necessary by calling the <CODE>Initialize</CODE> function. You can also schedule and run a registered task by calling the <a href="../../nn/boss/Task/Overview.html"><CODE>Task</CODE></a> class's <CODE>Start</CODE> function.<br /><br /> Here are some common task registration errors and the how to handle them:<br /><br /><B>(1) Storage was not registered when registering the NSA download task</B> (<CODE><a href="../../nn/boss/ResultStorageNotFound/Overview.html">ResultStorageNotFound</a></CODE>)<br />Register the NSA download tasking using <CODE><a href="../../nn/boss/RegisterStorage.html">RegisterStorage</a></CODE>.<br /><br /><B>(2) A task with the same name has been registered already</B> (<CODE><a href="../../nn/boss/ResultTaskIdAlreadyExist/Overview.html">ResultTaskIdAlreadyExist</a></CODE>)<br />Delete the pertinent task with <CODE><a href="../../nn/boss/UnregisterTask.html">UnregisterTask</a></CODE> or make re-use of the already registered task.<br /><br /><B>(3) Removable tasks have been deleted but there is no space in the database for registering a task</B><CODE> (<a href="../../nn/boss/ResultDatabaseFull/Overview.html">ResultDatabaseFull</a></CODE>).<br /> Tasks that have counted down to zero are automatically deleted when there is no space, but tasks that have not counted down to zero are not deleted. Use <CODE><a href="../../nn/boss/UnregisterTask.html">UnregisterTask</a></CODE> to delete removable tasks and try registering again. <br /></p><!-- write here --></div> 144<h2>Revision History</h2> 145 <div class="section"> 146 <dl class="history"> 147 <dt>2010/09/16</dt> 148<dd>Initial version.<br /> 149 </dd> 150 </dl> 151 </div> 152 <hr><p>CONFIDENTIAL</p></body> 153</html>