1<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
2<HTML><HEAD><TITLE>OSReportDestination</TITLE>
3<META http-equiv=Content-Type content="text/html; charset=utf-8">
4<META content="MSHTML 6.00.2900.3314" name=GENERATOR>
5<META http-equiv=Content-Style-Type content=text/css><LINK
6href="../../CSS/revolution.css" type=text/css rel=stylesheet></HEAD>
7<BODY>
8<H1>OSReportDestination</H1>
9<H2>Syntax</H2>
10<DL>
11  <DD><PRE class=construction>#include &lt;revolution/os/OSLog.h&gt;
12
13#define OS_REPORT_SERIAL 0x00000001
14#define OS_REPORT_NAND   0x00000002
15
16s32 OSReportDestination( u32 dest );
17</PRE></DD></DL>
18<H2>Arguments</H2>
19<TABLE class=arguments border=1>
20  <TBODY>
21  <TR>
22<TH>dest</TH>
23<TD>The port that is the output destination for <CODE>OSReport</CODE> and <CODE>OSVReport</CODE>.<BR>Output destination ports are given in the table below.</TD></TR></TBODY></TABLE><BR>
24<TABLE class=arguments border=1>
25  <TBODY>
26  <TR>
27<TD bgColor=#c0c0c0>Output Destination Port</TD>
28<TD bgColor=#c0c0c0>Macro Name</TD>
29<TD bgColor=#c0c0c0>Description</TD>
30<TD bgColor=#c0c0c0>Comments</TD></TR>
31  <TR>
32    <TH>1</TH>
33<TH>OS_REPORT_SERIAL</TH>
34<TD>Sets the output destination to serial output (the output destination for standard <CODE>OSReport</CODE> and <CODE>OSVReport</CODE>)</TD>
35    <TD> </TD></TR>
36  <TR>
37    <TH>2</TH>
38<TH>OS_REPORT_NAND</TH>
39<TD>Sets the output destination to Wii console NAND memory</TD>
40    <TD> </TD></TR></TBODY></TABLE>
41<H2>Return Values</H2>
42<p>
43Returns 0 if successful or one of the following codes if unsuccessful.
44<p>
45<code>NAND_RESULT_ACCESS<br> NAND_RESULT_ALLOC_FAILED<br> NAND_RESULT_BUSY<br> NAND_RESULT_CORRUPT<br> NAND_RESULT_EXISTS<br> NAND_RESULT_INVALID<br> NAND_RESULT_MAXFD<br> NAND_RESULT_NOEXISTS<br> NAND_RESULT_UNKNOWN<br> NAND_RESULT_FATAL_ERROR<br></code>
46</p>
47</p>
48
49<H2>Description</H2>
50<P>Changes the output destination for the string that is output when the <CODE>OS(V)Report</CODE> function is called.<BR>Developers can choose either serial output or Wii console NAND memory as the output destination.<BR>The <code>OSReportDestination</code> function is effective in cases such as when debugging on hardware that cannot use serial output.<BR>
51
52<p><strong><B>Note:</B></strong> The oslog library is linked when using OSReportDestination. Memory for writing to NAND must be allocated using <a href="osreporviewer.html"><CODE>OSReportViewer</CODE></a>. Before using OSReportDestination, we recommend that you take a look at <A href="intro.html"><CODE>OSLog Overview</CODE></A> first.</p>
53
54
55<H3><CODE>OS_REPORT_SERIAL</CODE></H3>
56<P>Outputs the results of <CODE>OS(V)Report</CODE> to the serial port of the development hardware in the conventional way.
57<P>
58<H3><CODE>OS_REPORT_NAND</CODE></H3>
59<P>Sets Wii console NAND memory as the output destination for <CODE>OS(V)Report</CODE>.<BR>The written-out <CODE>OS(V)Report</CODE> logs are temporarily stored in Wii console main memory. <B>When <A href="OSReportFlush.html"><CODE>OSReportFlush</CODE></A> is called, these logs are all written to Wii console NAND memory.</B><BR> When flushing a large amount of text, we recommend that you call <A href="OSReportFlush.html"><CODE>OSReportFlush</CODE></A> periodically.<BR><BR>Example:<BR> <CODE>OSReportDestination( OS_REPORT_NAND );<BR> <BR> OSReport(&quot;Clear blue sky today\n&quot;);<BR> OSReport(&quot;Will skies be clear blue tomorrow, too?\n&quot;);<BR> ......................<BR> OSReport(&quot;Come to think of it, we might have written a large number of characters already&quot;);<BR> <BR> OSReportDestination( OS_REPORT_SERIAL ); // All strings are written temporarily to Wii console NAND memory<BR> OSReportDestination( OS_REPORT_NAND ); // Resume writing to Wii console NAND memory</CODE><BR> <BR> The save data region of the Wii is used when writing to NAND. Pay attention to the remaining available capacity.<BR> <br>
60<H3><CODE>OS_REPORT_SERIAL | OS_REPORT_NAND</CODE></H3>
61<P>Performs simultaneous output to both the serial port and Wii console NAND memory.<br> <BR>
62<H2>See Also</H2>
63<P class=reference>
64<A href="intro.html">OSLog Overview</A><BR> <A href="../toc.html#OSLog" target="contents">Function for Saving Debug Output</A><BR> <A href="OSReportFlush.html"><CODE>OSReportFlush</CODE></A><BR> <A href="../Error/OSReport.html"><CODE>OSReport</CODE></A>
65</P>
66<H2>Revision History</H2>
67<P>
682010/08/20 Replaced <CODE>NAND_RESULT_MAXFILES</CODE> with <CODE>NAND_RESULT_MAXFD</CODE>, and revised the return values to be correct.<BR>2009/10/19 Made revisions to correspond with <CODE>OSVReport</CODE>.<BR>2009/7/10 Corrected the macro specifications for output to both the serial port and  to Wii console NAND memory.<BR>2008/11/19 Initial version.
69</P><hr><p>CONFIDENTIAL</p></body></HTML>
70