nn::boss::Task::Start Member Functionnn::Result Start( void );
None.
Result values listed below. | Value | Description |
|---|---|
ResultSuccess |
Successfully issued the instruction to start the task. |
ResultInvalidTaskId |
The task ID pointer is NULL or a zero-length string. |
ResultTaskNotExist |
The specified task ID was not found. Confirm whether it is registered yet. |
ResultIpcNotSessionInitialized |
Either the session is not initialized or there are incompatible permissions. This Result is returned if this function is called before the Initialize or the InitializePriviledged function is called. Always call the Initialize or InitializePrivileged function first when you use the BOSS library. |
| A value other than the above. | Unexpected error (see boss_Result.h for error details). |
Starts a task. The scheduled tasks will automatically run in the background when infrastructure connections are enabled. When a task finishes running, the execution count specified in the task's attributes will be decremented by 1, regardless of whether the execution resulted in an error. As a result, unless the execution count is 0, the task will be run again after the execution interval specified in the task's attributes. Tasks whose execution counts reach zero may be deleted automatically if the internal database is filled to capacity. In the following circumstances, tasks won't be scheduled for execution even if a command is issued to start a task.
• The task's execution count is 0.
• The task's execution priority is PRIORITY_STOPPED.
• Parental Controls are in force on the task and are not disabled in the task attributes.
• The user has not yet agreed to the EULA, and the EULA agreement requirement is not disabled in the task attributes.
• Task execution was stopped in the policy list that was downloaded from a Nintendo Zone access point.
• The server hosting the download service issued a "service suspended" notice.
• The administrator has temporarily suspended all tasks.
One way to check for these common cases is to use the GetCount function to confirm the execution count. Parental Controls and the EULA agreement can be configured with the Config tool and other utilities. It is possible to tell when the administrator has temporarily paused all tasks because TASK_PAUSED is returned by the GetState function.
The following methods can be used to wait for task completion.
・Wait for execution to complete with the WaitFinish function.
・Specify a maximum waiting time and wait for execution to complete with the WaitFinish function.
・Use the GetState function to poll for completed tasks.
・Wait for a new arrival event using an Event registered by the RegisterNewArrivalEvent function.
Once you detect that a task is completed, you can confirm the task state with the GetState function, the task execution results code with the GetResult function, and the HTTP communication results code with the GetHttpStatusCode function. You can also get other details with the GetStateDetail function.
CONFIDENTIAL