1<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
2<HTML>
3<HEAD>
4<META http-equiv="Content-Type" content="text/html; charset=windows-1252">
5<META http-equiv="Content-Style-Type" content="text/css">
6<TITLE>NWC24OpenLib</TITLE>
7<LINK rel="stylesheet" type="text/css" href="../../CSS/revolution.css">
8</HEAD>
9<BODY>
10<H1>NWC24OpenLib</H1>
11
12<H2>C Specification</H2>
13<DL>
14<DD><PRE><CODE>#include &lt;revolution/nwc24.h&gt;</CODE></PRE>
15<DD><PRE><CODE><A HREF="../Types/NWC24Err.html">NWC24Err</A> NWC24OpenLib( void* <EM>workMemory</EM> );</CODE></PRE>
16</DL>
17
18<H2>Description</H2>
19<P>
20Initializes the library. This function must be called before using most NWC24 functions.<BR>Once this function is run, compatibility is maintained until <CODE>NWC24CloseLib()</CODE> is run. As a result, auto-send and receive functionality is paused.
21</P>
22
23<H2>Note</H2>
24<P>
25The VF library must be initialized before this function is called because the NWC24 library uses the VF library internally.
26</P>
27
28<H2>Arguments</H2>
29<TABLE border="1" cellpadding="3" cellspacing="0.1">
30  <TR>
31<TD width="120" bgcolor="#ffffe8"><code><em><strong>workMemory</strong></em></code></TD>
32    <TD width="520">
33The address of the working memory used by the library.<BR>The necessary size is defined in <CODE>NWC24_WORK_MEM_SIZE</CODE>.<BR>This address must be 32-byte aligned.
34    </TD>
35  </TR>
36</TABLE>
37
38<h2>Return Values</h2>
39<P>
40<code>NWC24_OK</code>: Normal termination.<BR> <code>NWC24_ERR_LIB_OPENED</code>: Already opened.<BR> <code>NWC24_ERR_BUSY</code>: Automatic send and receive currently processing.<BR> <code>NWC24_ERR_INPROGRESS</code>: Internal operations not ready.<BR> <code>NWC24_ERR_MUTEX</code>: Another context exists calling <code>NWC24OpenLib()</code>, a scheduler control function or a socket initialization function.<BR> <code>NWC24_ERR_ALIGNMENT</code>: A <code><em><strong>workMemory</strong></em></code> alignment problem.<BR> <code>NWC24_ERR_NULL</code>: <code><em><strong>workMemory</strong></em></code> is a null pointer.<BR> <code>NWC24_ERR_FILE_***</code>: Problem with internal management file operations.<BR> <code>NWC24_ERR_BROKEN</code>: Data in internal management file is corrupted.<BR> <code>NWC24_ERR_VER_MISMATCH</code>: Internal management file version error.<BR> <code>NWC24_ERR_NAND_CORRUPT</code>: Fatal damage to NAND flash memory.<BR> <code>NWC24_ERR_INTERNAL_VF</code>: Problem in internal VF library processing.<BR> <code>NWC24_ERR_INTERNAL_IPC</code>: Problem in internal processing.<BR> <code>NWC24_ERR_OLD_SYSTEM</code>: The system version is old (Console needs updating). <code>NWC24_ERR_FATAL</code>: Some other fatal problem.<BR><BR> <BR> If any of the following values are returned, you must execute the appropriate error handing process (See <A HREF="../ErrorHandling/ERR_NWC24OpenLib.html"><CODE>NWC24OpenLib</CODE> Error Handling Sequences</A>). Also, by calling <A href="NWC24GetErrorCode.html"><CODE>NWC24GetErrorCode()</CODE></A> immediately afterwards, you can obtain the 6-digit error code required to display an error message.<BR>
41</P>
42
43<TABLE border="1" cellpadding="3" cellspacing="0.1">
44  <TR>
45<TD width="120">File-related error.</TD>
46<TD><code>NWC24_ERR_FILE_***, NWC24_ERR_BROKEN, NWC24_ERR_NAND_CORRUPT, NWC24_ERR_INTERNAL_VF</code></TD>
47  </TR>
48  <TR>
49<TD width="120">System error.</TD>
50<TD><code>NWC24_ERR_OLD_SYSTEM</code></TD>
51  </TR>
52  <TR>
53<TD width="120">Other fatal error.</TD>
54<TD><code>NWC24_ERR_INTERNAL_IPC, NWC24_ERR_FATAL</code></TD>
55  </TR>
56  <TR>
57<TD width="120">Error for which a retry is possible.</TD>
58<TD><code>NWC24_ERR_BUSY, NWC24_ERR_INPROGRESS, NWC24_ERR_MUTEX</code></TD>
59  </TR>
60</TABLE>
61
62<P>
63If 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.<BR>
64</P>
65
66<H2>See Also</H2>
67<P>
68<A href="NWC24CloseLib.html"><CODE>NWC24OpenLib</CODE></A><BR> <BR><A href="../ErrorHandling/intro.html">NWC24 Error Handling Sequence</A><BR><BR><A HREF="../ErrorHandling/ERR_NWC24OpenLib.html"><CODE>NWC24OpenLib</CODE> Error Handling Sequence</A>
69</P>
70
71<H2>Revision History</H2>
72<P>
732007/09/21 Corrected explanation about retryable problems.<BR>2007/08/23 Added error handing sequences to See Also section.<BR>2007/08/07 Supplemented explanation of <CODE>NWC24_ERR_MUTEX</CODE>.<BR>2007/03/27 Added error codes and comments about retryable problems.<BR>2007/03/16 Added explanation for when the library cannot open temporarily.<BR>2007/02/13 Added explanation about getting error codes.<BR>2006/11/13 Made minor corrections in descriptions.<BR>2006/10/04 Updated the return value list.<BR>2006/09/13 Added mention that the VF library must be initialized before calling this function.<BR>2006/09/10 Changed the name of a function from <CODE>NWC24OpenMsgLib</CODE> to its current name.<BR>2006/08/01 Initial version.
74</P>
75
76<hr><p>CONFIDENTIAL</p></body>
77</HTML>