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 <a href="../../nn_types/u8.html">u8</a> 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 by task ID.</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> values listed below.<br /> <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>Result::IsSuccess</th> 70 <td>Registration successful.</td> 71 </tr> 72 <tr> 73 <th>ResultInvalidTaskId</th> 74 <td>The <SPAN class="argument">pTask</SPAN> argument is <CODE>NULL</CODE>.<br /> Alternatively, the <SPAN class="argument">pTask</SPAN> argument is uninitialized, or the pointer of the task ID specified by <SPAN class="argument">pTask</SPAN> is <CODE>NULL</CODE> or an empty string.</td> 75 </tr> 76 <tr> 77 <th>ResultInvalidPolicy</th> 78 <td>The <CODE>pPolicy</CODE> parameter is <CODE>NULL</CODE>.</td> 79 </tr> 80 <tr> 81 <th>ResultInvalidAction</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>ResultTaskPermissionOutOfRange</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>ResultSchedulingPolicyOutOfRange</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>ResultInvalidTaskTargetDuration</th> 98 <td>The task duration is invalid. (This is for future extensibility.)</td> 99 </tr> 100 <tr> 101 <th>ResultActionCodeOutOfRange</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>ResultInvalidUrl</th> 106 <td>The URL string pointer is <CODE>NULL</CODE> or a zero-length string.</td> 107 </tr> 108 <tr> 109 <th>ResultApInfoTypeOutOfRange</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>ResultCfgInfoTypeOutOfRange</th> 114 <td>The Cfg 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> 115 </tr> 116 <tr> 117 <th>ResultInvalidFilePath</th> 118 <td>The file path string pointer is <CODE>NULL</CODE> or a zero-length string.</td> 119 </tr> 120 <tr> 121 <th>ResultInvalidOption</th> 122 <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> 123 </tr> 124 <tr> 125 <th>ResultStorageNotFound</th> 126 <td>Storage has not been registered for the corresponding application ID.</td> 127 </tr> 128 <tr> 129 <th>ResultTaskIdAlreadyExist</th> 130 <td>A task having the same task ID is already registered.</td> 131 </tr> 132 <tr> 133 <th>ResultIpcNotSessionInitialized</th> 134 <td>The session has not been initialized.<BR> 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 when 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><b>Common Task Registration Errors</b></p><p>1. If BOSS storage has not been registered when registering an NADL task (<a href="../../nn/boss/ResultStorageNotFound/Overview.html"><CODE>ResultStorageNotFound</CODE></a>).<br /> Register BOSS storage for NADL task using <a href="../../nn/boss/RegisterStorage.html"><CODE>RegisterStorage</CODE></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.</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>