The NWC24 library makes WiiConnect24 functions, provided by the Wii console, available to applications.
Functions for performing the following operations are available in the NWC24 library:
When using each feature of the NWC24 library from the application, you should include <revolution/nwc24.h>, which comes with the RevoEX package. In addition to linking to the various libraries supplied with the Revolution SDK, you must also link to these NWC24 library components: nwc24.a (debug version: nwc24D.a), ncd.a (ncdD.a), net.a (netD.a) and vf.a (vfD.a). These components are included in the RevoEX package.
The NWC24 library uses parts of the VF library for internal file management. For this reason, it is necessary to call VFInit(Ex) to initialize the VF library in advance before using the NWC24 library. There is only one drive of the VF library that is used internally by the NWC library, and the drive is specially named so that there is little chance of it being overlapped during normal use.
WiiConnect24 provides round-the-clock transparent service to Wii consoles with enabled network connections. Automatic processes are launched at set intervals in the background, when an application is running or the console is in standby mode, sending and receiving messages and performing downloads. (Automatic processing will not occur in applications that are not linked to the NWC24 library.)
The NWC24 functions are used to access the contents obtained within the WiiConnect24 framework and to configure processes.
To use the NWC24 functions to access data, the library must first be opened. Use NWC24OpenLib to open the library.
Because the library internally requires a work area in memory, be sure to pass a pointer to that memory region as an argument. Although the size of this region may change in the future, the capacity required under this version has been set, using the NWC24_WORK_MEM_SIZE macro. In addition, this memory pointer must be aligned on a 32-byte address boundary.
For more about accessing WiiConnect24 content, see descriptions of the following functions:
Most of these functions will result in an error if an attempt is made to use them while the library is not properly opened.
Once the necessary processes are complete, use NWC24CloseLib to close the library. After closing, the allocated work buffer can be deallocated.
Also, automated functionality is halted temporarily while the library is open in order to maintain integrity. Care must be taken because data will not be sent or received, nor will downloads occur, if the library is left open. In addition, functions are available to pause and resume automatic functionality separately from the opening and closing of the library. For more information, see the Scheduler Operation Functions.
Apart from programming issues, the NWC24 API sometimes returns errors due to various factors, such as the operating environment. See Error Handling Sequence for more on the proper handling methods.
Internally, the NWC24 API calls synchronous functions, such as NAND; as a result, it may block for a long period of time. In addition, with the exception of some functions, it is not thread-safe.
Consequently, we recommend using the NWC24 API by preparing a thread exclusively for calling its functions. If exclusive control is done by an application, the use of multiple threads will not pose a problem.
Simple demos that perform actual message operations using the procedures described above are provided in the directory /build/demos/nwc24demo. For more information, see the NWC24 Samples
Message Function Description
Friend Roster Function Description
Message Search Function Description
Scheduler Operation Function Description
Download Function Description
The relationship between NWC24API and Wii Message Board
Letterform Templates
Error Handling Sequence
2007/10/03 Added mention that application must be linked to NWC24 library for automatic processing to take place.
2007/08/23 Added Error Handling Sequence to the 'See Also' section.
2007/07/05 Revised text about Wii Message Board and added link to Letterform Templates.
2007/04/12 Revised portions of the section, Required Libraries and Header Files.
2007/03/07 Added the section, Required Libraries and Header Files.
2007/02/16 Added to "See Also" section.
2006/12/08 Separated the section explaining Message functions and made thorough revisions.
2006/09/29 Matched details to the current specification.
2006/09/10 Changed the reference target to NWC24OpenLib/NWC24CloseLib.
2006/09/01 Added functions. Matched changes in the reference file placement.
2006/08/01 Initial version.
CONFIDENTIAL