NWC24OpenLib

C Specification

#include <revolution/nwc24.h>
NWC24Err NWC24OpenLib( void* workMemory );

Description

Initializes the library. This function must be called before using most NWC24 functions.
Once this function is run, compatibility is maintained until NWC24CloseLib() is run. As a result, auto-send and receive functionality is paused.

Note

The VF library must be initialized before this function is called because the NWC24 library uses the VF library internally.

Arguments

workMemory The address of the working memory used by the library.
The necessary size is defined in NWC24_WORK_MEM_SIZE.
This address must be 32-byte aligned.

Return Values

NWC24_OK: Normal termination.
NWC24_ERR_LIB_OPENED: Already opened.
NWC24_ERR_BUSY: Automatic send and receive currently processing.
NWC24_ERR_INPROGRESS: Internal operations not ready.
NWC24_ERR_MUTEX: Another context exists calling NWC24OpenLib(), a scheduler control function or a socket initialization function.
NWC24_ERR_ALIGNMENT: A workMemory alignment problem.
NWC24_ERR_NULL: workMemory is a null pointer.
NWC24_ERR_FILE_***: Problem with internal management file operations.
NWC24_ERR_BROKEN: Data in internal management file is corrupted.
NWC24_ERR_VER_MISMATCH: Internal management file version error.
NWC24_ERR_NAND_CORRUPT: Fatal damage to NAND flash memory.
NWC24_ERR_INTERNAL_VF: Problem in internal VF library processing.
NWC24_ERR_INTERNAL_IPC: Problem in internal processing.
NWC24_ERR_OLD_SYSTEM: The system version is old (Console needs updating). NWC24_ERR_FATAL: Some other fatal problem.


If any of the following values are returned, you must execute the appropriate error handing process (See NWC24OpenLib Error Handling Sequences). Also, by calling NWC24GetErrorCode() immediately afterwards, you can obtain the 6-digit error code required to display an error message.

File-related error. NWC24_ERR_FILE_***, NWC24_ERR_BROKEN, NWC24_ERR_NAND_CORRUPT, NWC24_ERR_INTERNAL_VF
System error. NWC24_ERR_OLD_SYSTEM
Other fatal error. NWC24_ERR_INTERNAL_IPC, NWC24_ERR_FATAL
Error for which a retry is possible. NWC24_ERR_BUSY, NWC24_ERR_INPROGRESS, NWC24_ERR_MUTEX

If the error is due to a problem that allows retrying, the library could not be opened temporarily. Normally, waiting a while before calling the library again will allow you to open it properly. However, depending on the network environment you may have to wait a long time, so if any of these situations are encountered and the user may have to wait a long time, we recommend that you retry every 1 to 2 seconds for 7 to 10 times, then abort the effort and display an error message. An error code has been prepared for the display of this error message.

See Also

NWC24OpenLib

NWC24 Error Handling Sequence

NWC24OpenLib Error Handling Sequence

Revision History

2007/09/21 Corrected explanation about retryable problems.
2007/08/23 Added error handing sequences to See Also section.
2007/08/07 Supplemented explanation of NWC24_ERR_MUTEX.
2007/03/27 Added error codes and comments about retryable problems.
2007/03/16 Added explanation for when the library cannot open temporarily.
2007/02/13 Added explanation about getting error codes.
2006/11/13 Made minor corrections in descriptions.
2006/10/04 Updated the return value list.
2006/09/13 Added mention that the VF library must be initialized before calling this function.
2006/09/10 Changed the name of a function from NWC24OpenMsgLib to its current name.
2006/08/01 Initial version.


CONFIDENTIAL