Wii consoles that are connected to the network and have the WiiConnect24 feature turned on can automatically send and receive messages or download data in the background as needed even if an application is running. The frequency at which this process is generated is low, at about once every several minutes. However, the execution of the application may be affected as shown below.
When impacts such as these are anticipated, automatic processes can be temporarily halted by using the scheduler operation API. Because it is no problem to call the automatic process scheduler's stop and restart operations anytime while an application is executing, it is possible, for example, to temporarily halt an automatic process before reading a large amount from NAND flash and then restarting it again once the data has been read. (However, when trying to halt an automatic process that is already being processed, it takes a moment until it actually stops)
The following have been provided as the API to operate the WiiConnect24 automatic send and receive scheduler.
NWC24SuspendScheduler : Temporarily halt (block until stopped)NWC24TrySuspendScheduler : Temporarily halt (do not block until stopped)NWC24ResumeScheduler : Restart processingFor details, see the reference manual for each function.
These scheduler operation functions can be called at any time regardless of the open or close status of the library resulted from either NWC24OpenLib() or NWC24CloseLib().
However, while the NWC24 library is opened, the system is in the same status as the scheduler being halted. For example, even if NWC24ResumeScheduler() is executed while the library is open, the scheduler does not restart. The process restarts only when the library is closed after that.
With the NWC24 library incorporated (that is, with nwc24[D].a linked), when the application is run, the scheduler is in a state in which it can operate by default (that is, NWC24ResumeScheduler has been called).
On the other hand, in applications for which the NWC24 library has not been incorporated, the scheduler will be in the stopped state by default.
There are two types of automated processes launched by the WiiConnect24 scheduler.
These are launched at determined intervals for Wii consoles for which the user has agreed to the Wii Network Services User Agreement and for which WiiConnect24 is enabled. However, the sending and receiving of messages will not occur when parental controls have been sent to block messages.
It is possible to use the return value from NWC24Check to determine whether the conditions for automated process have been met or not.
The default interval for message sending and receiving is one minute. As a result, the first sending and receiving will occur one minute after launching an application. The server may also overwrite the specified interval value when communications with the server are occurring normally. (It is normally ten minutes, but may change as conditions warrant.) Subsequently, sending and receiving will occur at the newly specified interval.
When there is a problem communicating with the servers, a delay of at least one minute will occur. However, should communication continue to fail after launching the application, the interval will continue to increase, from one to two to three minutes and so on. (The maximum interval is ten minutes.)
If automated processes have been paused when the interval has elapsed, the sending and receiving of messages will be delayed. The next interval timing will occur when the set time has once again elapsed.
You can get the currently set interval value for the sending and receiving of messages using NWC24GetScheduleSpan.
The default interval for downloading is two minutes. As a result, the first download will occur two minutes after launching an application. To begin, the task list is checked to see if there are any tasks existing for the time at which a download is scheduled to occur. If there are, they are downloaded. If there are none, the interval is set to eleven minutes and processing ends thereafter.
If multiple tasks are running when downloading is set to begin, the one with the highest priority is immediately run, and the process is tentatively ended after setting the interval to two minutes. As a result, the remaining tasks will be processed at two minute intervals.
If automated processes have been paused when the interval has elapsed, downloading will be delayed. The next interval timing will occur when the set time has once again elapsed.
You can get the currently set interval value for downloading using NWC24GetScheduleSpan.
2007/03/07 Added the "Initial state of the scheduler" section.
Added the section, Conditions Specific to the Scheduler's Automated Processes
2006/09/10 Changed the references to NWC24OpenLib and NWC24CloseLib
2006/09/01 Initial version.
CONFIDENTIAL