#include <revolution/nwc24.h>
NWC24Err NWC24Check( u32 usageType );
Checks the operational status of the WiiConnect24 system. If there are problems with the system, an error corresponding to the problem is returned.
This function must be called once each time operations such as the following are performed using NWC24 features to confirm that the system is available.
usageType |
Indicates the purpose of use.
|
NWC24_OK: Operating normally.
NWC24_ERR_LIB_NOT_OPENED: Library is not open (must be open to perform the check).
NWC24_ERR_DISABLED: Not usable because it is disabled in the Wii settings.
NWC24_ERR_PROTECTED: User-to-user communications are restricted by Parental Controls.
NWC24_ERR_NETWORK: Problem with network connection or settings.
NWC24_ERR_SERVER: Problem with server connection (returned only if NWC24_USE_MESSAGES has been selected).
NWC24_ERR_FULL: The outbox is full (returned only if NWC24_USE_MESSAGES has been selected).
NWC24_ERR_FATAL: Not functioning because of a fatal error other than the above.
The combinations of return values that can be generated for each value of the usageType argument are as follows (excluding NWC24_ERR_LIB_NOT_OPENED).
| Return Values | NWC24_USE_MESSAGES |
NWC24_USE_DOWNLOADS |
NWC24_USE_SETTINGS |
NWC24_OK |
X | X | X |
NWC24_ERR_DISABLED |
X | X | X |
NWC24_ERR_PROTECTED |
X | X | |
NWC24_ERR_NETWORK |
X | X | X |
NWC24_ERR_SERVER |
X | ||
NWC24_ERR_FULL |
X | ||
NWC24_ERR_FATAL |
X | X |
If a value other than NWC24_OK or NWC24_ERR_LIB_NOT_OPENED is returned, you must perform appropriate error handling. Refer to the NWC24Check Error Handling Sequence for Messages and Downloads. Also, by calling NWC24GetErrorCode() immediately afterwards, you can obtain the 6-digit error code required to display an error message.
Internally, the order of determinations is: Is WiiConnect24 enabled in the console settings? What level of Parental Controls are set? Network connection issues? Other fatal errors? Is the outbox full? The first detected error is returned. For example, because NWC24_ERR_DISABLED is always returned when WiiConnect24 is disabled, it's not possible to get the status of Parental Controls settings in that situation. (To get just the status of Parental Controls settings, use the SCCheckPCMessageRestriction function, included in the Revolution SDK.)
For the NWC24_ERR_NETWORK and NWC24_ERR_SERVER errors, because an error is reflected at the point where the WiiConnect24 scheduler activates just before, there are cases where the status of the latest network connection cannot be reflected. When NWC24_USE_SETTINGS is specified for the usageType, the NWC24_ERR_NETWORK error is returned only when the network setting does not exist.
NWC24GetErrorCode
NWC24 Error Handling Sequence
NWC24Check(Message) Error Handling Sequence
NWC24Check (Download) Error Handling Sequence
2008/09/02 Added supplementary description of the NWC24_ERR_NETWORK and NWC24_ERR_SERVER errors.
2008/03/06 Following modifications to Parental Controls items in the guidelines, NWC24_ERR_PROTECTED is no longer returned when NWC24_USE_DOWNLOADS is specified.
2007/11/13 Described the order of internal decisions. 2007/09/10 Following the addition of Parental Controls items to the guidelines, NWC24_ERR_PROTECTED will sometimes be returned in all situations. 2007/08/23 Added a reference to the error processing sequence. 2007/07/30 Added a table of return values and made other revisions. 2007/07/13 Described NWC24_USE_SETTINGS and made other revisions. 2007/04/05 Revised some descriptions of conditions. 2006/12/05 Initial version.
CONFIDENTIAL