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><a href="../../nn/Overview.html">nn</a>::<a href="../../nn/boss/Overview.html">boss</a>::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, 19 u8 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 ID by task.</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, the only related tasks are in the <a href="../../nn/boss/NsaDownloadAction/Overview.html">NsaDownloadAction</a> class.)</td> 47 </tr> 48 <tr> 49<td>in</td> 50<th>pOption</th> 51<td>Specifies task options. (Can be omitted)<br />Note: This parameter is not currently supported because it is used with extended features. Do not specify it.</td> 52 </tr> 53 <tr> 54<td>in</td> 55<th>taskStep</th> 56<td>Specifies a task step ID. (Can be omitted if there is only one task execution step)<br /><B>Note</B>: This parameter is for a feature extension and is currently not supported. Do not specify it.</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>Result::IsSuccess</CODE></th> 70<td>Registration successful.</td> 71 </tr> 72 <tr> 73<th><CODE>ResultInvalidTaskId</CODE></th> 74<td>The <SPAN class="argument">pTask</SPAN> parameter is <CODE>NULL</CODE>.<br />Alternatively, the <SPAN class="argument">pTask</SPAN> parameter is uninitialized, or the pointer of the task ID specified by <SPAN class="argument">pTask</SPAN> is <CODE>NULL</CODE> or a zero-length string.</td> 75 </tr> 76 <tr> 77<th><CODE>ResultInvalidPolicy</CODE></th> 78<td>The <CODE>pPolicy</CODE> parameter is <CODE>NULL</CODE>.</td> 79 </tr> 80 <tr> 81<th><CODE>ResultInvalidAction</CODE></th> 82<td>The <CODE>pAction</CODE> parameter is <CODE>NULL</CODE>.</td> 83 </tr> 84 <tr> 85<th>ResultInvalidTaskPriority</th> 86<td>The task execution priority specification is out-of-range. 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 condition specification 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. (This is 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 <CODE>pOption</CODE> parameter is uninitialized or the option 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><CODE>ResultTaskIdAlreadyExist</CODE></th> 126<td>A task having the same task ID is already registered.</td> 127 </tr> 128 <tr> 129<th><CODE>ResultDatabaseFull</CODE></th> 130<td>BOSS 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>The session has not been initialized. This <CODE><a href="../../nn/Result/Overview.html">Result</a></CODE> is returned if this function is called before the <CODE><a href="../../nn/boss/Initialize.html">Initialize</A></CODE> function. Always call the <a href="../../nn/boss/Initialize.html"><CODE>Initialize</CODE></a> function first before using 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 error details).</td> 139 </tr> 140 </table> </div> 141<h2>Description</h2> 142 <div class="section"> 143<p>Registers a task. </p><p>To register tasks, you must prepare instances of the subclass of <a href="../../nn/boss/TaskPolicy/Overview.html"><CODE>TaskPolicy</CODE></a> class and the <a href="../../nn/boss/TaskAction/Overview.html"><CODE>TaskAction</CODE></a> class (currently only <a href="../../nn/boss/NsaDownloadAction/Overview.html"><CODE>NsaDownloadAction</CODE> available</a>). See the topic for each class for more information on which attributes must be set.</p><p>After you have finished registering a task, you can reuse each of these instances as necessary by calling the <CODE>Initialize</CODE> function. A task execution instruction can be issued by calling the <a href="../../nn/boss/Task/Start.html">nn::boss::Task::Start</a> function for a registered task.</p><p> </p><p>【Common Task Registration Errors】</p><p>1. If BOSS storage has not been registered (<a href="../../nn/boss/ResultStorageNotFound/Overview.html">ResultStorageNotFound</a>) when registering an NADL task, be sure to register BOSS storage for NADL task using <a href="../../nn/boss/RegisterStorage.html">RegisterStorage</a>. </p><p>2. A task with the same task ID is already registered (<a href="../../nn/boss/ResultTaskIdAlreadyExist/Overview.html"><CODE>ResultTaskIdAlreadyExist</CODE></a>).<br />Either use the <a href="../../nn/boss/UnregisterTask.html"><CODE>UnregisterTask</CODE></a> function to delete one of the tasks in question, or reuse the task that has already been registered.<br /><br /></p><p>3. The task cannot be registered because the task database is full and no existing tasks can be deleted (<a href="../../nn/boss/ResultDatabaseFull/Overview.html"><CODE>ResultDatabaseFull</CODE></a>).<br />When the task database is full, tasks with a remaining execution count of zero are automatically deleted so that new tasks can be registered successfully. However, if no tasks can be deleted because none of them have a remaining execution count of zero, this error occurs. If it is possible to delete any of the tasks registered by the application itself, you can resolve this issue by deleting one of those tasks by using the <a href="../../nn/boss/UnregisterTask.html"><CODE>UnregisterTask</CODE></a> function and then attempting to register the new task again.( The application can run the <a href="../../nn/boss/GetTaskIdList.html"><CODE>GetTaskIdList</CODE></a> function to get a list of the task IDs for tasks it has registered.)<br /> Alternatively, after some time elapses, it is possible that the execution count of some other task (maybe even some other application's task) will reach zero, allowing your task to be registered successfully. You can handle this by retrying task registration after waiting for the next application startup. </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>