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 has already been registered. |
ResultIpcNotSessionInitialized |
Either a session had not been initialized or there were incompatible permissions. This Result value is returned if you call this function before Initialize or InitializePrivileged. Always call Initialize or InitializePrivileged first when you use the BOSS library. |
| A value other than the above. | Unexpected error (see boss_Result.h for 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 enabled and not deactivated through the task attributes.
• The user has not yet agreed to the EULA, and agreement to the EULA hasn't been disabled through 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.
In most cases, you can simply use the GetCount function to check the execution count. You can use utilities such as the Config tool for settings related to Parental Controls and EULA agreement. You can use the GetState function to determine whether the administrator has temporarily suspended all tasks; if so, the return value is TASK_PAUSED.
You can wait for tasks to complete in the following ways.
・Use the WaitFinish function to wait for execution to complete
・Use the WaitFinish function to wait for execution to complete, specifying the maximum amount of time to wait
・Poll with the GetState function, waiting for the task to enter the "completed" state
・Use the Event registered by the RegisterNewArrivalEvent function to wait for a new event
When you have detected that a task has finished, you can get its state with the GetState function, its execution result code with the GetResult function, and the HTTP result code with the GetHttpStatusCode function. You can use the GetStateDetail function to get further details.
CONFIDENTIAL